HW_RMarkdownTemplate--1-

.pdf

School

University Of Chicago *

*We aren’t endorsed by this school

Course

220

Subject

Statistics

Date

Apr 25, 2024

Type

pdf

Pages

3

Uploaded by ChancellorElectronBee46 on coursehero.com

STAT 220: Practice Midterm Emma Allen # Every HW R Markdown document should begin with all the lines of code above. # Note: This green text is not displayed in the final document # because the default for displaying R code and R comments is echo=FALSE. library (tidyverse) library (lattice) A – 2 points setwd ( "/Users/emmaallen/Downloads/STAT220" ) ChickWeight2 = read.table ( "ChickWeight2.txt" , header= T) ChickWeight2 = subset (ChickWeight2, Diet == "Diet 1" | Diet == "Diet 3" ) histogram ( ~ weight | Diet, data= ChickWeight2, layout = c ( 1 , 2 )) weight Percent of Total 0 5 10 15 20 25 30 100 200 300 400 Diet 1 0 5 10 15 20 25 30 Diet 3 Diet 1 and Diet 2 are graphs with a right skew. The mode for Diet 1 is 30% of the total whereas the mode for Diet 3 is 20% of the total. The range of Diet 1’s weight is from 0 to just over 300, whereas the range of Diet 3’s weight is from 0 to 400. Diet 3 should be associated with chicks that have larger weight. 1
B – 3 points ChickWeight2 $ age.grp = cut (ChickWeight2 $ Time, breaks = c ( - 1 , 0 , 5 , 10 , 15 , 21 )) bwplot (weight ~ Diet | age.grp, data= ChickWeight2, layout = c ( 5 , 1 )) weight 100 200 300 Diet 1 Diet 3 (-1,0] Diet 1 Diet 3 (0,5] Diet 1 Diet 3 (5,10] Diet 1 Diet 3 (10,15] Diet 1 Diet 3 (15,21] At day 0, the chickweight on Diet 1 and Diet 3 are equal. For the next age group, less than or equal to day 5, the means are pretty much the same, but Diet 3 already has a slightly larger mean; also, the range for both diets has expanded and Diet 1 already has an outlier on the left tail. From here on out, the mean, median, and IQR is noticeably larger in Diet 3 than in Diet 1. This finding supports our statement in part A. C – 3 points qplot (Time, log (weight), color= Diet, data= ChickWeight2) 3.5 4.0 4.5 5.0 5.5 6.0 0 5 10 15 20 Time log(weight) Diet Diet 1 Diet 3 2
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help