Three problems — one chi-square goodness-of-fit, one chi-square test of independence, and one one-way ANOVA. Each one follows the same pattern: state hypotheses, run the test, interpret the result.
ACTN3 is a gene that encodes alpha-actinin-3, a protein in fast-twitch muscle fibers. The gene has two main alleles: R (functional) and X (non-functional). The R allele is linked to better performance in strength/speed/power sports; the X allele is associated with endurance.
A study of 436 people classified 244 as R and 192 as X. Does this provide evidence that the two options are NOT equally likely?
State your hypotheses:
# Q1. Run a chi-square goodness-of-fit test.
# (Hint: observed <- c(244, 192); chisq.test(observed))
observed <- c(244, 192); chisq.test(observed)
##
## Chi-squared test for given probabilities
##
## data: observed
## X-squared = 6.2018, df = 1, p-value = 0.01276
# Q2. What is the p-value? At α = 0.05, do you reject H₀?
0.01276
## [1] 0.01276
# You fail to reject the H0
Q3. Write your conclusion in plain English: Since we fail to reject the H0, we learn that either p1 or p2 is not = 0.5. In other words, either the R allele or the X allele is not = 0.5. —
The NutritionStudy.csv dataset contains data on vitamin
use (VitaminUse) and gender (Sex) for many
participants. Is there a significant association between these two
variables?
Download NutritionStudy.csv from the Datasets folder on
Blackboard.
nutrition <- read.csv("NutritionStudy.csv")
State your hypotheses:
# Q4. Build a contingency table of VitaminUse and Sex using table().
table(nutrition$VitaminUse, nutrition$Sex)
##
## Female Male
## No 87 24
## Occasional 77 5
## Regular 109 13
# Q5. Run a chi-square test of independence on that table.
vitamin_table <- table(nutrition$VitaminUse, nutrition$Sex)
# Q6. What is the p-value? Do you reject H₀ at α = 0.05?
0.003944
## [1] 0.003944
# We reject the H0.
Q7. Write your conclusion in plain English: We reject the H0. Conclusively, this explains that the relationship between the two independents are therefore unrelated; more specifically, they are not statistically significant. —
Researchers wanted to know how water chemistry affects fish ventilation. Fish were randomly assigned to one of three tanks with different calcium levels:
The team counted gill rates (beats per minute) for 30 fish in each
tank. The data is in FishGills3.csv.
Download FishGills3.csv from the Datasets folder on
Blackboard.
fish <- read.csv("FishGills3.csv")
State your hypotheses:
# Q8. Run a one-way ANOVA testing GillRate by Calcium.
# (Hint: aov(GillRate ~ Calcium, data = fish))
aov(GillRate ~ Calcium, data = fish)
## Call:
## aov(formula = GillRate ~ Calcium, data = fish)
##
## Terms:
## Calcium Residuals
## Sum of Squares 2037.222 19064.333
## Deg. of Freedom 2 87
##
## Residual standard error: 14.80305
## Estimated effects may be unbalanced
# Q9. Use summary() on the result. What is the F statistic and p-value?
4.65
## [1] 4.65
# f statistic
0.012
## [1] 0.012
# p value
# Q10. At α = 0.05, do you reject H₀?
# Fail to reject the H0
Q11. Write your conclusion in plain English: The ANOVA test proved that we fail to reject the H0. The mean gill rates are the same across calcium levels in all three tanks.