Rforch1-2 - R for Chapters 1-2 Running List of Functions...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
R for Chapters 1-2 Running List of Functions Applied to the Data Set, data.class: > attach(data.class) > plot(height,weight) ## scatter plot of these two variables using our data > reg < - lm(weight ~ height) ## fits the linear regression model with “weight” explained as a linear function of “height” > reg ## displays the coefficients of the Least Squares Fit > summary(reg) ## displays summary information about the fit > plot(height,weight) > abline(lm( weight ~ height)) ## includes the fitted line on the scatterplot (Leave the previous plot on the screen when ## doing this.) > weight ## the observed response value for each predictor value in the data > fitted.values(reg) ## the fitted values (vertical distance to the line) at each predictor value in the data > residuals(reg) ## the residual value (observed minus fitted) at each predictor value in the data > confint(reg) ## gives 95% C.I. For each of the intercept and the slope in our model > confint(reg, level=.98) ## gives a 98% confidence interval for each of the intercept and the slope
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/10/2011 for the course STAT 4210 taught by Professor Randles during the Fall '11 term at University of Florida.

Ask a homework question - tutors are online