Starting from:
$30

$24

Homework 4 (Data Analysis Using R) Solution

Instructions:




Copy your answer to each question AND the R code by which you reached your answer to a document. The answers should be correctly ordered.



Problem 1 (6 pts): The text le "carseats.txt" is a data set containing sales of child car seats at di erent stores. It consists of 11 variables but we will focus on 2 variables.




Urban: Yes and No to indicate whether the store is in an urban or rural location




US: Yes and No to indicate whether the store is in the US or not




Complete the following questions:




(2 pt) Find the 90% con dence interval to estimate the population proportion of store located in urban area and interpret the con dence interval.



(2 pt) Find the 95% con dence interval to estimate the population proportion of store located in US and interpret the con dence interval.



(2 pt) Studies found that more than 60% of stores are located in the US. Perform the hypothesis test H0 : p = 0:6 vs. Ha : p 0:6. Make your nal conclusion based on the p-value.



Problem 2 (4 pts): The data set whiteside is available after loading the MASS package by calling library(MASS). It consists of following 3 variables.




Insul: A factor, before or after cavity-wall insulation installed




Temp: The average outside temperature in degrees Celsius




Gas: The gas consumption in 1000s of cubic feet.




Complete the following questions:




(2 pt) Find the 95% con dence interval to estimate the population mean of Gas consumption and interpret the con dence interval.



(2 pt) Before cavity-wall insulation installed, the average Gas consumption was 4.75. The researcher wants to prove after cavity-wall insulation installed, the average Gas consumption is less than 4.75. Perform the hypothesis test H0 : = 4:75 vs. Ha : < 4:75 using observations whose Insul = After. Make your nal conclusion based on the p-value.









1

More products