DOC PREVIEW
UW-Madison STAT 371 - Statistics 371 Assignment 12

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Statistics 371 Assignment #12 Supplement Fall 2002This document describes how to use R to carry out parts of Exercises 11.31–35 on pages 497–498 in the textbook. Carryout all of the steps, but include in your homework write-up only answers to questions1. Download the data set in 11-31.txt to a textfile.2. Read this data into R. Attach the data set so that individual variables may be referred to by name. Under Windows,you may need to specify a complete path name for the data set, something like "C:/My Documents/11-31.txt" if youput the downloaded text file in that location.> beans <- read.table("11-31.txt", header = T)> attach(beans)3. Make side-by-side boxplots by group (which is the result of a two-way classification).> boxplot(split(yield, group))Question 1. Do the groups have similar centers? Do the groups have similar amounts of variability?4. Calculate sample sizes, sample means and standard deviations for each group. (The function split partitions the firstvariable by the categorical levels of the second variable and stores the results in a list. The function lapply applies afunction to each element of a list.)> lapply(split(yield, group), length)> lapply(split(yield, group), mean)> lapply(split(yield, group), sd)Question 2. Record these values in a table.5. Carry out a one-way ANOVA with yield as the response variable and group as the explanatory variable. Show theANOVA table. (The command lm fits a linear model of which ANOVA is an example.)> fit1 <- lm(yield ~ group, data = beans)> anova(fit1)Question 3. Summarize the results of this test in the context of the problem. Is the test significant at the α = 0.05level?6. Make a plot of the residuals versus the fitted values.> plot(fit1$fitted, fit1$resid, xlab = "Fitted Values", ylab = "Residuals")> abline(h = 0)Question 4. Refer to the boxplots made previously. Does this plot indicate that the assumption of normalitymight be suspect? Does this plot indicate that the assumption of equal variances might be suspect?Question 5. Refer to the residual plot. Does this plot indicate that variability is related to the mean value?7. Make a normal probability plot of the residuals.> qqnorm(fit1$resid)Question 6. Do the residuals look normally distributed?8. Transformations of the response variable often fit the assumption better than data in the original scale. Two commontransformations that help when the variance seems to be a function of the mean with larger spread in populations withlarger means are logarithms and square roots. (Exercise 11.35 refers to a reciprocal transformation which can makesense in some settings.) Carry out a one-way ANOVA with log yield as the response variable.> fit2 <- lm(log(yield) ~ group, data = beans)> anova(fit2)Bret Larget November 20, 2002Statistics 371 Assignment #12 Supplement Fall 20029. Make a plot of the residuals versus fitted values, side-by-side boxplots of log yield, and normal probability plots of theresiduals.> plot(fit2$fitted, fit2$resid, xlab = "Fitted Values", ylab = "Residuals")> abline(h = 0)> boxplot(split(log(yield), group))> qqnorm(fit2$resid)Question 7. Do these plots indicate that the variablity within each sample are more equal for the transformeddata?Bret Larget November 20,


View Full Document

UW-Madison STAT 371 - Statistics 371 Assignment 12

Documents in this Course
HW 4

HW 4

4 pages

NOTES 7

NOTES 7

19 pages

Ch. 6

Ch. 6

24 pages

Ch. 4

Ch. 4

10 pages

Ch. 3

Ch. 3

20 pages

Ch. 2

Ch. 2

28 pages

Ch. 1

Ch. 1

24 pages

Ch. 20

Ch. 20

26 pages

Ch. 19

Ch. 19

18 pages

Ch. 18

Ch. 18

26 pages

Ch. 17

Ch. 17

44 pages

Ch. 16

Ch. 16

38 pages

Ch. 15

Ch. 15

34 pages

Ch. 14

Ch. 14

16 pages

Ch. 13

Ch. 13

16 pages

Ch. 12

Ch. 12

38 pages

Ch. 11

Ch. 11

28 pages

Ch. 10

Ch. 10

40 pages

Ch. 9

Ch. 9

20 pages

Ch. 8

Ch. 8

26 pages

Ch. 7

Ch. 7

26 pages

Load more
Download Statistics 371 Assignment 12
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Statistics 371 Assignment 12 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Statistics 371 Assignment 12 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?