--- title: "STAT111 HW#1" author: "YOUR NAME GOES HERE" date: "February 3, 2016" output: pdf_document: fig_height: 3 fig_width: 5 html_document: fig_height: 3 fig_width: 5 word_document: fig_height: 3 fig_width: 5 --- ```{r include=FALSE} # Don't delete this chunk if you are using the mosaic package # This loads the mosaic and dplyr packages require(mosaic) ``` ```{r include=FALSE} # Some customization. You can alter or delete as desired (if you know what you are doing). # This changes the default colors in lattice plots. trellis.par.set(theme=theme.mosaic()) # knitr settings to control how R chunks work. require(knitr) opts_chunk$set( tidy=FALSE, # display code as typed size="small" # slightly smaller font for code ) ``` This homework is due at the start of class on Wednesday, February 3rd. (Note that the Festival of R Markdown is taking place on Monday and Tuesday if you have any questions about completing this assignment.) Recall that datasets for most of the tables, examples and exercises are available online. See examples and hints below. Steps to proceed: 1) download the file `hw02.Rmd` from Moodle 2) upload the file to the RStudio server 3) PLEASE DELETE THE INTRO MATERIAL BEFORE THIS (beginning with "This homework": please keep "PROBLEMS TO TURN IN") 4) run "Knit PDF" and add in your interpretation where it is marked as SOLUTION: 5) print the pdf and bring to class ### PROBLEMS TO TURN IN: #### Problem 1 The **HELPrct** dataset in the mosaicData package includes data from the Health Evaluation and Linkage to Primary Care study, which was conducted in Boston 10 years ago. One of the study variables is a measure of physical function, with higher scores being better (possible scores can range from 0 to 100 points). Describe the sample size plus CENTER, SPREAD and SHAPE of this distribution, providing only a single measure of center and a single measure of spread. Be sure to provide an interpretation in the context of the problem. ```{r, fig.height=3.2} favstats(~ pcs, data=HELPrct) gf_dens(~ pcs, main="Figure 1: Density plot\nof Physical Component Scores from HELP study", data=HELPrct) ``` SOLUTION: XX ADD YOUR SOLUTION HERE XX #### Problem 2 (Old Faithful) The **faithful** dataset contains the waiting time (in minutes) to the next eruption of the Old Faithful geyser in Yellowstone National Park in Wyoming. Describe the sample size plus CENTER, SPREAD and SHAPE of this distribution, providing only a single measure of center and a single measure of spread. Be sure to provide an interpretation in the context of the problem (and don't forget to specify units). ```{r, fig.height=3.2} favstats(~ waiting, data=faithful) gf_dens(~ waiting, xlab="Waiting time to next eruption (in mins)", main="Figure 2: Density plot of Old Faithful geyser dataset", data=faithful) ``` SOLUTION: XX ADD YOUR SOLUTION HERE