Editing Statistics and Statistical Programming (Winter 2017)/R lecture outline: Week 6
From CommunityData
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 5: | Line 5: | ||
dimnames(gen.pol) <- list(gender = c("F", "M") | dimnames(gen.pol) <- list(gender = c("F", "M") | ||
party = c("Democrat","Independent", "Republican")) | party = c("Democrat","Independent", "Republican")) | ||
** with tapply: tapply(warpbreaks$breaks, list(warpbreaks$wool, warpbreaks$tension), sum) | ** with tapply: tapply(warpbreaks$breaks, list(warpbreaks$wool, warpbreaks$tension), sum) | ||
** creating it with table(): table(cut(airquality$Temp, quantile(airquality$Temp)), airquality$Month) | ** creating it with table(): table(cut(airquality$Temp, quantile(airquality$Temp)), airquality$Month) | ||
* once we have tables, we can look at them: margin.table() is fast; prop.table() is super useful | * once we have tables, we can look at them: margin.table() is fast; prop.table() is super useful | ||
* chisq tests: chisq.test() | * chisq tests: chisq.test() | ||
** looking into the chisq.test() object; i often use TAB | ** looking into the chisq.test() object; i often use TAB | ||
* debugging code | * debugging code | ||
** print line debugging | ** print line debugging | ||
** running the inside of functions | ** running the inside of functions |