---
title: "A03 (145 points)"
author: "TYPE YOUR NAME HERE"
date: "TYPE DATE HERE"
format: docx
editor: visual
---

```{r}
#| message: false
#| warning: false
#| echo: false
library(tidyverse)
```

## Instructions

Complete each exercise either in this qmd file or on paper. Include your name as the author and the date completed in the YAML code at the top of this file, and replace the first sentence in the Acknowledgements section as directed. Any parts completed on paper should either (a) be handed to David Housman, (b) placed in SC 117, or (c) scanned into a pdf file. This qmd file should be rendered to an html, docx, or pdf file. Zip together all relevant files: Rproj, qmd, rendered file, any data or image files, and (optionally) the pdf file containing your answers completed on paper. Upload the zip file in Moodle. Points will be taken off if these instructions are not followed.

## Acknowledgements

Replace this sentence with either (1) an acknowledgment of any person who gave you assistance and/or any resource that was used, or (2) a statement that you did not use any outside assistance.

By submitting this assignment, the author attests to abiding by the *Collaboration and Academic Integrity* policy stated in the course syllabus.

## Exercise 1 (9 points)

(Exercise 1.3-15 modified from Ledolter text.) A set of 10 data values has a mean and a median of \$1,425, and interquartile range of \$820, and ranges from a minimum value of \$987 to a maximum value of \$1,945. Later, we discover that the \$1,945 value was mis-recorded and should have been \$2,945. Find the corrected values for the mean, median, and interquartile range.

## Exercise 2 (6 points)

(Exercise 1.3-16 from Ledolter text.) The summary statistics of 54 measurements on height (in inches) are mean 69 inches and standard deviation 3.75 inches. We decide to express height in centimeters; that is, $y = 2.54x$, where $y$ is height in cm and $x$ is height in inches. What are the mean and the standard deviation of height expressed in cm?

## Exercise 3 (9 points)

(Exercise 1.3-17 modified from Ledolter text.) The purchasing department of a major company has 100 employees, 22 of whom have no children, 50 of whom have exactly one child, and 28 of whom have exactly two children. Calculate the mean, median, and standard deviation number of children.

## Exercise 4 (20 points)

(Exercise 1.3-8 modified from Ledolter.) Snee has measured the thickness of the “ears” of paint cans. The “ear” of a paint can is the tab that secures the lid of the can. At periodic intervals, samples of five paint cans are taken from a hopper that collects the production from two machines, and the thickness of each ear is measured. The results (in thousands of an inch) of 30 such samples are available in the file *A03Paint.csv*.

a.  (10 points) Read the data. Obtain a density plot with appropriate labels on axes. State a possible reason for the observed bimodality,

b.  (10 points) obtain the mean thicknesses for each sample (hint: the `summarise` function is helpful). Obtain a time series graph of the 30 sample averages (a `geom_point` with a `geom_line` instead of a `geom_smooth`). Describe any trends revealed by the time series graph.

## Exercise 5 (9 points)

Complete the following exercise taken from Workshop Statistics by Allan J. Rossman.

![](A03%20Jurassic%20Park.png)

## Exercise 6 (72 points)

Consider the Math 323 Introduction Questionnaire data provided in a table in Assignment A02. In particular, consider weight as a function of height. Exclude the case with the obviously incorrect height datum. Parts (a)-(f) should be done by hand-

a.  (8 points) Draw a scatter plot of the data on a piece of graph paper.  Be sure to include appropriate labels with units on each axis.

b.  (4 points) Draw a line that you think best captures the trend of the data.

c.  (4 points) From the graph, estimate the average and maximum deviations of the model from the data.

d.  (6 points) Based on your work above, predict the weight of a college student whose height is 75 inches. Include units and a precision in your answer.

e.  (10 points) Find an equation for your line. Explicitly state the coordinates of the points used. Be sure to define your variables.

f.  (6 points) Interpret your equation in words.

g.  (4 points) Create a tibble with the height and weight data,

h.  (6 points) Obtain a scatter plot with the best fit linear model and appropriate labels on the axes.

i.  (6 points) Obtain the best fit linear model. Compare with the equation you obtained in part (e).

j.  (6 points) Obtain the coefficient of determination or R^2^. Interpret.

k.  (3 points) Obtain the sum of squared errors.

l.  (6 points) Obtain the standard error. Interpret.

m.  (3 points) Use the model to predict the weight of a Math 323 student who is 75 inches tall..

## Exercise 7 (20 points)

Consider the `ChickWeight` data available in R.

a.  (6 points) Obtain a scatter plot of `weight` as a function of `Time` with a best fit linear model and appropriate labels on the axes.

b.  (2 points) Filter the data to only include the oldest chicks.

c.  (6 points) Obtain box plots of `weight` as a function of `Diet` for the oldest chicks with appropriate labels on axes.

d.  (6 points) Based upon the previous two graphs, what conclusions can you make about the weight of chicks?
