{
  "_id": "6a46a4436ff6f2357554fbbe",
  "Package": "weightflow",
  "Title": "Declarative API for Staged Survey Weights",
  "Version": "0.1.0",
  "Authors@R": "person(\"Juan Pablo\", \"Ferreira\", email = \"juanpablo.ferreira@fcea.edu.uy\", role = c(\"aut\", \"cre\"))",
  "Description": "Builds survey weights from design base weights by chaining\nhierarchical adjustments (unknown eligibility, nonresponse and\ncalibration) through a declarative, pipeable,\n'tidymodels'-style API. Calibration follows Deville and Sarndal\n(1992) <doi:10.2307/2290268>. Variances are obtained with a\nbootstrap that resamples primary sampling units and re-applies\nthe whole recipe on each replicate, following the rescaling\nbootstrap of Rao and Wu (1988)\n<doi:10.1080/01621459.1988.10478591>, so the replicate weights\ncarry the variability of every adjustment. The weights also\nbridge to the 'survey' and 'srvyr' packages for design-based\ninference.",
  "License": "MIT + file LICENSE",
  "Encoding": "UTF-8",
  "Language": "en-US",
  "Roxygen": "list(markdown = TRUE, roclets = c(\"rd\"))",
  "Config/roxygen2/version": "8.0.0",
  "URL": "https://github.com/jpferreira33/weightflow,\nhttps://jpferreira33.github.io/weightflow/",
  "BugReports": "https://github.com/jpferreira33/weightflow/issues",
  "Config/testthat/edition": "3",
  "LazyData": "true",
  "VignetteBuilder": "knitr",
  "Repository": "https://jpferreira33.r-universe.dev",
  "Date/Publication": "2026-07-02 17:13:40 UTC",
  "RemoteUrl": "https://github.com/jpferreira33/weightflow",
  "RemoteRef": "HEAD",
  "RemoteSha": "639c646ae196cf1e117fa88b3fb1b954b0df1dc4",
  "NeedsCompilation": "no",
  "Packaged": {
    "Date": "2026-07-02 17:44:26 UTC",
    "User": "root"
  },
  "Author": "Juan Pablo Ferreira [aut, cre]",
  "Maintainer": "Juan Pablo Ferreira <juanpablo.ferreira@fcea.edu.uy>",
  "MD5sum": "d81db7d2ec5e6d8becfca75b326656bb",
  "_user": "jpferreira33",
  "_type": "src",
  "_file": "weightflow_0.1.0.tar.gz",
  "_fileid": "cb7dab9e89694cc18bfe2ade3ab790bff33568c8e94f8ca04b04e549bc420783",
  "_filesize": 1439424,
  "_sha256": "cb7dab9e89694cc18bfe2ade3ab790bff33568c8e94f8ca04b04e549bc420783",
  "_created": "2026-07-02T17:44:26.000Z",
  "_published": "2026-07-02T17:47:47.028Z",
  "_distro": "resolute",
  "_jobs": [
    {
      "job": 84840362316,
      "time": 147,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "8047160925"
    },
    {
      "job": 84840362387,
      "time": 163,
      "config": "linux-release-x86_64",
      "r": "4.6.1",
      "check": "OK",
      "artifact": "8047167386"
    },
    {
      "job": 84840362348,
      "time": 100,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "8047142400"
    },
    {
      "job": 84840362433,
      "time": 84,
      "config": "macos-release-arm64",
      "r": "4.6.1",
      "check": "OK",
      "artifact": "8047136730"
    },
    {
      "job": 84839761160,
      "time": 180,
      "config": "source",
      "r": "4.6.1",
      "check": "OK",
      "artifact": "8047100665"
    },
    {
      "job": 84840362308,
      "time": 147,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "8047161409"
    },
    {
      "job": 84840362351,
      "time": 88,
      "config": "windows-devel",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "8047138108"
    },
    {
      "job": 84840362333,
      "time": 123,
      "config": "windows-oldrel",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "8047151850"
    },
    {
      "job": 84840362368,
      "time": 84,
      "config": "windows-release",
      "r": "4.6.1",
      "check": "OK",
      "artifact": "8047136631"
    }
  ],
  "_buildurl": "https://github.com/r-universe/jpferreira33/actions/runs/28609981471",
  "_status": "success",
  "_host": "GitHub-Actions",
  "_upstream": "https://github.com/jpferreira33/weightflow",
  "_commit": {
    "id": "639c646ae196cf1e117fa88b3fb1b954b0df1dc4",
    "author": "Juan Pablo Ferreira <jferreir@ine.gub.uy>",
    "committer": "Juan Pablo Ferreira <jferreir@ine.gub.uy>",
    "message": "Add CONTRIBUTING.md for community guidelines\n",
    "time": 1783012420
  },
  "_maintainer": {
    "name": "Juan Pablo Ferreira",
    "email": "juanpablo.ferreira@fcea.edu.uy"
  },
  "_registered": true,
  "_dependencies": [
    {
      "package": "R",
      "version": ">= 4.1.0",
      "role": "Depends"
    },
    {
      "package": "stats",
      "role": "Imports"
    },
    {
      "package": "utils",
      "role": "Imports"
    },
    {
      "package": "graphics",
      "role": "Imports"
    },
    {
      "package": "rpart",
      "role": "Suggests"
    },
    {
      "package": "ranger",
      "role": "Suggests"
    },
    {
      "package": "testthat",
      "version": ">= 3.0.0",
      "role": "Suggests"
    },
    {
      "package": "survey",
      "role": "Suggests"
    },
    {
      "package": "srvyr",
      "role": "Suggests"
    },
    {
      "package": "dplyr",
      "role": "Suggests"
    },
    {
      "package": "tidyr",
      "role": "Suggests"
    },
    {
      "package": "ggplot2",
      "role": "Suggests"
    },
    {
      "package": "haven",
      "role": "Suggests"
    },
    {
      "package": "archive",
      "role": "Suggests"
    },
    {
      "package": "knitr",
      "role": "Suggests"
    },
    {
      "package": "rmarkdown",
      "role": "Suggests"
    },
    {
      "package": "spelling",
      "role": "Suggests"
    },
    {
      "package": "xgboost",
      "role": "Suggests"
    }
  ],
  "_owner": "jpferreira33",
  "_selfowned": true,
  "_usedby": 0,
  "_updates": [
    {
      "week": "2026-25",
      "n": 19
    },
    {
      "week": "2026-26",
      "n": 15
    },
    {
      "week": "2026-27",
      "n": 4
    }
  ],
  "_tags": [
    {
      "name": "v0.1.0",
      "date": "2026-06-20"
    }
  ],
  "_stars": 1,
  "_contributors": [
    {
      "user": "jpferreira33",
      "count": 38,
      "uuid": 66394568
    }
  ],
  "_userbio": {
    "uuid": 66394568,
    "type": "user",
    "name": "Juan Pablo Ferreira",
    "followers": 26,
    "description": "Survey Statistician | Professor at IESTA - FCEA - UDELAR | Director of Methodology and Research at the National Institute of Statistics of Uruguay"
  },
  "_downloads": {
    "count": 38,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/weightflow"
  },
  "_devurl": "https://github.com/jpferreira33/weightflow",
  "_pkgdown": "https://jpferreira33.github.io/weightflow/",
  "_searchresults": 11,
  "_rbuild": "4.6.1",
  "_assets": [
    "extra/citation.cff",
    "extra/citation.html",
    "extra/citation.json",
    "extra/citation.txt",
    "extra/contents.json",
    "extra/NEWS.html",
    "extra/NEWS.txt",
    "extra/readme.html",
    "extra/readme.md",
    "extra/weightflow.html",
    "LICENSE",
    "manual.pdf"
  ],
  "_homeurl": "https://github.com/jpferreira33/weightflow",
  "_realowner": "jpferreira33",
  "_cranurl": true,
  "_releases": [
    {
      "version": "0.1.0",
      "date": "2026-06-30"
    }
  ],
  "_exports": [
    "as_svrepdesign",
    "as_svydesign",
    "boot_mean",
    "boot_total",
    "bootstrap_estimate",
    "bootstrap_weights",
    "collect_replicate_weights",
    "collect_weights",
    "design_effect",
    "prep",
    "report_weighting",
    "step_assert",
    "step_calibrate",
    "step_drop_ineligible",
    "step_model_calibration",
    "step_nonresponse",
    "step_rescale",
    "step_round",
    "step_select_within",
    "step_trim",
    "step_trim_weights",
    "step_unknown_eligibility",
    "weight_factors",
    "weighting_spec",
    "y_model"
  ],
  "_datasets": [
    {
      "name": "population",
      "title": "Example target population for weightflow",
      "object": "population",
      "class": [
        "data.frame"
      ],
      "fields": [
        "person_id",
        "household_id",
        "psu",
        "region",
        "sex",
        "age",
        "income",
        "employed"
      ],
      "rows": 4495,
      "table": true,
      "tojson": true
    },
    {
      "name": "sample_one",
      "title": "Example survey sample (select-one-person, multistage)",
      "object": "sample_one",
      "class": [
        "data.frame"
      ],
      "fields": [
        "person_id",
        "household_id",
        "psu",
        "region",
        "sex",
        "age",
        "pw",
        "status",
        "unknown_elig",
        "ineligible",
        "hh_responded",
        "responded",
        "n_elig",
        "p_within",
        "income",
        "employed"
      ],
      "rows": 417,
      "table": true,
      "tojson": true
    },
    {
      "name": "sample_survey",
      "title": "Example survey sample (take-all roster)",
      "object": "sample_survey",
      "class": [
        "data.frame"
      ],
      "fields": [
        "person_id",
        "household_id",
        "psu",
        "region",
        "sex",
        "age",
        "pw",
        "unknown_elig",
        "responded",
        "income",
        "employed"
      ],
      "rows": 467,
      "table": true,
      "tojson": true
    }
  ],
  "_help": [
    {
      "page": "as_svydesign",
      "title": "Export weightflow weights to a survey design",
      "topics": [
        "as_svrepdesign",
        "as_svydesign"
      ]
    },
    {
      "page": "bootstrap_estimate",
      "title": "Bootstrap estimate, standard error and confidence interval",
      "topics": [
        "bootstrap_estimate",
        "boot_mean",
        "boot_total"
      ]
    },
    {
      "page": "bootstrap_weights",
      "title": "Bootstrap replicate weights that re-apply the recipe",
      "topics": [
        "bootstrap_weights"
      ]
    },
    {
      "page": "collect_replicate_weights",
      "title": "Collect replicate weights into a data frame ready for srvyr",
      "topics": [
        "collect_replicate_weights"
      ]
    },
    {
      "page": "collect_weights",
      "title": "Extract the data with the computed weights",
      "topics": [
        "collect_weights"
      ]
    },
    {
      "page": "design_effect",
      "title": "Kish design effect from unequal weighting",
      "topics": [
        "design_effect"
      ]
    },
    {
      "page": "plot.prepped_weighting_spec",
      "title": "Diagnostic plots for the weights",
      "topics": [
        "plot.prepped_weighting_spec"
      ]
    },
    {
      "page": "population",
      "title": "Example target population for weightflow",
      "topics": [
        "population"
      ]
    },
    {
      "page": "prep",
      "title": "Estimate the weighting cascade",
      "topics": [
        "prep"
      ]
    },
    {
      "page": "report_weighting",
      "title": "Build a nice HTML report of the weighting recipe",
      "topics": [
        "report_weighting"
      ]
    },
    {
      "page": "sample_one",
      "title": "Example survey sample (select-one-person, multistage)",
      "topics": [
        "sample_one"
      ]
    },
    {
      "page": "sample_survey",
      "title": "Example survey sample (take-all roster)",
      "topics": [
        "sample_survey"
      ]
    },
    {
      "page": "step_assert",
      "title": "Assert conditions on the weights at this point of the cascade",
      "topics": [
        "step_assert"
      ]
    },
    {
      "page": "step_calibrate",
      "title": "Calibration to population totals",
      "topics": [
        "step_calibrate"
      ]
    },
    {
      "page": "step_drop_ineligible",
      "title": "Drop ineligible (out-of-scope) units",
      "topics": [
        "step_drop_ineligible"
      ]
    },
    {
      "page": "step_model_calibration",
      "title": "Model calibration (model-assisted, Wu & Sitter 2001)",
      "topics": [
        "step_model_calibration"
      ]
    },
    {
      "page": "step_nonresponse",
      "title": "Nonresponse adjustment",
      "topics": [
        "step_nonresponse"
      ]
    },
    {
      "page": "step_rescale",
      "title": "Rescale (normalize) the weights",
      "topics": [
        "step_rescale"
      ]
    },
    {
      "page": "step_round",
      "title": "Round the final weights",
      "topics": [
        "step_round"
      ]
    },
    {
      "page": "step_select_within",
      "title": "Within-household selection adjustment",
      "topics": [
        "step_select_within"
      ]
    },
    {
      "page": "step_trim",
      "title": "Trim extreme weights",
      "topics": [
        "step_trim"
      ]
    },
    {
      "page": "step_trim_weights",
      "title": "Automatic weight trimming (survey-style)",
      "topics": [
        "step_trim_weights"
      ]
    },
    {
      "page": "step_unknown_eligibility",
      "title": "Unknown-eligibility adjustment",
      "topics": [
        "step_unknown_eligibility"
      ]
    },
    {
      "page": "summary.prepped_weighting_spec",
      "title": "Detailed per-step diagnostics",
      "topics": [
        "summary.prepped_weighting_spec"
      ]
    },
    {
      "page": "weight_factors",
      "title": "Per-unit adjustment factors table",
      "topics": [
        "weight_factors"
      ]
    },
    {
      "page": "weighting_spec",
      "title": "Start a weighting specification",
      "topics": [
        "weighting_spec"
      ]
    },
    {
      "page": "y_model",
      "title": "Specify a working model for a study variable y",
      "topics": [
        "y_model"
      ]
    }
  ],
  "_pkglogo": "https://github.com/jpferreira33/weightflow/raw/HEAD/man/figures/logo.png",
  "_readme": "https://github.com/jpferreira33/weightflow/raw/HEAD/README.md",
  "_rundeps": [],
  "_vignettes": [
    {
      "source": "calibration.Rmd",
      "filename": "calibration.html",
      "title": "Calibration: raking, post-stratification and GREG",
      "engine": "knitr::rmarkdown",
      "headings": [
        "What calibration does",
        "Why calibration reduces variance: the regression link",
        "Post-stratification",
        "Raking",
        "Linear calibration (GREG)",
        "Bounded calibration",
        "Equal weights within a cluster",
        "Which to use",
        "References"
      ],
      "created": "2026-06-26 23:03:44",
      "modified": "2026-06-26 23:03:44",
      "commits": 1
    },
    {
      "source": "advanced-methods.Rmd",
      "filename": "advanced-methods.html",
      "title": "Machine learning, cross-fitting and robust calibration",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Flexible propensities",
        "The overfitting problem",
        "Cross-fitting",
        "Ridge (penalized) calibration",
        "Potter (MSE-optimal) trimming",
        "Putting it together",
        "References"
      ],
      "created": "2026-06-25 02:57:50",
      "modified": "2026-06-25 02:57:50",
      "commits": 1
    },
    {
      "source": "model-calibration.Rmd",
      "filename": "model-calibration.html",
      "title": "Model calibration (model-assisted weighting)",
      "engine": "knitr::rmarkdown",
      "headings": [
        "The idea",
        "In weightflow, with a random forest",
        "Validation: the constraints are met exactly",
        "Does it help the estimate?",
        "What you need: unit-level auxiliaries",
        "The hybrid: model term and consistency constraints",
        "Relationship to the literature"
      ],
      "created": "2026-06-20 14:10:19",
      "modified": "2026-06-26 03:19:50",
      "commits": 2
    },
    {
      "source": "nonresponse-propensities.Rmd",
      "filename": "nonresponse-propensities.html",
      "title": "Nonresponse: weighting classes and propensities",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Weighting classes",
        "Response propensities",
        "Logistic regression",
        "Trees, forests and boosting",
        "Flexibility, overfitting, and cross-fitting",
        "Person or household level",
        "Which to use"
      ],
      "created": "2026-06-20 14:10:19",
      "modified": "2026-06-26 12:37:07",
      "commits": 2
    },
    {
      "source": "weightflow.Rmd",
      "filename": "weightflow.html",
      "title": "Staged survey weighting: the adjustment logic",
      "engine": "knitr::rmarkdown",
      "headings": [
        "The starting point: design weights",
        "The cascade",
        "Unknown eligibility",
        "Ineligible units",
        "Within-household selection",
        "Nonresponse",
        "Calibration",
        "Trimming, rounding, rescaling",
        "Reading the cascade: the design effect",
        "Why the order matters"
      ],
      "created": "2026-06-20 14:10:19",
      "modified": "2026-06-25 11:56:26",
      "commits": 2
    },
    {
      "source": "validation-against-survey.Rmd",
      "filename": "validation-against-survey.html",
      "title": "Validation against the survey package",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Post-stratification",
        "Raking",
        "Linear (GREG) calibration",
        "Same estimates",
        "What weightflow adds"
      ],
      "created": "2026-06-20 14:10:19",
      "modified": "2026-06-20 14:10:19",
      "commits": 1
    },
    {
      "source": "variance-estimation.Rmd",
      "filename": "variance-estimation.html",
      "title": "Variance estimation",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Why the adjustments matter for variance",
        "Method 1: a PSU bootstrap that re-applies the recipe",
        "Estimates with bootstrap standard errors",
        "Method 2: hand the weights to the survey package",
        "Replicate weights for a tidyverse workflow",
        "Which one to use"
      ],
      "created": "2026-06-20 03:32:32",
      "modified": "2026-06-26 03:38:40",
      "commits": 2
    }
  ],
  "_score": 5.062581984228164,
  "_indexed": true,
  "_nocasepkg": "weightflow",
  "_universes": [
    "jpferreira33"
  ],
  "_binaries": [
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "0.1.0",
      "date": "2026-07-02T17:46:49.000Z",
      "distro": "resolute",
      "commit": "639c646ae196cf1e117fa88b3fb1b954b0df1dc4",
      "fileid": "845be870bc90c1e9099d8bdc323981162a128a304c3232bf200f4bfff9dac97e",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/jpferreira33/actions/runs/28609981471"
    },
    {
      "r": "4.6.1",
      "os": "linux",
      "version": "0.1.0",
      "date": "2026-07-02T17:47:05.000Z",
      "distro": "resolute",
      "commit": "639c646ae196cf1e117fa88b3fb1b954b0df1dc4",
      "fileid": "e31dca1ad4bb563a6b4bf20d48cb0c9f0a27c9600e640393114865c33cf425be",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/jpferreira33/actions/runs/28609981471"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "0.1.0",
      "date": "2026-07-02T17:46:06.000Z",
      "commit": "639c646ae196cf1e117fa88b3fb1b954b0df1dc4",
      "fileid": "61849c7b11dc43357ea356f68d3035f275bac7297a422b21e4892619ad24ac01",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/jpferreira33/actions/runs/28609981471"
    },
    {
      "r": "4.6.1",
      "os": "mac",
      "version": "0.1.0",
      "date": "2026-07-02T17:45:53.000Z",
      "commit": "639c646ae196cf1e117fa88b3fb1b954b0df1dc4",
      "fileid": "2f3bd3211c786acc61219f502eff30910da6eb49440a5f18aeeff069ca3545fb",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/jpferreira33/actions/runs/28609981471"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "0.1.0",
      "date": "2026-07-02T17:47:09.000Z",
      "commit": "639c646ae196cf1e117fa88b3fb1b954b0df1dc4",
      "fileid": "3f34361c466b128d5c22959e67497478de70394e39d33711f8794784aaa81a72",
      "status": "success",
      "buildurl": "https://github.com/r-universe/jpferreira33/actions/runs/28609981471"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "0.1.0",
      "date": "2026-07-02T17:45:39.000Z",
      "commit": "639c646ae196cf1e117fa88b3fb1b954b0df1dc4",
      "fileid": "f69cd9d9ab71f7479f4f56ca9a1d12eef12c7c7a3bce5dbd50420cb1eaf5ea3a",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/jpferreira33/actions/runs/28609981471"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "0.1.0",
      "date": "2026-07-02T17:46:10.000Z",
      "commit": "639c646ae196cf1e117fa88b3fb1b954b0df1dc4",
      "fileid": "7bf90fcf5db60a5b105423b6d9dc4718b8387044fac29ec1f8ecb6dfc8aff3c4",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/jpferreira33/actions/runs/28609981471"
    },
    {
      "r": "4.6.1",
      "os": "win",
      "version": "0.1.0",
      "date": "2026-07-02T17:45:43.000Z",
      "commit": "639c646ae196cf1e117fa88b3fb1b954b0df1dc4",
      "fileid": "f1842f3d2798d66c95bbc9c5f2c1b364cd58bf8af9b547b82d8f021b77ea451d",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/jpferreira33/actions/runs/28609981471"
    }
  ]
}