Hypothesis:
H0: p1 = p2 = 1/2
H1: one p ≠ 1/2
observed_genes <- c(244, 192)
Theoretical_gene_proportions <- c(1/2, 2)
expected_genes <- Theoretical_gene_proportions*sum(observed_genes)
expected_genes
## [1] 218 872
chisq.test(observed_genes)
##
## Chi-squared test for given probabilities
##
## data: observed_genes
## X-squared = 6.2018, df = 1, p-value = 0.01276
P-Value: 0.0127
Conclusion: We reject the null hypothesis, R and X allele are not equally likely to occur.
Hypothesis:
H0: Variables are independent.
H1: Variables are correlated.
NS <- read.csv("NutritionStudy.csv")
Observed_Nutrition <- table(NS$VitaminUse, NS$Sex)
Observed_Nutrition
##
## Female Male
## No 87 24
## Occasional 77 5
## Regular 109 13
chisq.test(Observed_Nutrition)
##
## Pearson's Chi-squared test
##
## data: Observed_Nutrition
## X-squared = 11.071, df = 2, p-value = 0.003944
P-Value: 0.0039
Conclusion: We reject the null hypothesis, There is a correlation between gender and taking vitamins. Women are more likely than men to take vitamins.
Hypothesis:
H0: µ Low = µ Medium = µ High
H1: µ is not equal in all three.
FG <- read.csv("FishGills3.csv")
rate <- aov(GillRate ~ Calcium, data = FG)
rate
## Call:
## aov(formula = GillRate ~ Calcium, data = FG)
##
## 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
summary(rate)
## 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
TukeyHSD(rate)
## Tukey multiple comparisons of means
## 95% family-wise confidence level
##
## Fit: aov(formula = GillRate ~ Calcium, data = FG)
##
## $Calcium
## diff lwr upr p adj
## Low-High 10.333333 1.219540 19.4471264 0.0222533
## Medium-High 0.500000 -8.613793 9.6137931 0.9906108
## Medium-Low -9.833333 -18.947126 -0.7195402 0.0313247
P-Value: 0.0121
Conclusion: We reject the null hypothesis, the mean gill rates were not the same and varied depending on calcium levels.