Aan de slagGa gratis aan de slag

Summarizing opportunity cost (1)

As you saw in the video, we're interested in whether the treatment and control groups were equally likely to buy a DVD after reading the experimental statements.

In this exercise, you'll use the data from the study to find the sample statistics (here: proportions) that are needed for the analysis.

Deze oefening maakt deel uit van de cursus

Foundations of Inference in R

Cursus bekijken

Oefeninstructies

  • Use the count() function to tabulate the dataset called opportunity. Make a note of the values in the decision column for use in the next step.
  • For each experimental group, find the proportion who bought a DVD. That is, calculate the mean where decision is "buyDVD".

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Tabulate the data
opportunity %>%
  ___(decision, group)

# Find the proportion who bought the DVD in each group
opportunity %>%
  group_by(___) %>%
  summarize(buy_prop = ___(___))
Code bewerken en uitvoeren