420Hw03ans - STAT 420(10 points(due Friday September 19 by...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
STAT 420 Fall 2008 Homework #3 (10 points) (due Friday, September 19, by 3:00 p.m.) 1. Use Packages > Install Package(s)… to download and install package (library) faraway . Use the infmort data set where Y is income and the grouping variable is region (Asia, Europe, Americas and Africa). > library(faraway) > data(infmort) > infmort[1:5,] # to see what the data set looks like region income mortality oil Australia Asia 3426 26.7 no oil exports Austria Europe 3350 23.7 no oil exports Belgium Europe 3346 17.0 no oil exports Canada Americas 4751 16.8 no oil exports Denmark Europe 5029 13.5 no oil exports > attach(infmort) After attach(infmort) , you may refer to the variables in the data set directly, i.e., income instead of infmort$income . a) Draw a boxplot of income for each of the four regions on the same set of axes. > boxplot(income ~ region)
Background image of page 1

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

View Full DocumentRight Arrow Icon
b) Compute the sample mean and sample variance for each of the regions. > mean(income[region=="Africa"]) [1] 273.2353 > var(income[region=="Africa"]) [1] 264522.3 > > mean(income[region=="Americas"]) [1] 939.8696 > var(income[region=="Americas"]) [1] 1851366 > > mean(income[region=="Asia"]) [1] 638.8667 > var(income[region=="Asia"]) [1] 937319.4 > > mean(income[region=="Europe"]) [1] 3040.222 > var(income[region=="Europe"]) [1] 2071527 OR > ## Group 1 == Africa > Yaf = income[region=="Africa"] > Naf = length(Yaf) > Naf ; mean(Yaf) ; var(Yaf) [1] 34 [1] 273.2353 [1] 264522.3 > > ## Group 2 == Americas > Yam = income[region=="Americas"] > Nam = length(Yam) > Nam ; mean(Yam) ; var(Yam) [1] 23 [1] 939.8696 [1] 1851366 > > ## Group 3 == Asia > Yas = income[region=="Asia"] > Nas = length(Yas) > Nas ; mean(Yas) ; var(Yas) [1] 30 [1] 638.8667 [1] 937319.4 > > ## Group 4 == Europe > Yeu = income[region=="Europe"] > Neu = length(Yeu) > Neu ; mean(Yeu) ; var(Yeu) [1] 18 [1] 3040.222 [1] 2071527
Background image of page 2
c) A visual inspection of the boxplots may lead us to conclude that the equal variance assumption may not be satisfied and that some transformation may be needed. Transformation: Consider the new response variable W = ln Y. i.
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/09/2010 for the course MATH 420 taught by Professor Stepanov during the Spring '10 term at University of Illinois, Urbana Champaign.

Page1 / 11

420Hw03ans - STAT 420(10 points(due Friday September 19 by...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online