Survey-Weighted Analysis of Self-Reported Health Indicators

Design-based analysis of population health survey data from the World Health Organization (WHO) Stepwise Approach to Non-Communicable Disease (NCD) Risk Factor Surveillance (STEPS), Demographic and Health Surveys (DHS), Multiple Indicator Cluster Surveys (MICS) and similar complex sample surveys, where chronic conditions are self-reported rather than coded with the International Classification of Diseases (ICD). Provides survey design constructors for DHS, MICS and STEPS microdata; design-based prevalence for any binary indicators and groupings; a self-reported multimorbidity count based on the Functional Comorbidity Index (FCI) of Groll et al. (2005) , with condition-pattern analysis, sensitivity bounds for missing answers, and direct age standardisation to the WHO World Standard Population; standard, generalized, Erreygers and Wagstaff concentration indices with design-based standard errors following Kakwani, Wagstaff and van Doorslaer (1997) and O'Donnell et al. (2016) , concentration curves, and slope and relative indices of inequality; categorisation of DHS-coded child growth z-scores; publication-ready tables and plots. Simulated example data with a known population are included. Experimental helpers for choropleth maps and case-weighted gradient boosting with SHapley Additive exPlanations (SHAP) are also provided.


SurveyNCD: Survey-Weighted Analysis of Self-Reported Health Indicators

CRAN status CRAN Downloads CRAN Monthly Downloads R-CMD-check Documentation License: MIT CRAN checks

SurveyNCD provides specialized tools for analysing population health survey data from the World Health Organization (WHO) Stepwise Approach to Non-Communicable Disease (NCD) Risk Factor Surveillance (STEPS), Demographic and Health Surveys (DHS), Multiple Indicator Cluster Surveys (MICS), and similar complex sample surveys.

In population surveys, chronic conditions are typically self-reported rather than coded using the International Classification of Diseases (ICD). Standard statistical functions (like mean() or unweighted regression) produce biased estimates and misleading p-values because they ignore the survey design. SurveyNCD bridges this gap by accounting for stratification, clustering (PSUs), and sampling weights throughout the analytical workflow.


Installation

Released version from CRAN (Recommended)

You can install the published version directly from CRAN:

install.packages("SurveyNCD")

Development version from GitHub

To install the latest development build from GitHub:

# install.packages("remotes")
remotes::install_github("StatAid-Research-Lab/SurveyNCD")

What SurveyNCD does

Four steps cover a typical analysis: build the design once, clean and score the answers, estimate, then report.

Step Functions
1. Design dhs_design(), mics_design(), steps_design(): the correct design from each programme's standard variable names (or any survey/srvyr design)
2. Clean and score recode_binary() (1/2/9 or text codes to 0/1/NA), multimorbidity_index() (condition count, adjustable threshold), fci_items(), who_anthro_score() (DHS-coded child z-scores)
3. Estimate survey_prevalence() (any binary indicators, several grouping variables), mm_prevalence(), mm_standardize() with who_standard_population() (age standardisation), mm_patterns() (pairs and triads, observed/expected), mm_bounds() ("don't know" sensitivity bounds)
4. Inequality survey_concentration_index() (standard, generalized, Erreygers, Wagstaff; by group), survey_concentration_curve(), survey_slope_index() (SII and RII)
Report ncd_table() (publication-ready table), autoplot() methods for every result
Experimental survey_map_indicator(), survey_xgboost(), survey_shap(), plot_shap_summary()

All variance estimation is done by the survey package, so every standard error reflects strata, clusters and weights. Each estimator is tested against an independent calculation.

Experimental functions. The machine-learning functions apply sampling weights as case weights but do not carry strata and clusters into any measure of uncertainty. Use them to explore patterns, not for inference. Their interface may change.


Quick start

library(SurveyNCD)

d <- ncd_survey                                   # simulated STEPS-style data
d$htn <- recode_binary(d$htn_raw, yes = 1, no = 2)
d$dm  <- recode_binary(d$dm_raw,  yes = 1, no = 2)
d$dep <- recode_binary(d$dep_raw, yes = "Yes", no = "No")
d <- multimorbidity_index(d, c("htn", "dm", "dep"), na_action = "na")

des <- steps_design(d, weight = "wt")             # psu / stratum / weight

ncd_table(des, c("htn", "dm", "dep"), by = "sex")             # formatted table
survey_prevalence(des, "htn", by = c("sex", "residence"))     # numbers behind it
mm_prevalence(des, by = "residence")                          # multimorbidity
mm_patterns(des, c("htn", "dm", "dep"))                       # common pairs
survey_concentration_index(des, dm, wealth_score, type = "erreygers")
ggplot2::autoplot(survey_concentration_curve(des, dm, wealth_score))

With DHS data:

des <- dhs_design(ir_data)    # PSU v021, strata v023, weight v005 / 1e6

Example data and a complete worked analysis

Two simulated datasets ship with the package so that every function can be tried immediately: ncd_survey (2,400 adults, STEPS-style raw codes, 12 strata, 120 PSUs, unequal weights) and child_anthro (1,034 children with DHS-coded z-scores). They are drawn from a known synthetic population (data-raw/), so estimates can be checked against the truth. Regions are fictitious.

vignette("full-workflow", package = "SurveyNCD")   # simulated data, every function
vignette("real-data-nhanes", package = "SurveyNCD") # real NHANES 2009-2010 data

The repository's analysis/ folder reproduces every table and figure in the papers describing the package, including a 1,000-sample simulation study of bias and confidence-interval coverage (Rscript analysis/run_all.R).


Limitations

  • Complete-case handling. With na_action = "na", any respondent with a missing condition gets a missing score and is excluded from mm_prevalence() (the number excluded is reported). No weight adjustment for this exclusion is made, which can bias estimates when missingness is common.
  • "Multimorbid" is a convention. It means at least threshold (default 2) of the conditions you supply. With fewer than the 18 FCI conditions this is a condition count, not the validated FCI. mm_bounds() shows how much the "don't know" answers could matter.
  • who_anthro_score() categorises undernutrition tiers only (no overweight category).
  • The gradient-boosting module applies case weights only; it does not propagate strata and clusters into uncertainty and is not design-based inference.
  • Concentration-index standard errors treat the ranks as fixed; a design bootstrap gave standard errors within about 11% in the validation study.
  • Validated on simulated data with a known population and against independent calculations, and demonstrated on real NHANES data (vignette("real-data-nhanes")). Not yet benchmarked against a published STEPS, DHS or MICS report.

Citation

If you use SurveyNCD in your research, academic publications, or policy reports, please cite it:

citation("SurveyNCD")
@Manual{,
  title = {SurveyNCD: Survey-Weighted Analysis of Self-Reported Health Indicators},
  author = {Sujon Mia},
  year = {2026},
  note = {R package version 0.2.0},
  url = {https://CRAN.R-project.org/package=SurveyNCD},
  doi = {10.32614/CRAN.package.SurveyNCD}
}

Acknowledgments

The development of the SurveyNCD package and the establishment of StatAid Research Lab were conducted under the academic mentorship and guidance of Dr. Md. Atiqul Islam, Professor in the Department of Statistics, Jagannath University. The author is deeply grateful for his continuous guidance, statistical advice, and support of this research initiative.


License

MIT (c) Sujon Mia

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("SurveyNCD")

0.2.0 by Sujon Mia, 6 days ago


https://github.com/StatAid-Research-Lab/SurveyNCD


Report a bug at https://github.com/StatAid-Research-Lab/SurveyNCD/issues


Browse source code at https://github.com/cran/SurveyNCD


Authors: Sujon Mia [aut, cre] , Md. Atiqul Islam [ctb] (Professor & Academic Mentor , Department of Statistics)


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports dplyr, ggplot2, magrittr, rlang, stats, survey, tidyr

Suggests knitr, rmarkdown, sf, srvyr, testthat, xgboost


See at CRAN