From c429a439bfd70363d8e0058dc0abbbd10bff09a1 Mon Sep 17 00:00:00 2001 From: Julian Lange <32773007+langejulian@users.noreply.github.com> Date: Mon, 9 Sep 2024 04:05:04 +0200 Subject: [PATCH] Update check-power.qmd (attempt to fix numbered task list yet again) --- tutorial_pages/check-power.qmd | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tutorial_pages/check-power.qmd b/tutorial_pages/check-power.qmd index 916cb6b..68f645a 100644 --- a/tutorial_pages/check-power.qmd +++ b/tutorial_pages/check-power.qmd @@ -32,13 +32,11 @@ If we sample values from two normal distributions with different means (e.g. N(0 *** **YOUR TURN:** -1. Use your simulation skills to work out the power through simulation. Write a function that does the following: - - i) Draws `n` values from a random normal distribution with `mean1` and another `n` values from a normal distribution with `mean2`. - ii) Compares the means of these two samples with a *t*-test and extracts the *p*-value. - -2. Replicate the function 1000 times using the parameters used in the power calculation above (that used the `power.t.test()` function). -3. Calculate the proportion of *p*-values that are smaller than 0.05. +1. Use your simulation skills to work out the power through simulation. Write a function that does the following: + i. Draws `n` values from a random normal distribution with `mean1` and another `n` values from a normal distribution with `mean2`. + ii. Compares the means of these two samples with a *t*-test and extracts the *p*-value. +2. Replicate the function 1000 times using the parameters used in the power calculation above (that used the `power.t.test()` function). +3. Calculate the proportion of *p*-values that are smaller than 0.05. ***