Problem 1

A study examines the ACTN3 genetic alleles R and X, also associated with fast-twitch muscles. Of the 436 people in this sample, 244 were classified as R, and 192 were classified as X. Does the sample provide evidence that the two options are not equally likely? Conduct the test using a chi-square goodness-of-fit test.

Hypotheses+Variables:
\(p_r\): Likelihood of the R allele being present
\(p_x\): Likelihood of the X allele being present

\(H_0\): \(p_r\) = \(p_x\)
\(H_a\): \(p_r\) \(\neq\) \(p_x\)

\(a\): 0.05

observed <- c(192, 244)
chisq.test(observed)
## 
##  Chi-squared test for given probabilities
## 
## data:  observed
## X-squared = 6.2018, df = 1, p-value = 0.01276

\(p\) = 0.01276
\(p\) < \(a\) therefore we can reject the Null hypothesis and say that there is inequality between the likelihood of the R and X allele’s presence.

Problem 2

Who Is More Likely to Take Vitamins: Males or Females? The dataset NutritionStudy contains, among other things, information about vitamin use and the gender of the participants. Is there a significant association between these two variables? Use the variables VitaminUse and Gender to conduct a chi-square analysis and give the results. (Test for Association)

Hypotheses+Variables:
\(H_0\): Sex is not associated with vitamin usage
\(H_a\): Sex is associated with vitamin usage

\(a\): 0.05

nutrition_data <- read_csv("NutritionStudy.csv", show_col_types = FALSE)
observed <- nutrition_data |> 
  select(c("Sex", "Vitamin"))

observed <- table(observed$Sex, observed$Vitamin)

chisq.test(observed)
## 
##  Pearson's Chi-squared test
## 
## data:  observed
## X-squared = 11.071, df = 2, p-value = 0.003944

\(p\) = 0.003944 \(p\) < \(a\) therefore we can reject the null and say that there is association between vitamin usage and sex.

Problem 3

Most fish use gills for respiration in water, and researchers can observe how fast a fish’s gill cover beats to study ventilation, much like we might observe a person’s breathing rate. Professor Brad Baldwin is interested in how water chemistry might affect gill beat rates. In one experiment, he randomly assigned fish to tanks with different calcium levels. One tank was low in calcium (0.71 mg/L), the second tank had a medium amount (5.24 mg/L), and the third tank had water with a high calcium level (18.24 mg/L). His research team counted gill rates (beats per minute) for samples of 30 fish in each tank. The results are stored in FishGills3. Perform ANOVA test to see if the mean gill rate differs depending on the calcium level of the water.

Hypotheses+Variables:
\(\mu_l\): Gill rate in low calcium water
\(\mu_m\): Gill rate in medium calcium water
\(\mu_h\): Gill rate in high calcium water

\(H_0\): \(\mu_l\) = \(\mu_m\) = \(\mu_h\)
\(H_a\): Not all \(\mu_i\) are equal

\(a\): 0.05

fish_data <- read_csv("FishGills3.csv", show_col_types = FALSE)
observed <- table(fish_data$Calcium, fish_data$GillRate)

test <- aov(fish_data$GillRate ~ fish_data$Calcium, data=fish_data)
summary(test)
##                   Df Sum Sq Mean Sq F value Pr(>F)  
## fish_data$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\) = 0.0121
\(p\) < \(a\) therefore we reject the null hypothesis and say that not all gill rates are equal and calcium has some effect on gill rate.