For all the coding tasks below, create a single R Script and save it with the file name format {familyname_firstname.R}. Make sure to submit the file on or before the deadline.
In a study to estimate the proportion of residents in a certain city and its suburbs who favor the construction of a nuclear power plant, it is found that 63 of 100 urban residents favor the construction while only 59 of 125 suburban residents are in favor. Is there a significant difference between the proportions of urban and suburban residents who favor construction of the nuclear plant? Make use of a P-value.
A marketing expert for a pasta-making company believes that 40% of pasta lovers prefer lasagna. If 9 out of 20 pasta lovers choose lasagna over other pastas, what can be concluded about the expert’s claim? Use a 0.05 level of significance.
In an experiment to study the dependence of hypertension on smoking habits, the following data were taken on 180 individuals:
## Non-smokers Moderate Smokers Heavy Smokers
## hypertension 21 36 30
## no hypertension 48 26 19
If the result in 3. suggests that there is an association between hypertension and smoking habits, compute the Pearson residuals (r) and visualize them using the corrplot() function. Make a short discussion on the notable associations between rows and columns.
The following data represent the running times of films produced by two motion-picture companies:
test the hypothesis that