In this video, I show how to use R to fit a linear regression model using the lm() command. I also introduce how to plot the regression line and the overall arithmetic mean of the response variable, and I briefly explain the use of diagnostic plots to inspect the residuals. Basic features of the R interface (script window, console window) are introduced.
The R code used in this video is:
# “Ozone” “Solar.R” “Wind” “Temp” “Month” “Day”
#calculate mean ozone concentration (na´s removed)
#use lm to fit a regression line through these data: