1. A [1999 study](http://www.ncbi.nlm.nih.gov/pubmed/10224215) investigated the relationship between breastfeeding and intelligence. The researchers assessed 322 4-year old children on the [McCarthy Scales of Childrenâ€™s Abilities](https://en.wikipedia.org/wiki/McCarthy_Scales_of_Children%27s_Abilities) and calculated an overall measure of intelligence (the General Cognitive Index, GCI) for each child. Of the 322 children, 237 were breastfed.

The data have been loaded as `bfeed` with the variables:

`Feeding`: whether each child was "Breastfed" or "NotBreastfed"

`GCI`: a score of intelligence.

a) Create a couple visualizations of the data comparing GCI scores for the two groups of children.

b) Calculate the mean and standard deviation of the `GCI` scores for each group.

c) Investigate the normality and equal variance assumptions (using plots or tests).

d) Conduct an independent samples t-test to compare mean GCI scores for children who were and were not breastfed.

e) Construct a 90% confidence interval for the mean difference in GCI scores

f) Calculate an effect size. ```{r} # The data is loaded as bfeed bfeed <- read.csv("http://www.bradthiessen.com/html5/stats/m300/bfeed.csv") #### Below this line, type all your code ```

2. Using the same `bfeed` data, run an independent-samples t-test without the equal variance assumption. ```{r} #### Exercise 2 # Type code below this line ```

3. Use randomization-based methods to compare the means of the Breastfed and NonBreastfed groups in the `bfeed` dataset.

a) Calculate the test statistic of interest and store it as `test.stat`

b) Generate at least 10,000 randomizations of the data.

c) Plot the distribution of test statistics generated from the randomizations.

d) Estimate the p-value. ```{r} #### Exercise 3 # Type your code below this line ```

4. Use randomization-based methods to test the difference in medians in the `bfeed` dataset. ```{r} #### Exercise 4 # Type your code below this line ```

5. Do college graduates earn more money than non-graduates? How do the earnings compare among individuals with no college degree, Bachelor's degrees, and graduate degrees? To investigate, you'll take a look at the `earn` dataframe. It contains the following variables for 250 individuals:

`Degree`: The highest level of education achieved by each individual (`Some` college, `Associate` degree, `Bachelor` degree, `Master` degree, or `Doctorate`.

`Earnings`: income of each individual (in tens of thousands of dollars)

a) Calculate the SAD to compare mean earnings for the 5 groups in the dataset

b) Generate at least 10,000 randomizations and calculate the SAD for each

c) Plot the distribution of those SAD values.

d) Estimate the p-value ```{r} # The data is loaded as earn earn <- read.csv("http://www.bradthiessen.com/html5/stats/m300/earn.csv") #### Below this line, type all your code ```

End of Lab Report #7