Problem 1: Hypotheses:
\(H_0\): The two alleles are equally likely (\(p=0.5\) for each).
\(H_a\): The two alleles are not equally likely (\(p \neq 0.5\)).
# Observed: 244 R, 192 X
obs <- c(244, 192)
# Test
res <- chisq.test(obs, p = c(0.5, 0.5))
res$p.value
## [1] 0.01276179
P-value: \(0.0128\)
Conclusion: Reject \(H_{0}\). There is significant evidence that the two alleles are not equally likely.
Problem 2:
Hypotheses:
\(H_{0}\): There is no association between Gender and Vitamin Use.
\(H_{a}\): There is a significant association between Gender and Vitamin Use.
df <- read.csv("NutritionStudy.csv")
#table for Sex and VitaminUse
table_data <- table(df$Sex, df$VitaminUse)
res <- chisq.test(table_data)
res$p.value
## [1] 0.003944277
P-value: \(0.0039\)
Conclusion: Reject \(H_{0}\). A statistically significant association exists between gender and vitamin use.
Hypotheses:
\(H_{0}\): Mean gill rates are equal for all calcium levels (\(\mu_{Low} = \mu_{Medium} = \mu_{High}\)).
\(H_{a}\): At least one mean gill rate is different.
Problem 3:
df_fish <- read.csv("FishGills3.csv")
# One-way ANOVA
fit <- aov(GillRate ~ Calcium, data = df_fish)
summary(fit)
## Df Sum Sq Mean Sq F value Pr(>F)
## Calcium 2 2037 1018.6 4.648 0.0121 *
## Residuals 87 19064 219.1
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
P-value: \(0.0121\)
Conclusion: Reject \(H_{0}\). Mean gill rates differ significantly depending on the water’s calcium level.