nhanes_sxq | R Documentation |
These data are from the NHANES 2003-2004 survey in the US. They provide an example of overdispersed count data that motivates a two-component zero-inflation model
data("nhanes_sxq")
A data frame with 2992 observations on the following 7 variables.
SDMVPSU
Primary Sampling Unit
SDMVSTRA
stratum
WTINT2YR
weights
malepartners
lifetime number of male sexual partners
RIDAGEYR
age in years
DMDEDUC
level of education: 1=less than high school, 2=high school, 3-more than high school, 7=refused
RIDRETH1
Race/ethnicity: 1=Mexican American, 2=Other Hispanic, 4=non-Hispanic White, 5=non-Hispanic Black, 5=Other
NHANES files demo_c.xpt
and sxq_c.xpt
Construction of the data set is described by https://notstatschat.rbind.io/2015/05/26/zero-inflated-poisson-from-complex-samples/
data(nhanes_sxq)
nhdes = svydesign(id=~SDMVPSU,strat=~SDMVSTRA,weights=~WTINT2YR, nest=TRUE, data=nhanes_sxq)
svy_vglm(malepartners~RIDAGEYR+factor(RIDRETH1)+DMDEDUC, zipoisson(), design=nhdes, crit = "coef")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.