✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
To check whether the conclusion of Analysis 2 depends on the assumptions of the t-test, an analyst runs a permutation test with 5000 permutations. The effect is the mean of time_A minus the mean of time_B. The analyst's code and output are shown below.
obs_diff <- times_long |>
group_by(layout) |>
summarise(mean_time = mean(time_s)) |>
summarise(diff = mean_time[layout == "A"] - mean_time[layout == "B"]) |>
pull(diff)
perm_diffs <- map_dbl(1:5000, \(i) {
times_long |>
mutate(layout_perm = sample(layout)) |>
group_by(layout_perm) |>
summarise(mean_time = mean(time_s)) |>
summarise(diff = mean_time[layout_perm == "A"] - mean_time[layout_perm == "B"]) |>
pull(diff)
})
(sum(abs(perm_diffs) >= abs(obs_diff)) + 1) / (5000 + 1)
Output 2.7 Permutation Output> obs_diff
[1] 6.86
> sd(perm_diffs)
[1] 4.19
> (sum(abs(perm_diffs) >= abs(obs_diff)) + 1) / (5000 + 1)
[1] 0.10
The analyst concludes: “The permutation p-value is 0.10, so there is no clear evidence that the layouts differ. This disagrees with Analysis 2 (p = 0.0009), so the paired t-test must be unreliable.”
Identify the error in the analyst's approach, explain how it produces the output shown in Output 2.7, and describe how to correct it. Then comment on the analyst's conclusion.
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!