Austin Wen Assignment6

Austin Wen Assignment6 - A ustin Wen STAT 4360 HW 6...

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

View Full Document Right Arrow Icon
Austin Wen STAT 4360 HW 6 ### Question1 ### x = c(0,1,0,NA,0,0,0,0,0,1,1,1,0,0,3,0,0,0,0,0,2,0,1) factor(x, levels = c("0","1","2","3","NA")) [1] 0 1 0 <NA> 0 0 0 0 0 1 1 1 0 0 3 [16] 0 0 0 0 0 2 0 1 Levels: 0 1 2 3 NA table(factor(x, levels = c("0","1","2","3","NA"))) 0 1 2 3 NA 15 5 1 1 0 mean(x,na.rm=TRUE) [1] 0.4545455 ###Question2### ##a.## data(mtcars) ##b.## names(mtcars) [1] "mpg" "cyl" "disp" "hp" "drat" "wt" "qsec" "vs" "am" "gear" "carb" ##c.## max(mtcars$mpg) [1] 33.9 ##d.## mtcars[mtcars$mpg==33.9,] mpg cyl disp hp drat wt qsec vs am gear carb Toyota Corolla 33.9 4 71.1 65 4.22 1.835 19.9 1 1 4 1 ##e.##
Background image of page 1

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

View Full DocumentRight Arrow Icon
mtcars[rownames(mtcars)=="Valiant",4] [1] 105 ##f.## mtcars[1:5,] mpg cyl d isp hp drat wt qsec vs am gear carb Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4 Mazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4 Datsun 710 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1 Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1 Hornet Sportabout 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2 ##g.## mtcars[rownames(mtcars)=="Merc 450SLC",]
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/06/2011 for the course STAT 4360 taught by Professor Park during the Spring '11 term at UGA.

Page1 / 4

Austin Wen Assignment6 - A ustin Wen STAT 4360 HW 6...

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

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