Question: bikes

bikes <- read.csv("http://www.andrew.cmu.edu/user/achoulde/94842/data/bikes.csv", header = TRUE) # Transform temp and atemp to degrees C instead of [0,1] scale # Transform humidity to % # Transform wind speed (multiply by 67, the normalizing value) bikes <- transform(bikes, temp = 47 * temp - 8, atemp = 66 * atemp - 16, hum = 100 * hum, windspeed = 67 * windspeed) 

Problem 2: Interpreting and testing linear models

This problem once again uses thebikesdata.

(a)Use thetransformandmapvaluesfunctions to map the values of theseasonandweathersitvariables to something more interpretable. Your newweathersitvariable should have levels: Clear, Cloud, Light.precip, Heavy.precip

# Edit me 

(b)Fit a linear regression model withcntas the outcome, and season, workingday, weathersit, temp, atemp and hum as covariates. Use thesummaryfunction to print a summary of the model showing the model coefficients.

Note that you may wish to code the workingday variable as a factor, though this will not change the estimated coefficient or its interpretation (workingday is already a 0-1 indicator).

# Edit me 

(c)How do you interpret the coefficient ofworkingdayin the model? What is its p-value? Is it statistically significant?

# Edit me 

(d)How do you interpret the coefficient corresponding to Light.precip weather situation? What is its p-value? Is it statistically significant?

# Edit me 

(e)Use thepairsfunction to construct a pairs plot of temp, atemp and hum. The bottom panel of your plot should show correlations (see example in Lecture 9).

# Edit me 

Do you observe any strong colinearities between the variables?

# Edit me 

(f)Use theupdatefunction to update your linear model by removing thetempvariable. Has the coefficient ofatempchanged? Has it changed a lot? Explain.

# Edit me 

(g)How do you interpret the coefficient ofatempin the model from part (f)?

(h)Use theanova()function on your model from part (f) to assess whetherweathersitis a statistically significant factor in the model. Interpret your findings.

# Edit me 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!