citation()Data analysis & report writing assignment
Exercise 8

Overview
In this assignment you will read the introduction and methods sections of a published research paper. However, the results and discussion sections have been removed, as have most references to statistical methods used. For this exercise to be useful, please do not look-up the original paper until you are finished.
The redacted version of the paper can be downloaded from Canvas.
The dataset the researchers collected can be downloaded from GitHub or Canvas.
Your task is to:
- Identify the research questions and/or hypotheses of the study.
- Design a set of statistical methods to address those hypotheses, given the data the authors collected, and write the missing Statistical analysis section of the methods section.
- Carry out the statistical analysis, produce tables and figures, and write the missing Results section.
You should:
- Perform your analysis in a Rmd file.
- Write the missing Statistical analysis and Results in a word document (or something similar), using figures and results from the analysis.
- Submit both documents at the end of the assignment.
Get RStudio setup
Each time you start a new exercise, you should:
- Make a new folder in your course folder for the exercise (e.g.
biob11/exercise_8) - Open RStudio
- If you haven’t closed RStudio since the last exercise, I recommend you close it and then re-open it. If it asks if you want to save your R Session data, choose no.
- Set your working directory by going to Session -> Set working directory -> Choose directory, then navigate to the folder you just made for this exercise.
- Make a new Rmd file (File -> New file -> R markdown..) and save it in the working directory folder. Delete any of the demo text not in the YAML frontmatter.
- Download the dataset and move it into your working directory folder.
- Load the
tidyverseandinferpackages. - Import the dataset using
read_csv(). - Use Headings so that your document is clear and easy to follow.
Identify hypotheses
Read through the paper, and highlight any sentence that could form a hypothesis. For example on page 3:
“we expected that males perceiving high-density environments would have larger testes and accessory glands (that produce seminal fluid) due to increased sperm competition.”
This is a clear statement of a hypothesis about how perceived population density could have a directional effect on testes and accessory gland size.
Identify at least hypothesis from the paper in each of the following topics:
- Metabolic rate
- Reproductive investment
- Aggressive behaviours
- Song characteristics
If while reading you develop your own own hypotheses, you can also add them.
Explore the dataset
The dataset contains 29 variables. You are not requried to use them all. A basic definition is given for each variable below, but consulting the original paper is required to fully understand what each means, and to decide how to use it properly. The dataset also contains many NA values, as not all crickets were used for all experiments. Be mindful of this when working with it.
Design the statistical analysis
Take each of your identified hypotheses and:
- Decide which variables you can use to address it. What are your response and explanatory variables?
- Decide on a sample/test statistic (mean, variance, standard deviation, difference in means, \(F\), \(\chi^2\), correlation, etc), method (regression) and/or approach (confidence intervals, hypothesis test) that would be best to address the hypothesis.
- If using a hypothesis test, turn the hypothesis into a clear null and alternative hypothesis. Make sure to indicate the direction (lesser, greater, two-sided) if appropriate.
- Write the Statistical Analysis section of the methods in your report (or do this later if you prefer).
Perform the statistical analysis
Use what you have learned during the course so far to conduct the analysis you have described. Make use of the infer package. Use examples from previous exercises, or from the infer set of examples.
Write the results section
A results section is where you report your findings to all the hypotheses laid out in the introduction and methods. You have already described your statistical analysis in the methods section, so there is no need to go into great detail here. Importantly, in a paper with separate results and discussion sections, you should not discuss your findings in the results section, only report them. Any time you report a result, you should back it up with a statistic, and a relevant figure. A helpful two part structure you can follow for each result is the following:
- Report the overall result in plain language. If the reader reads only this sentence, they should get the whole picture in broad terms.
Perceived population density during development had X effect on reproductive investment.
- Report the result in more specific terms. Make reference to the source of your results, such as statistical tests, tables and figures. You may have several sentences like this for each overall result.
Accessory gland mass [did/did not] differ significantly between males reared in high or low densities (difference in means test, diff = X, $p = Y, figure Z).
Give the paper a title
Can you think of a good title for the paper? Often the title of a paper will summarise the results in a single line, and/or try to be eye catching.
Submit your work
Submit your work (both a knitted HTML analysis, and a document with the text and key figures) via the Canvas assignment.