Aan de slagGa gratis aan de slag

p-value for two-sided hypotheses: opportunity costs

The p-value measures the likelihood of data as or more extreme than the observed data, given the null hypothesis is true. Therefore, the appropriate p-value for a two-sided alternative hypothesis is a two-sided p-value.

To find a two-sided p-value, you simply double the one sided p-value. That is, you want to find two times the proportion of permuted differences that are less than or equal to the observed difference.

The opp_perm data frame, containing the differences in permuted proportions, and the original observed statistic, diff_orig, are available in your workspace.

Deze oefening maakt deel uit van de cursus

Foundations of Inference in R

Cursus bekijken

Oefeninstructies

Use opp_perm to compute the two-sided p-value, or twice the proportion of permuted differences that are less than or equal to the original difference.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Calculate the two-sided p-value
opp_perm %>%
  summarize(p_value = ___)
Code bewerken en uitvoeren