{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

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”)
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Ask a homework question - tutors are online