This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Homework 2 Solutions 2.b. &amp; 3. Permutation distribution of the differences of means and medians H : F 1 ( x ) = F 2 ( x ) H a : F 1 ( x ) &lt; F 2 ( x ) or F 1 ( x ) &gt; F 2 ( x ) For the pvalue calculation, p value mean diff = 1 N N summationdisplay i =1 I (  D i   D obs  ) p value sum trt1 = 2 1 N N summationdisplay i =1 I ( S i S obs ) p value med diff = 1 N N summationdisplay i =1 I (  M i   M obs  ) Permutation Test of Mean Difference: pvalue= 0.9 Permutation Test of Sum of Trt 1: pvalue= 0.9 Permutation Test of Median Difference: pvalue= 1 Histogram of the permutation distirbution of the Mean Differences Mean Difference Frequency2010 10 20 1 2 3 4 5 6 7 Histogram of the permutation distribution of the Sum of Trt 1 Sum of Trt1 Frequency 15 20 25 30 1 2 3 4 5 Histogram of the permutation distribution of the Median Differences Median Difference Frequency5 5 1 2 3 4 We fail to reject H for all three tests. 1 4. Permutation distribution of the differences of means and the Wilcoxon ranksum test H : F 1 ( x ) = F 2 ( x ) H a : F 1 ( x ) &lt; F 2 ( x ) or F 1 ( x ) &gt; F 2 ( x ) Permutation Test of Mean Difference: pvalue= 0.02380952 Wilcoxon RankSum Test: Exact Wilcoxon rank sum test data: Sec1 and Sec2 W = 3, pvalue = 0.03030 alternative hypothesis: true mu is not equal to 0 At = 0 . 01, we fail to reject H , but at = 0 . 05, we reject H for permutation test of the mean difference and Wilcoxon ranksum test. 5. Wilcoxon ranksum test H : F 1 ( x ) = F 2 ( x ) H a : F 1 ( x ) &lt; F 2 ( x ) or F 1 ( x ) &gt; F 2 ( x ) Wilcoxon RankSum Test: H_a: F1(x) &gt; F2(x) or F1(x) &lt; F2(x) Exact Wilcoxon rank sum test data: SpeA and SpeB W = 22, pvalue = 0.05556 alternative hypothesis: true mu is not equal to 0 H_a: F1(x) &gt; F2(x) Exact Wilcoxon rank sum test data: SpeA and SpeB W = 22, pvalue = 0.02778 alternative hypothesis: true mu is greater than 0 2 H_a: F1(x) &lt; F2(x) Exact Wilcoxon rank sum test data: SpeA and SpeB W = 22, pvalue = 0.9841 alternative hypothesis: true mu is less than 0 At = 0 . 05, we fail to reject H : F 1 ( x ) &lt; F 2 ( x ) or F 1 ( x ) &gt; F 2 ( x ). However, the pvalue is closed to given = 0 . 05, thus we can try to do test with more specific alternative hypothesis. From onesided test, we find out that F 1 ( x ) &gt; F 2 ( x ) at the significant level = 0 . 05. 7. &amp; 8. Wilcoxon ranksum test vs. twosample ttest H : F 1 ( x ) = F 2 ( x ) H a : F 1 ( x ) &lt; F 2 ( x ) or F 1 ( x ) &gt; F 2 ( x ) Exact Wilcoxon rank sum test data: Rural and Urban W = 314.5, pvalue = 0.0008783 alternative hypothesis: true mu is not equal to 0 Two Sample ttest...
View
Full
Document
This note was uploaded on 07/22/2011 for the course STA 4502 taught by Professor Staff during the Spring '08 term at University of Florida.
 Spring '08
 Staff

Click to edit the document details