0% found this document useful (0 votes)
22 views

Assignment 3

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Assignment 3

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment # 1

Hypothesis Testing using One-Tail and Two-Tail t-tests and One-Way


ANOVA
In this assignment, you will explore hypothesis testing using one-tail and two-tail t-tests, as
well as one-way ANOVA, using the built-in `ToothGrowth` dataset in R. You will also
visualize the data and perform the necessary statistical tests using various R functions and
packages.

**Dataset Description:**
The `ToothGrowth` dataset comprises the lengths of odontoblasts (tooth growth cells) in 60
guinea pigs. The dataset includes variables such as `len` (tooth length), `supp` (supplement
type), and `dose` (dose in milligrams/day).

**Tasks:**
1. **Load the required packages:**
```r
library(ggplot2)
library(tidyverse)
```
2. **Explore the dataset:**
- Display the first few rows of the `ToothGrowth` dataset using the `head()` function.
- Obtain a summary of the dataset using the `summary()` function.
3. **Visualize the data:**
- Create a boxplot for the `len` variable, grouped by `supp` and `dose`, using `ggplot2` to
visualize the distribution of tooth lengths.
4. **One-Tail t-test:**
- Conduct a one-tail t-test to determine if the mean tooth length for the supplement type
"OJ" (orange juice) is significantly greater than a specified value (e.g., 18).
- State the null and alternative hypotheses.
- Interpret the results of the one-tail t-test.
5. **Two-Tail t-test:**
- Conduct a two-tail t-test to compare the mean tooth lengths between the two supplement
types, "OJ" and "VC" (vitamin C).
- State the null and alternative hypotheses.
- Interpret the results of the two-tail t-test.
6. **One-Way ANOVA:**
- Perform a one-way ANOVA to determine if there is a significant difference in mean tooth
lengths among the different dose levels.
- State the null and alternative hypotheses.
- Interpret the results of the one-way ANOVA.
- If the ANOVA result is significant, conduct a post-hoc test (e.g., Tukey's HSD) to
identify which dose levels differ significantly.
7. **Bonus task (optional):**
- Use the `dplyr` package from the `tidyverse` to create a new dataset with only the
observations for the "VC" supplement type.
- Conduct a one-way ANOVA on the new dataset to determine if there is a significant
difference in mean tooth lengths among the different dose levels for the "VC" supplement
type.
- Visualize the results using appropriate plots from `ggplot2`.

Submission
Submit your R script file containing the code for all the tasks, along with any necessary
comments or explanations. Additionally, include a brief report discussing your findings and
interpretations before Eid.
**Evaluation Criteria:**
Your assignment will be evaluated based on the following criteria:
- Correct implementation of the required tasks
- Appropriate use of R functions and packages
- Clarity and readability of the code
- Accurate interpretation and discussion of the results
- (Optional) Completion of the bonus task

Note: If you encounter any issues or have questions during the assignment, feel free to reach
out to me for guidance.

You might also like