Objectives and Concepts
- Practice a complete analysis of differences between 2 groups:
- State hypotheses
- Check assumptions
- Conduct a 2-sample test.
Data
Locate and download the flour_beetles.csv
file and save
it in your class project data
subdirectory.
This data set consists of counts of flour beetles at two different
farms (adapted from Gardener)
Instructions
- Self-select your group in Moodle
- Create a new RMarkdown document.
- Create a new code chunk: use
here()
and
read.csv()
to read in the data to a data.frame
object.
- Create a chunk and code to perform a numerical exploration:
- Calculate the mean and standard deviations for the observations at
Woad and Glebe farms.
- Perform a Shapiro test on the count data for both farms.
- NOTE: you’ll need to do some logical subsetting to perform these
operations.
- Use a new code chunk to perform a graphical exploration:
- Create histograms of the observations at Woad and Glebe farms.
- Create a conditional boxplot of the observations at Woad and Glebe
farms.
- Perform a 2-sample t-test.
Click to show/hide logical subset hint
You can use the following code to subset the flour beetles:
dat_woad = subset(beetles, farm == "Woad")
dat_glebe = subset(beetles, farm == "Glebe")
Report
Questions
Respond to the following questions in your group report:
- Q4 (2 pts.): Based on the Shapiro tests and your
graphical exploration, do you think the data (within farms) are normally
distributed? Explain your reasoning.
- Q5 (2 pts.): 2. Which test is more appropriate for
the data (t-test or Wilcox)? Explain your reasoning.
- Q6 (1 pt.): 3. What was the p-value from the
t-test?
- Q7 (2 pts.): 4. Based on the graphical exploration
and statistical tests, do you think there are significantly different
counts of flour beetles at the two farms? Explain your reasoning.