Rforch06 - R Material for Chapter 06 Multiple Predictor...

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

View Full Document Right Arrow Icon
R Material for Chapter 06 Multiple Predictor Regression: > attach(sales.data) > reg < - lm(sales~ young + income) ## fits the regression model for response (sales) as a ## linear function of the two variables (young) and ## (income) plus an intercept. > summary(reg) > anova(reg) > confint(reg) > res < - residuals(reg) > fit < - fitted(reg) ## the fitted values are stored, ie the Y hat (subi)'s > qqnorm(res) > predict(reg, newdata=data.frame(young=50,income=18), se.fit=TRUE, interval=”confidence”) ## This estimates the average sales at young=50 and ## income=18. It includes a 95% confidence interval ## for this average > predict(reg, newdata=data.frame(young=50,income=18), se.fit=TRUE, interval=”predict”)
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 07/08/2011 for the course STA 4211 taught by Professor Randles during the Spring '08 term at University of Florida.

Ask a homework question - tutors are online