# 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, class.data: > attach(class.data) > reg < - lm(wt ~ ht) >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.68662 ## forms semi-studentized residuals - value of residual stand error (19.68662) is from ## summary(reg) > plot(ht,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 ## > median(ht) ## Finds the median of the values stored in ht > iht <- rep("B",20) ## constructs a vector with 20 entries and a “B” in each one (ie it repeats “B” 20 times) > for (i in 1:20 ) {if (ht[i] > 67.5) iht[i] < - "A"}

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 07/08/2011 for the course STA 4211 taught by Professor Randles during the Spring '08 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