Data/Data Analysis/ Descriptive Statistics/Summary Statistics and Confidence Level for Mean Before After Mean82.36Mean85.04 Standard Error0.61Standard Error0.93 Median81.85Median84.05 Mode86Mode81.4 Standard Deviation5.184Standard Deviation7.927 Sample Variance26.875Sample Variance62.838 Kurtosis-0.007Kurtosis-0.614 Skewness-0.022Skewness0.408 Range24.9Range32.3 Minimum70Minimum71.3 Maximum94.9Maximum103.6 Sum5929.9Sum6122.8 Count72Count72 Confidence Level(95.0%)1.218Confidence Level(95.0%)1.863 s/n^.5 7.9/72^.5 82.36 +/- 1.218 is the 95% confidence interval for the mean.
H0: μ b = μ a Ha: μ a > μ b Test Statistic P-value = t.dist.rt(2.40,142) = 0.0088
H0: μ b = μ a Ha: μ a > μ b t-Test: Two-Sample Assuming Equal Variances AfterBefore Mean85.03982.360 Variance62.83826.875 Observations72 Pooled Variance44.857 Hypothesized Mean Difference0.000 df142 t Stat2.400 P(T<=t) one-tail0.00884 t Critical one-tail1.656 P(T<=t) two-tail0.018 t Critical two-tail1.977 Same as previous slide! Data must be in two columns. If this is all you want, =t.test() is for you!
The 2-sample t-test we just did is VALID. But we can do better….. By taking advantage of our paired data.
Paired Data n1 must equal n2 For each of the before values, there must be a corresponding after value for the same element. – Here the data elements are the patients. And the paired nature of the data is OBVIOUS. Using a paired test when the data are paired USUALLY leads to a valid and LOWER p-value. – Because s1 and s2 (the standard deviations of each group) do NOT enter into the “equation” – Instead, we use the sample standard deviation of the n differences…which is usually “pretty” small. Instead of dealing with the variation in weights across the patients (s1 and s2), we deal only with the variation in pounds gained. – 90 to 92 and 45 to 47 are both gains of 2.
H0: μ b = μ a Ha: μ a > μ b Better than before! t-Test: Paired Two Sample for Means AfterBefore Mean85.03982.36 Variance62.83826.875 Observations72 Pearson Correlation0.3498 Hypothesized Mean Difference0 df71 t Stat2.9116 P(T<=t) one-tail0.0024 t Critical one-tail1.6666 P(T<=t) two-tail0.0048 t Critical two-tail1.9939
H0: μ b = μ a Ha: μ a > μ b The = t.dist(array1,array2,1,1) takes you directly to the p-value 1 for 1-tail 1 for paired If all you want is the p-value…..
H0: μ b = μ a Ha: μ a > μ b IDGroupBeforeAfterAft-Before 1180.780.2-0.5 2189.481-8.4 3191.886.4-5.4 417486.312.3 5178.176.1-2 6188.378.1-10.2 67382.195.513.4 68377.690.713.1 69383.592.59 70389.993.83.9 7138691.75.7 72387.39810.7 Average2.679167 count72 stdev7.807796 standard error0.920158 t-stat2.911639 dof71 p-value0.002401 A paired two-sample t-test for means Is equivalent to A one-sample t-test of H0: μ A-B = 0. 2.68/.92