Homework-4
How to clone your repo
You clone your homework-4 repo exactly how we have been cloning AEs! Please see Moodle for more information.
How to turn your HW in
Homework is turned in via Gradescope. You can find the Gradescope HW-3 button on our Moodle page. Please remember to select your pages correctly when turning in your assignment. For more information, please see on Moodle: Submit Homework on the Gradescope Website.
How to format your Homework
For each question (ex. Question 1), put a level two (two pound signs) section header with the name of the question.
For questions with multiple parts (ex. a, b, c), please put these labels in bold as normal text.
For example…
Question 1
a
This homework is due Sunday, November 2nd at 11:59pm.
You will need to have at least 3 (meaningful) commits by the end of your homework assignment. Please practice proper version control techniques by committing and pushing after each answered question.
Packages
Start your document by making a Packages header, and copying this code and code chunk over into your .qmd file.
Use message: false and warning: false as code chunk arguments for this code chunk so you don’t get all of the extra unnecessary information when you render your document.
Exercise 1 (15 points)
- An experiment tested three different diets (k=3) on a total of N=15 subjects (5 per diet). The resulting one-way ANOVA table can be seen below. However, it’s missing a lot of information!
Using the context of the problem, fill in the ___ below by typing in the values.
I want you recreate this table with the appropriate values by interting a table into your Quarto document. You can do this by:
– Going to the Visual tab in the top left corner of the .qmd file
– Click the Table dropdown menu (same row as the Visual tab)
– Click Insert Table…
– Select your appropriate size
You can either fill in the values in the Visual tab, or go back to the Source tab.
Use the pf() function to estimate the p-value. Include this as a code chunk in your sasignment.
| Source of Variation | Degrees of Freedom (df) | Sum of Squares (SS) | Mean Square (MS) | F-Ratio | P-value |
|---|---|---|---|---|---|
| Between Groups (Diet) | ___ | ___ | 50.00 | ___ | ___ |
| Within Groups (Error) | ___ | 100 | ___ | ||
| Total | ___ | ___ |
Exercise 2 (20 points)
For the remaining exercises, we are going to use the ToothGrowth in R. The response is the length of odontoblasts (cells responsible for tooth growth) in 60 guinea pigs. Each animal received one of three dose levels of vitamin C (0.5, 1, and 2 mg/day). We want to investigate if the mean tooth length across guinea pigs are different across dose. Specifically, we want to find out which means are different. Run the following code below to ensure that dose is treated as a categorical variable. Use ToothGrowth_dose for the questions below. We are going to assume that one guinea pig does not influence the other.
- Using R, report a tibble that has the means and standard deviations of length for each
dosegroup below.
Use your information from part a to check the equal variance assumption. Show your calculation.
See the
anova-corAE. Manipulate the code used to re-create anormal-qqplot for each of the three levels ofdose. Next, assess the normality assumption.
- Now, use R-code to generate an Anova table. Report the table below. Use inline code to report the F value and p-value in a sentence separate from your Anova table.
In 1-2 sentences, justify if TukeysHSD is appropriate to continue answering our research question.
Regardless of your answer in part e, conduct TukeysHSD in R. Report the results below. Which pairwise combinations of means are reported to be statistically different?
Exercise 3 (15 points)
- We are going to calculate a 95% confidence interval for dose 1 - dose 0.5. We are simply going to do a single comparison, and not make confidence intervals for all pairwise combinations.
Using a t-distribution calculate a 95% confidence interval below. Show your work. That is, us qt() to find your multiplier, show how you calculate the standard error, etc.
Report your confidence interval calculated in part a with the confidence interval calculated using TukeysHSD in exercise 2 part f, below. Which interval is wider?
In 2-4 sentences, explain why one interval is wider than the other.
