Homework 3 Solution
Total Page:16
File Type:pdf, Size:1020Kb
Homework 3 Solution
Question 1 SAS Code: DATA Rats; INPUT Group BP; DATALINES; 1 384 1 369 1 354 1 375 1 366 1 423 2 152 2 157 2 179 2 182 2 176 2 149 ; PROC UNIVARIATE DATA = Rats NORMAL; CLASS Group; VAR BP; RUN; PROC TTEST DATA = Rats; CLASS Group; VAR BP; RUN;
Selected Output: The UNIVARIATE Procedure Variable: BP Group = 1
Tests for Normality Test Statistic p Value Shapiro-Wilk W 0.869398 Pr < W 0.2238 Kolmogorov-Smirnov D 0.24254 Pr > D >0.1500 Cramer-von Mises W-Sq 0.0744 Pr > W-Sq 0.2112 Anderson-Darling A-Sq 0.444501 Pr > A-Sq 0.1864
The UNIVARIATE Procedure Variable: BP Group = 2
Tests for Normality Test Statistic p Value Shapiro-Wilk W 0.85134 Pr < W 0.1614 Kolmogorov-Smirnov D 0.254371 Pr > D >0.1500
1 Tests for Normality Test Statistic p Value Cramer-von Mises W-Sq 0.077782 Pr > W-Sq 0.1896 Anderson-Darling A-Sq 0.454293 Pr > A-Sq 0.1737
The TTEST Procedure Method Variances DF t Value Pr > |t| Pooled Equal 10 18.51 <.0001 Satterthwait Unequal 8.3215 18.51 <.0001 e
Equality of Variances Method Num DF Den DF F Value Pr > F Folded 5 5 2.63 0.3121 F
Interpretation: Normality Test: In order to choose appropriate test, we check the normality for both groups. Both group have the same Null Hypothesis and Alternative Hypothesis.
The p-value for the group at is , and the p-value for the group at is . Since both p-values are greater than , we fail to reject the null hypothesis and conclude that the normality assumption is met and both group follow normal distribution. Variance Test: Under normality assumption, we then test if two population variances are equal. The null hypothesis and the alternative hypothesis are
The p-value of the F-test is . Since the p-value is greater than , we fail to reject the null hypothesis at the significance level and conclude that . Pooled-Variance T-Test: The Null Hypothesis and Alternative Hypothesis:
The p-value of the pooled-variance t-test is much less than . Since the p-value is less than , we reject the null hypothesis at the significance level and conclude that the rats have higher blood pressure at than .
2 Question 2 SAS Code:
DATA Sales; INPUT Before After; Diff = After - Before; DATALINES; 12 18 18 24 25 24 9 14 14 19 16 20 ; PROC UNIVARIATE DATA = Sales NORMAL ALPHA = 0.01; VAR Diff; RUN;
Selected Output: The UNIVARIATE Procedure Variable: Diff Moments
Tests for Location: Mu0=0 Test Statistic p Value Student's t t 3.86680 Pr > |t| 0.0118 1 Sign M 2 Pr >= |M| 0.2188 Signed S 9.5 Pr >= |S| 0.0625 Rank
Tests for Normality Test Statistic p Value Shapiro-Wilk W 0.735678 Pr < W 0.0144 Kolmogorov-Smirnov D 0.308159 Pr > D 0.0739 Cramer-von Mises W-Sq 0.138153 Pr > W-Sq 0.0242 Anderson-Darling A-Sq 0.77049 Pr > A-Sq 0.0211
Interpretation: Normality Test: In order to choose appropriate test, we check the normality for the paired data. The Null Hypothesis and Alternative Hypothesis.
3 The p-value for Shapiro-Wilk test is . Since , we reject the null hypothesis and conclude that the paired difference does NOT follow a normal distribution. Wilcoxon Signed Rank Test: We then use Wilcoxon signed rank test since the normality assumption is not met. The Null Hypothesis and Alternative Hypothesis are
The p-value of the Wilcoxon signed rank test is . Since the p-value is greater than , we fail to reject the null hypothesis and cannot conclude that the mean weekly sales for all salespersons increase after the course at the significance level .
4