Learn R Programming

glca (version 0.1.0)

brfss: Behavioral Risk Factor Surveillance System 2017 (BRFSS 2017)

Description

This data is comprised of questions related to healthy lifestyles, such as obesity, exercise time, eating habits, and smoking and drinking behaviors from the BRFSS 2017 survey. State is a group variable indicating the respondent's residential state. The data includes both individual-level (level-1) and group-level (level-2) covariates. The level-1 covariates include respondents' gender and income level. The level-2 covariates are regions of the United States and political parties which won the 2016 presidential election in the state.

Arguments

Format

A data frame with 444023 observations on the following 10 variables.

OBESE

(original : _RFBMI5) Adults who have a body mass index greater than 25.00 (Overweight or Obese)

(1) No (2) Yes

PA300

(original : _PA300R2) Adults that participated in 300 minutes (or vigorous equivalent minutes) of physical activity per week

(1) 301+ minutes (2) 1-300 minutes (3) 0 minutes

FRTLT1A

(original : _FRTLT1A) Consume fruit 1 or more times per day

(1) Yes (2) No

VEGLT1A

(original : _VEGLT1A) Consume vegetables 1 or more times per day

(1) Yes (2) No

SMOKER

(original : _SMOKER3) Four-level smoker status

(1) Never smoked (2) Former smoker (3) Occational smoker (4) Everyday smoker

DRNK30

(original : DRNKANY5) Adults who reported having had at least one drink of alcohol in the past 30 days

(1) No (2) Yes

SEX

Respondents Sex

INCOME

(original : INCOME2) Income level

STATE

(original : _STATE) State FIPS code

REGION

Region to which the state belongs

PARTY

The party that won the 2016 presidential election by state

References

Centers for Disease Control and Prevention. (2017). 2017 Behavioral Risk Factor Surveillance System Survey Data. Retrieved from https://www.cdc.gov/brfss/.

MIT Election Data and Science Lab, (2017). U.S. President 1976-2016. Retrieved from 10.7910/DVN/42MVDX.

Examples

Run this code
# NOT RUN {
data("brfss")
# }
# NOT RUN {
brfss1000 = brfss[sample(1:nrow(brfss), 1000),]

# Model 1: LCA
lca = glca(item(OBESE, PA300, FRTLT1A, VEGLT1A, SMOKER, DRNK30) ~ 1,
   data = brfss1000, nclass = 3)
summary(lca)

# Model 2: MGLCA
mglca = glca(item(OBESE, PA300, FRTLT1A, VEGLT1A, SMOKER, DRNK30) ~ 1,
   group = SEX, data = brfss1000, nclass = 3)
summary(mglca)

# Model 3: MGLCA with covariate(s)
mglcr = glca(item(OBESE, PA300, FRTLT1A, VEGLT1A, SMOKER, DRNK30) ~ REGION,
   group = SEX, data = brfss1000, nclass = 3)
summary(mglcr)
coef(mglcr)

# Model 4: MLCA
mlca = glca(item(OBESE, PA300, FRTLT1A, VEGLT1A, SMOKER, DRNK30) ~ 1,
   group = STATE, data = brfss1000, nclass = 3, ncluster = 2)
summary(mlca)

# Model 5: MLCA with level-1 covariate(s) only
mlcr = glca(item(OBESE, PA300, FRTLT1A, VEGLT1A, SMOKER, DRNK30) ~ SEX,
            group = STATE, data = brfss1000, nclass = 3, ncluster = 2)
summary(mlcr)
coef(mlcr)

# Model 6: MLCA with level-1 and level-2 covariate(s)
# (SEX: level-1 covariate, PARTY: level-2 covariate)
mlcr2 = glca(item(OBESE, PA300, FRTLT1A, VEGLT1A, SMOKER, DRNK30) ~ SEX + PARTY,
             group = STATE, data = brfss1000, nclass = 3, ncluster = 2)
summary(mlcr2)
coef(mlcr2)
# }

Run the code above in your browser using DataLab