# Rforch3 - R for Chapter 3 Running List of Functions Applied...

This preview shows pages 1–2. Sign up to view the full content.

R for Chapter 3 Running List of Functions Applied to the Data Set, data.class: > attach(data.class) > reg < - lm(weight ~ height) >summary(reg) > res < - residuals(reg) ## stores the residuals in the variable “res”, ie the e (sub i)'s > fit < - fitted(reg) ## stores the fitted values in the variable “fit”, ie the Y hat (sub i)'s, the results of plugging the ## original data X-values into the fitted line > semi.st.res < - res/19.65 ## forms semi-studentized residuals - value of residual stand error (19.65) is from ## summary(reg) > plot(height,semi.st.res) ## scatter plot of ht (horizontal) by semi-studentized residuals (vertical) for each data point ## What follows is a description of what is needed for the Modified Levene Test ## > mh <- median(height) ## Finds the median of the values stored in height > iht <- rep("B",25) ## constructs a vector with 25 entries and a “B” in each one (ie it repeats “B” 25 times) > for (i in 1:25 ) {if (height[i] > mh) iht[i] < - "A"} ## replaces the ith iht value with an “A” if the ith hteight value is

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
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.

### Page1 / 2

Rforch3 - R for Chapter 3 Running List of Functions Applied...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online