[1] 37
Week 9, Lecture 4 Lab 6
Let me introduce you the pipe operator ( |> )
Shortcut: Ctrl (Command) + Shift + M
Combine 35, 30, and 45 and then
Take the mean and then
Round the output
Like a composite function such as (\(f\circ g\circ h(x)\))
The Wolf River in Tennessee flows past an abandoned site once used by the pesticide industry for dumping wastes, including chlordane (pesticide), aldrin, and dieldrin (both insecticides). These highly toxic organic compounds can cause various cancers and birth defects. As these compounds are denser than water and their molecules tend to stick to particles of sediment, they are more likely to be found in higher concentrations near the bottom.
Now we are collecting a total of 30 random samples from this river to test if there is a difference between the mean aldrin concentrations among the three levels (surface, middepth, bottom)? (Set the alpha value as 0.05 for this study.)
Assumptions/Conditions
1. The observations should be independent within and between groups
2. The observations within each group should be nearly normal
shapiro.test()
for each group in your categorical variable.3. The variability across the groups should be about equal
Failing to check conditions may affect the test’s error rates.
# A tibble: 3 × 3
depth mean sd
<chr> <dbl> <dbl>
1 bottom 6.04 1.58
2 middepth 5.05 1.10
3 surface 4.2 0.660
Let’s check if the largest sample SD divided by the smallest sample SD to be less than 2
A significant F-test indicates that we can reject null hypothesis, which states that population means are equal.