drug.use <- read.csv("https://raw.githubusercontent.com/fivethirtyeight/data/master/drug-use-by-age/drug-use-by-age.csv")
View(drug.use)
# load data
For each age group, what drug has the highest percentage of users?
Each case is each individual age group and there are 17 of them.
Data was collected using surveys in 2012 in mode of audio computer-assisted self interviews (ACASI), computer-assisted personal interviews (CAPI) and computer-assisted self interviews (CASI)
This study is a survey method research study. Participants completed surveys via audio computer-assisted self interviews (ACASI), computer-assisted personal interviews (CAPI) or computer-assisted self interviews (CASI).
The response variable or dependent variable is drug use in past 12 months. This is the variable we are measuring and it is numerical.
The explanatory variable is age. We expect this variable to make a difference in the (influence) the response variable.
The big question I want answered is which drug is most prevelant in each age group. Provide summary statistics relevant to your research question. For example, if you’re comparing means across groups provide means, SDs, sample sizes of each group. This step requires the use of R, hence a code chunk is provided below. Insert more code chunks as needed.
drug.use <- as.data.frame(drug.use[c(1:3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27)])
View(drug.use)
#I'll write code to find the highest percent in each row and report back age, n, and highest percent