In: Statistics and Probability
SOLVE USING R: Eighteen freshwater mussels (Elliptio dilatata) were randomly assigned to three groups of six each. One group was placed in water from the river where the mussels were collected, one group was placed in deionized water, and one group was placed in a solution of 0.5 millimoles per liter (mM) of sodium sulfate. At the end of a specified time period, blood (hemolymph) was collected from each mussel and potassium levels were determined. Do the treatments affect blood potassium levels (mM K+)? (Suppose the assumptions of ANOVA hold.)
River Water 0.518 0.523 0.495 0.502 0.525 0.490
Deionized Water 0.318 0.342 0.301 0.390 0.327 0.320
PLEASE COPY AND PASTE R INPUT AND OUTPUT.
Sodium Sulfate 0.393 0.415 0.351 0.390 0.385 0.397
Following is the R input and output:
Input:
Group1 <- c(0.51, 0.523, 0.495, 0.502, 0.525, 0.490)#River
water
Group2 <- c(0.318, 0.342, 0.301, 0.390, 0.327, 0.320)#Deionized
Water
Group3 <- c(0.393, 0.415, 0.351, 0.390, 0.385, 0.397)#Sodium
Sulphate
Group1
Group2
Group3
Output:
Group1 [1] 0.510 0.523 0.495 0.502 0.525 0.490 > Group2 [1] 0.318 0.342 0.301 0.390 0.327 0.320 > Group3 [1] 0.393 0.415 0.351 0.390 0.385 0.397
Input:
Combined_Groups <- data.frame(cbind(Group1, Group2, Group3))
#combines the data into a single data set
Combined_Groups #shows spreadsheet like results
summary(Combined_Groups) #min, median, mean, max
Output:
Combined_Groups <- data.frame(cbind(Group1, Group2, Group3)) > Combined_Groups Group1 Group2 Group3 1 0.510 0.318 0.393 2 0.523 0.342 0.415 3 0.495 0.301 0.351 4 0.502 0.390 0.390 5 0.525 0.327 0.385 6 0.490 0.320 0.397 > summary(Combined_Groups) Group1 Group2 Group3 Min. :0.4900 Min. :0.3010 Min. :0.3510 1st Qu.:0.4968 1st Qu.:0.3185 1st Qu.:0.3862 Median :0.5060 Median :0.3235 Median :0.3915 Mean :0.5075 Mean :0.3330 Mean :0.3885 3rd Qu.:0.5198 3rd Qu.:0.3382 3rd Qu.:0.3960 Max. :0.5250 Max. :0.3900 Max. :0.4150
Input:
Stacked_Groups <- stack(Combined_Groups)
Stacked_Groups #shows the table Stacked_Groups
Output:
Stacked_Groups values ind 1 0.510 Group1 2 0.523 Group1 3 0.495 Group1 4 0.502 Group1 5 0.525 Group1 6 0.490 Group1 7 0.318 Group2 8 0.342 Group2 9 0.301 Group2 10 0.390 Group2 11 0.327 Group2 12 0.320 Group2 13 0.393 Group3 14 0.415 Group3 15 0.351 Group3 16 0.390 Group3 17 0.385 Group3 18 0.397 Group3
Input:
Anova_Results <- aov(values ~ ind, data =
Stacked_Groups)
summary(Anova_Results) #shows Anova_Results
Output:
summary(Anova_Results) Df Sum Sq Mean Sq F value Pr(>F) ind 2 0.09538 0.04769 88.92 4.8e-09 *** Residuals 15 0.00805 0.00054 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
We have F(2,15) = 88.92 and p-value is 0.0000000048. Since p value is very small therefore null hypothesis is statistically significant. This implies that the treatments affect blood potassium levels.