Due date: 23 August 2018


Write R code to perform the tasks below and obtain answers for the specific questions asked. Save the final R code in a single file. Once done, submit your answers by filling out this form, where you will also need to submit your R code.

  1. Download the file annual.csv and read it into R as a data frame called climate.

  2. Using the R function cut(), create a new column in climate that converts the variable Volcano into a categorical variable called VolcanoF with three levels called “low”, “medium”, and “high”. The first level should contain the lowest third of the data, the second should contain the middle third, and the third should contain the highest third of the data.

  3. Fit the model Temp ~ CO2. Report the p-value for CO2 and the value of R2 for the model.

  4. Fit the model Temp ~ CH4. Report the p-value for CH4 and the value of R2 for the model.

  5. Fit the model Temp ~ VolcanoF. Is VolcanoF significant at level 0.05? Report the relevant p-value.

  6. Fit a model with Temp as response and main effects for CO2 and VolcanoF as predictors.

    1. Is VolcanoF significant in the presence of CO2 at level 0.05? Report the relevant p-value.

    2. Is CO2 significant in the presence of VolcanoF at level 0.05? Report the relevant p-value.

  7. Fit a model with Temp as response and CO2, NH4, and NO2 as predictors.
    1. Is CH4 significant at level 0.05 in the presence of the other predictors?
    2. Is NO2 significant at level 0.05 in the presence of the other predictors?
    3. Is CO2 significant at level 0.05 in the presence of the other predictors?
    4. What is the estimated correlation between the estimated coefficients of NO2 and CO2?
    5. Report the coefficient of determination R2 for this model.
    6. Compute and report the predictive R2 for this model.