Objectives

By the end of this assignment, you should:

This assignment is due Thursday, October 14th at noon. Please turn your .html AND .Rmd files into Canvas. Your .Rmd file should knit without an error before turning in the assignment.


In the first few exercises, we’ll return to the data from Experiment 1A of Zettersten & Lupyan (2020) that you worked with in Assignment 4, and that we’ve talked about in lecture. Our goal will be to estimate the means in the two conditions, and quantify our certainty about these estimates using confidence intervals.

  1. To start, you’ll need to read in the data from Zettersten & Lupyan and recreate the data frame called zl_exp1a from Assignment 4.

    [a] Take the data frame called zl_exp1a and modify it so it has a single row for each subject, condition, and block number. Accuracy should be summarized for each subject as the proportion of trials categorized correctly. Save the new data frame as zl_exp1a_by_subject.
    [b] Plot a histogram of zl_exp1a_by_subject with a separate facet for each unique combination of condition and block number (make sure to set the binwidth to an appropriate value).


  1. [a] Use zl_exp1a_by_subject to calculate a point estimate of the mean and a 95% confidence interval for each combination of condition and block number.
    [b] Recreate the plot that you made in Assignment 4, Exercise 2d, adding the confidence intervals you just calculated in part a.
    [c] Were you able to successfully reproduce the confidence intervals from the paper (Fig. 4A)?


  1. [a] What is the point estimate of the mean for the third block in the high nameability condition?
    [b] What is the confidence interval of the mean for the third block in the high nameability condition?
    [c] How should we interpret the range of values given by the confidence interval? In other words, what does this range mean?


  1. Compare the confidence intervals in the low versus high nameability conditions.

    [a] How are they different (qualitatively)?
    [b] Explain why they are different despite having the same number of participants in each condition. Make reference to the equations we talked about in class defining a confidence interval.



The next exercises concern the ManyBabies dataset we discussed in lab. The experiment replicates an experiment designed to test whether infants have a preference for infant directed speech (IDS) compared to adult directed speech (ADS). Like in the previous exercises, our goal will be to estimate the means in the two conditions, and quantify our certainty about this estimate using confidence intervals.

The dataset we’ll be working with in this assignment is a subset of the full ManyBabies dataset. It contains the data for 6 replication attempts from 6 different labs. The data (in tidy format) are located in the at the following address. Each row corresponds to the data from one subject.

https://raw.githubusercontent.com/mllewis/cumulative-science/master/static/data/many_babies_data.csv.

Each of the variables (columns) are described below.

Start by reading the data into R. Spend a few minutes exploring the data to understand its structure using functions like glimpse and summary.


  1. Explain why these experiments are “replications”.


  1. What is the predicted pattern for the mean looking times in the IDS versus the ADS conditions? Let’s call this pattern the “effect”.


  1. How many babies were run in each lab? You can print out a nicely formatted version of this dataframe in your knitted html file using the function kable(<DATAFRAME>) from the knitr package.


  1. [a] Plot a histogram of looking time data. Show each condition as a different fill and the data in each lab as a separate facet.
    [b] It’s a little hard to see the difference between the conditions with the data plotted as histograms. Make a second plot that uses geom_density rather than geom_histogram. geom_density plots frequencies as a smoothed probability distribution rather than raw counts. Set the alpha parameter in geom_density so that you can see both overlapping distributions.


  1. Look at the distribution plots you made in the previous exercises.

    [a] Describe in words the distributions for IDS and ADS looking times for the lab named babylabprinceton (central tendency and dispersion).
    [b] Compare the central tendencies in the two conditions across labs. What is the pattern in the results across the different labs?


  1. Let’s quantify our certainty in the pattern of results across labs using confidence intervals. Calculate a 95% confidence interval of the mean looking time for each condition in each lab. Save it to a data frame called ids_by_lab


  1. [a] Plot the point estimates and confidence intervals in ids_by_lab with condition on the x-axis and the data from each lab as a separate facet. As in your distribution plots above, each condition should be represented with a different color.
    [b] Interpret the plots. What is the pattern within individual labs? Describe and explain your level of certainty about these claims (in words).
    [c] In which lab is the effect largest? In which lab is the effect smallest? (no need to calculate anything, just “eyeball” it).


  1. [a] The confidence intervals for the lab “infantllmadison” are smaller than for the lab “babylabprinceton”. Explain one reason why that might be.
    [b] The confidence intervals for “babylabparisdescartes1” are smaller than for “babylabpotsdam”. Explain one reason why that might be.