ComeçarComece de graça

Permutation test: wild type versus heterozygote

Test the hypothesis that the heterozygote and wild type bout lengths are identically distributed using a permutation test.

Este exercício faz parte do curso

Case Studies in Statistical Thinking

Ver curso

Instruções do exercício

  • Compute the difference of means (heterozygote minus wild type bout lengths) of the actual datasets, storing the result in the variable diff_means_exp. The numpy arrays bout_lengths_wt and bout_lengths_het are already in your namespace.
  • Draw 10,000 permutation replicates of the difference of means using dcst.draw_perm_reps(). You can use the dcst.diff_of_means() function as well, storing your result in perm_reps.
  • Compute the p-value, defining "at least as extreme as" to be that the difference of means under the null hypothesis is greater than or equal to that which was observed experimentally.
  • Print the p-value to the screen.

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# Compute the difference of means: diff_means_exp
diff_means_exp = ____ - ____

# Draw permutation replicates: perm_reps
perm_reps = ____(____, ____, 
                               ____, size=____)

# Compute the p-value: p-val
p_val = ____(____ >= ____) / len(____)

# Print the result
print('p =', p_val)
Editar e executar o código