Question
Problem 6: R simulation.Use the following codes to read the observed frequencies of how much the students smoke in dataset survey library(MASS) # if you
Problem 6: R simulation.Use the following codes to read the observed frequencies of how much the students smoke in dataset "survey" library(MASS) # if you have not installed the package, run install.packages("MASS'.) first. survey-na.omit(survey) # remove data with missing values smoke.freq table(surveySSmoke) # the frequencies of smoke (1) Suppose the campus smoking statistics is as below. Determine whether the sample data in survey supports it at 0.05 significance level. (Hint: using the command chisq.test.) Heavy Never Occas Regul 0.045 0.795 0.0850.075 (2) Describe the test associated with the command chisq.test(smoke.freq) (3) Use the code table(surveySSex, survey$Exer) to obtain a contingency table of the vari- ables Sex (the sex of the student) and Exer (how often the student exercises). Test whether there is an association between the two variables.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started