Problem 1: ACTN3 is a gene that encodes alpha-actinin-3, a protein in fast-twitch muscle fibers, important for activities like sprinting and weightlifting. The gene has two main alleles: R (functional) and X (non-functional). The R allele is linked to better performance in strength, speed, and power sports, while the X allele is associated with endurance due to a greater reliance on slow-twitch fibers. However, athletic performance is influenced by various factors, including training, environment, and other genes, making the ACTN3 genotype just one contributing factor. 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.
Hypothesis \(H_0\): The two alleles R and X are equally likely in the population. \(p_1 = p_2\)
\(H_a\): The two alleles R and X are not equally likely
Where: \(p_1\) = proportion of
people with the R allele
\(p_2\) = proportion of people with the
X allele
α = 0.05
P-Value = 0.01276
observed <- c(244, 192)
theoritical_prop <- rep(1/2, 2)
expected_values <- theoritical_prop*sum(observed)
expected_values
## [1] 218 218
chisq.test(observed)
##
## Chi-squared test for given probabilities
##
## data: observed
## X-squared = 6.2018, df = 1, p-value = 0.01276
Conclusion Since the test gave us a p-value of 0.01276, which is less than the significance level of 0.05, we reject the null hypothesis.
There is enough evidence at the 5% level that the two alleles (R and X) are not equally likely in this sample.
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)
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.5
## ✔ forcats 1.0.0 ✔ stringr 1.5.2
## ✔ ggplot2 4.0.0 ✔ tibble 3.3.0
## ✔ lubridate 1.9.4 ✔ tidyr 1.3.1
## ✔ purrr 1.1.0
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
nutrition <- read_csv("~/Desktop/FALL25/data science/NutritionStudy.csv")
## Rows: 315 Columns: 17
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (3): Smoke, Sex, VitaminUse
## dbl (14): ID, Age, Quetelet, Vitamin, Calories, Fat, Fiber, Alcohol, Cholest...
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Hypothesis \(H_0\): Vitamin use is not associated with gender
\(H_a\): Vitamin use is associated with gender
α = 0.05
P-value = 0.003944
observed_dataset<- table(nutrition$VitaminUse, nutrition$Sex)
observed_dataset
##
## Female Male
## No 87 24
## Occasional 77 5
## Regular 109 13
chisq.test(observed_dataset)
##
## Pearson's Chi-squared test
##
## data: observed_dataset
## X-squared = 11.071, df = 2, p-value = 0.003944
Conclusion Since the test gave us a p-value of 0.003944, which is less than the significance level of 0.05, we reject the null hypothesis.
There is enough evidence to say that there is a significant association between vitamin use and gender.
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.
Hypothesis \(H_0\): The mean gill rate is the same for all three calcium levels \(\mu_1 = \mu_2 = \mu_3...\)
\(H_a\): At least one mean gill rate differs
α = 0.05
P-Value = 0.0121
fish <- read_csv("~/Desktop/FALL25/data science/FishGills3.csv")
## Rows: 90 Columns: 2
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): Calcium
## dbl (1): GillRate
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
anova_result <- aov(GillRate ~ Calcium, data = fish)
summary(anova_result)
## 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
Conclusion Since the test gave us a p-value of 0.0121, which is less than the significance level of 0.05, we reject the null hypothesis.
There is enough evidence to say that the mean gill rate differs for at least one of the calcium levels, meaning the calcium concentration in the water does affect fish gill beat rate.