Anda di halaman 1dari 2

1

Using Excel: Hypothesis Tests with Two Samples


We will consider the dierences between two population means using software (Excel here). Generally with any software we are really looking for P-values. So, deciding to support the claim or not will be based entirely on the P-value. This way, you dont really need to specify a signicance level at the beginning of each test. You just run the test and check for signicance by inspecting the P-value. The data is for the cholesterol levels for men diagnosed with high cholesterol. The rst row comes from men who had no treatment and the second from men who used a certain cholesterol lowering drug. We want to test claims about how eective the drug is. With software, you dont have to calculate dierences, means, variances, or standard deviations, the software will calculate what it needs.

No Drug Drug

Cholesterol Levels in mg/dL 237 289 257 228 303 275 262 304 244 233 194 240 230 186 265 222 242 281 240 212

Paired Data
Lets assume that the data represents the cholesterol levels for each of 10 men in the sample, before and after using the drug. This type of data is called matched pairs. We will use Excels t-test for paired two sample means. This is found in the Data Analysis ToolPak. Below I demonstrate two such t-tests for two hypothesized mean dierences between the populations.
t-Test: Paired Two Sample for Means no drug drug Mean 263.2 231.2 Variance 811.1 864.0 Observations 10 10 Pearson Correlation 0.8583 Hypothesized Mean Difference 0 df 9 t Stat 6.55936 P(T<=t) one-tail 5.2E-05 t Critical one-tail 1.83311 P(T<=t) two-tail 0.0001 t Critical two-tail 2.26216 t-Test: Paired Two Sample for Means no drug drug Mean 263.2 231.2 Variance 811.067 864 Observations 10 10 Pearson Correlation 0.85834 Hypothesized Mean Difference 20 df 9 t Stat 2.45976 P(T<=t) one-tail 0.01809 t Critical one-tail 1.83311 P(T<=t) two-tail 0.03617 t Critical two-tail 2.26216

Process: (1) Click on the Data Analysis tab and choose t-Test: Paired Two-Sample For Means. (2) Input the data with the rst sample being the one with the greater mean. (3) Enter a hypothesized mean dierence. (4) Click on OK (5) Results Conclusions: (1) At the 0.01 signicance level there is sucient sample evidence to support the claim that the drug reduces cholesterol levels in all men. (1) At the 0.05 signicance level there is sucient sample evidence to support the claim that the drug reduces cholesterol levels by more than 20 mg/dL.

Independent Data
In this section we will assume the data came from two dierent populations of men; those who used the drug and those who did not. We will use Excels t-test for two sample means. This is found in the Data Analysis ToolPak. Below I demonstrate two such t-tests for two hypothesized mean dierences between the populations.

Process: (1) Click on the Data Analysis tab and choose t-Test: Two-Sample Assuming Unequal Variances. (2) Input the data with the rst sample being the one with the greater mean. (3) Enter a hypothesized mean dierence. (4) Click on OK (5) Results Conclusions: (1) At the 0.01 signicance level, there is not sucient sample data to support the claim that the mean cholesterol level for men who use the drug is less than the mean for those who do not use the drug. (2) At the 0.05 signicance level, the sample data supports the claim that the mean cholesterol level for men who use the drug is below the mean for those who do not use the drug. (3) At the 0.05 signicance level, the sample data supports the claim that the mean cholesterol level for men who use the drug is more than 5 mg/dL below the mean for those who do not use the drug. Observation

t-Test: Two-Sample Assuming Unequal Variances no drug drug Mean 263.2 231.2 Variance 811.1 864.0 Observations 10 10 Hypothesized Mean Difference 0 df 18 t Stat 2.47252 P(T<=t) one-tail 0.01181 t Critical one-tail 1.73406 P(T<=t) two-tail 0.02362 t Critical two-tail 2.10092

t-Test: Two-Sample Assuming Unequal Variances no drug drug 263.2 231.2 811.06667 863.9556 10 10 5 18 2.0861882 0.0257313 1.7340636 0.0514625

Mean Variance Observations Hypothesized Mean Difference df t Stat P(T<=t) one-tail t Critical one-tail P(T<=t) two-tail

A claim is generally easier to support if the data comes in pairs. Or, dierences are more signicant if they come from pairs. This is because the variations between the two populations is less.

Anda mungkin juga menyukai