4. It is of interest to study the effect of population size in various cities in the United States on ozone concentratio
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
4. It is of interest to study the effect of population size in various cities in the United States on ozone concentratio
solutions (please resize the plot to be between 2-3inches on either side). > Ozone<-scan() > Population<-scan() > Ozone_df<- data.frame (Ozone, Population) > plot (Ozone Population, data=Ozone_df,xlab="Population (millions)", + ylab="Ozone (ppb/hr)") b) Fit the regression model for predicting the Ozone concentration with population. What proportion of the variability in the ozone levels is explained by a linear model using the variable Population? > Ozone_Model<-lm (Ozone-Population, data=Ozone_df) > summary (Ozone_Model) Add the regression line to your plot (paste this into your solutions as well) with the command: > abline (Ozone_Model) c) Use the predict method (see pg. 136 in the Class Notes) with the linear model from part (b) to find i. a 95% confidence interval for the mean ozone concentration for cities with a population of 3 million ii. a 95% prediction interval for the ozone concentration for a (single) city of 3 million people Note: The default value of the level in the confidence and prediction levels in the predict function is level=0.95. For other levels, you can pass in the desired level by changing the default value, e.g., setting level =0.99 gives 99%.
4. It is of interest to study the effect of population size in various cities in the United States on ozone concentrations. The data consist of the 1999 population in millions and the amount of ozone present per hour in ppb (parts per billion). The data are as follows. Ozone (ppb/hour), y 126 135 124 128 130 128 126 128 128 129 Population, x 0.6 4.9 0.2 0.5 1.1 0.1 1.1 2.3 0.6 2.3 a) Enter the data into R. Call the columns Ozone and Population. Use R to construct a scatterplot of the data. Paste the scatterplot into your