Project 3
a simulation study
For Project 3 you will conduct a small simulation study which does one of the following tasks (you can choose!):
conducts a hypothesis test by simulating behavior under the null hypothesis (i.e., “nothing going on”). You will need to find a dataset and develop a related research question. Please include the full context of the problem. That is, what are the variables and why is testing them interesting? Include a visualization of the original data / variables of interest so that the reader can sense the extent of difference in the original relationship. Also include a conlcusion (which will naturally describe the population to which you are inferring). Note that we did two types of hypothesis tests in class:
- for a single variable, we considered whether the probability of “success” was the same as what we’d expect if nothing was going on. (note: the probability isn’t always 1/2. If you are asking about how often to roll a 3 on a single die, the “nothing is going on” probability would be 1/6.)
- for two variables, is the difference in some statistic (e.g., mean or median) larger than you’d expect if the two variables are unrelated?
develops a lineup protocol for visual inference, as in “Bringing Visual Inference to the Classroom”, (you’ll need to write the function to do the mapping. The ggplot part will be straightforward using faceting.). [That is, you will use a dataset, with a related research question, and test the research question using a series of null plots.]
calculates a probability which is not trivial to estimate without a simulation. For example, simulate room draw!
simulates a model of some kind and describes (e.g., plots) the sensitivity of the model to changes in the parameters.
(needs some background in introductory statistics) investigates the effects of condition violations on a statistical test, as measured by coverage rate, confidence interval width, type I error rate, etc. [That is, your simulation will generate data and assess how often the data reject the null hypothesis or how often the confidence interval captures the true parameter. I’m happy to help with the R code for the statistics on this one!]
Your simulation study should contain the following elements:
- at least 1 function that you wrote
- at least 1
map()variant - a description of the simulation. Help the reader follow what you are doing, that is, what does your function do? why would you map it? etc.
- at least 1 illustrative, well-labeled plot
- a description of what insights can be gained from your plot(s) / results
Logistics:
- start by describing what you plan to do (3-4 sentences) and end with a description of what you did (3-4 sentences). That is, use words to guide the reader through your analysis.
- please include all your code used in the analysis (but feel free to use code folding1).
- make sure that all graphs are well-labeled (including x and y axes, title of the graph, and accurate and succinct labels for color and fill).
- do not include error or warning messages (see HW YAML for code).
- include a few sentences describing each of your plots or tables. That is, tell the reader what they see when they look at the plot. Your narrative description should be in the text part of the qmd file, not as a comment in an R chunk.
- if you used data, include the source of the data. Include both where you got the data (e.g., the TidyTuesday URL) and also the original provenance of the information (i.e., more than just the URL).
- if you are working with a (local) copy of the .csv file (as opposed to, for example, a link to the dataset on TidyTuesday’s GitHub site), then the .csv file should live in your GitHub repository for your website. And you should read the data in from that local copy. That is, the dataset should not live in your Downloads on your computer.
- you may not repeat any of the simulations that were already completed in the class notes.
Timeline
Project 3 should be submitted on Canvas (not Gradescope) by 11:59 PM on Thursday November 5, 2026. For your website, you may add a new tab to your Quarto webpage or you may add the analysis under your “Data Viz” tab. Submit the new page’s URL. [Remember, you should continue to work in the same folder that is connected to the GitHub website page. Do not create a new GitHub repository.]
Footnotes
code folding allows the user can see the code if they want to: https://quarto.org/docs/output-formats/html-code.html#folding-code↩︎