usethnicity | R Documentation |
This data set contains variables on race and ethnic identification from the 2017 Youth Risk Behaviour Survey, together with two variables on smoking behaviour. The YRBS is a multistage cluster-sampled survey, so valid inference about associations requires using survey design information. This subset is useful only for demonstration purposes.
data("usethnicity")
A data frame with 14765 observations on the following 4 variables.
Q4
1 is "Hispanic or Latino
Q5
Character string with zero or more of: A. American Indian or Alaska Native, B. Asian, C. Black or African American, D. Native Hawaiian or Other Pacific Islander, E. White
QN30
1 is "smoked cigarettes on one or more of the past 30 days"
QN31
1 is "smoked more than 10 cigarettes per day on the days they smoked during the past 30 days", those who did not smoke at all are NA
https://www.cdc.gov/healthyyouth/data/yrbs/data.htm
data(usethnicity)
race<-as.mr(strsplit(as.character(usethnicity$Q5),""))
race<-mr_drop(race," ")
mtable(race)
hispanic<-as.mr(usethnicity$Q4==1,"Hispanic")
ethnicity<-mr_union(race,hispanic)
ethnicity[101:120]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.