112k views
4 votes
Test the claim that a student's pulse rate is not significantly different when taking a quiz than attending a regular class. The mean pulse rate difference is 2.7 with a standard deviation of 9.93 out of 10 students. Use a significance level of 0.01.

Pulse rate difference
(Quiz - Lecture)
2
-1
5
-8
1
20
15
-4
9
-12

Apply the central limit theorem or use the data at StatKey to run the Randomization Test for a Mean. Change to the data set for Pulse rate difference (Quiz - Lecture) and run at least 6000 simulations to generate a distribution of sample means.

The p-value is:

User Watsonic
by
8.0k points

1 Answer

1 vote

The p-value is less than or equal to the significance level (0.01), you would reject the null hypothesis that there is no significant difference in pulse rate when taking a quiz versus attending a regular class.

To perform a randomization test for the mean pulse rate difference between taking a quiz and attending a regular class, you can follow these steps:

Calculate the observed mean difference:

Observed Mean Difference=
(∑ Pulse Rate Differences)/(Number of Students)

Create a null distribution:

Combine the pulse rate differences into one dataset.

Shuffle the dataset to create a null distribution.

Repeat this process a large number of times (e.g., 6000 simulations).

Calculate the mean difference for each simulated dataset.

Calculate the p-value:

p-value =
(Number of Simulated Mean Differences≥Observed Mean Difference)/(Total Number of Simulations)

import numpy as np

# Given data

pulse_rate_differences = np.array([2, -1, 5, -8, 1, 20, 15, -4, 9, -12])

observed_mean_difference = np.mean(pulse_rate_differences)

# Number of simulations

num_simulations = 6000

# Simulate the null distribution

null_distribution = []

for _ in range(num_simulations):

shuffled_data = np.random.permutation(pulse_rate_differences)

null_distribution.append(np.mean(shuffled_data))

# Calculate the p-value

p_value = np.mean(null_distribution >= observed_mean_difference)

print("Observed Mean Difference:", observed_mean_difference)

print("p-value:", p_value.

This code calculates the p-value for the randomization test.

If the p-value is less than or equal to the significance level (0.01), you would reject the null hypothesis that there is no significant difference in pulse rate when taking a quiz versus attending a regular class.

User Fermmm
by
7.8k points