nhanes_sxq: Data from NHANES: number of sex partners

nhanes_sxqR Documentation

Data from NHANES: number of sex partners

Description

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

Usage

data("nhanes_sxq")

Format

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

Source

NHANES files demo_c.xpt and sxq_c.xpt

See Also

Construction of the data set is described by https://notstatschat.rbind.io/2015/05/26/zero-inflated-poisson-from-complex-samples/

Examples

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")

svyVGAM documentation built on March 31, 2023, 5:40 p.m.