1、第三课 配对样本t检验,3.1 统计方法的种类和条件 参数统计(parametric statistics):通常要求样本所来自的总体的分布型是已知的 (如身高呈正态分布),在这种假设的基础上,对总体参数(如总体平均数)进行检验,称为参数统计。如:t检验(Gossett笔名student)非参数统计(non-parametric statistics):某些数据的总体分布难以用函数式表达,或者总体分布的函数式未知,只知道总体分布是连续型或离散型,解决这类问题不依赖总体分布的形式,或者不受总体参数的限制,故称非参数统计。如:2 检验:在调查问卷、民意测验中,e.g. 文理分科、总统选举、饮料、水
2、果偏好等,意见不一定呈正态分布。,3.2 t检验的种类 单总体t检验:检验样本平均数与已知总体平均数的差异是否显著。当总体呈正态分布,如总体标准差未知,且样本容量小于30,则样本平均数与总体平均数的离差统计量呈t分布。 e.g.中国男性平均身高是170cm,某大学男生身高是否与此一致。 双总体t检验:检验两个样本平均数与其各自代表的总体的差异是否显著,分为两类: 1)配对样本t检验(Paired-Samples t Test):用于检验两个相关样本的平均数与其各自代表的总体的差异是否显著。分为两种实验设计:(1)自身不同处理结果的检验。e.g. 1个班2次考试(2)同一总体配对后不同处理结果的
3、检验。 e.g.把受试根据年龄、性别、成绩配对再处理。 2)独立样本t检验(Independent-Samples t Test):用于检验两个独立样本的平均数与其各自代表的总体的差异是否显著。e.g. 2个班1次考试,3.3 假设检验三步骤1)建立假设,确定检验水准 H0,H1,若拒绝H0,就接受H1,假设检验分单、双侧检验。检验水准通常取0.05或0.01。 2)根据研究目的和实验设计选择检验方法 参数检验(t检验)、非参数检验(2检验) 3)根据P值,作出统计结论 若p0.05,接受H0;若p0.05,拒绝H0,=0.05。,3.4 配对样本t检验(Paired-Samples t Te
4、st) 例1:某班20个学生第一和第二学期期末的听力考试成绩如下所示,请检验一下,两次考试的平均成绩之间是否有显著差异(= .05)。,3.4.1用Excel进行Paired-Samples t Test的步骤 H0 H1 1) 在“工具”栏依次点击“数据分析”“t-检验:平均值的成对二样本分析”“确定”; 2) 点击“变量1的区域”右边的数据组表格框、拖动数据所在的表格; 3) 点击“变量2的区域”右边的数据组表格框、拖动数据所在的表格; 4) “”的右边默认是0.05,也可改为0.01; 5) “输出选项”统计结果的位置可放到“新工作表组”,也可指定在某个区域,最后点击“确定”。 答案:
5、t = -2.092,df = 19,p .05,无显著差异。,3.4.2用SPSS进行Paired-Samples t Test的步骤 SPSS的配对样本t检验要求把两组数据并列排放,例如,EG的数据在一列,CG的在另一列,可手工输入,也可导入xls或者txt文档; 2) 依次点击Analyze Compare Means Paired-Samples T Test; 3) 点击两组数据,使之进入Paired-Variables,点击OK。,3.4.3 SPSS的“帮助”功能SPSS的Help:1)进入Paired-Samples T Test点击Help;2)SPSS上点击“Help”:S
6、tatistics Coach Case StudiesStatistics Coach:Paired-Samples T TestAssumptions:Observations for each pair should be made under the same conditions. The mean differences should be normally distributed. Variances of each variable can be equal or unequal.,Case Studies: 在SPSS的Case Studies的Index的字母p点击Pair
7、ed-Samples T TestOne of the most common experimental designs is the “pre-post“ design. It consists of two measurements taken on the same subject, one before and one after the introduction of a treatment or a stimulus. If the treatment had no effect, the average difference between the measurements is
8、 equal to 0 and the null hypothesis holds; if the treatment did have an effect, the average difference is not 0 and the null hypothesis is rejected.,The Paired-Samples T Test procedure is used to test the hypothesis of no difference between two variables. The data may consist of two measurements tak
9、en on the same subject or one measurement taken on a matched pair of subjects. Additionally, the procedure produces: Descriptive statistics for each test variable The Pearson correlation between each pair and its significance A confidence interval for the average difference (95% or a value you speci
10、fy),Does Diet Make a Difference?A physician is evaluating a new diet for her patients with heart disease. To test the effectiveness of this diet, 16 patients are placed on the diet for 6 months. Their weights and triglyceride (甘油三酯) levels are measured before and after the study, and the physician w
11、ants to know if either set of measurements has changed.(See dietstudy.sav) Running the AnalysisTo begin the analysis, from the menus choose: AnalyzeCompare MeansPaired-Samples T Test Select Triglyceride and Final Triglyceride as the first set of paired variablesSelect Weight and Final Weight as the
12、second pairClick OK.,Paired Test TableThe Sig. (2-tailed) column displays the probability of obtaining a t statistic whose absolute value is equal to or greater than the obtained t statistic. Since the significance value for change in weight is less than 0.05, you can conclude that the average loss
13、of 8.06 pounds per patient is not due to chance variation, and can be attributed to the diet. But the significance value greater than 0.10 for change in triglyceride level shows the diet did not significantly reduce their triglyceride levels.,Pearson Correlations At -0.286, the correlation between t
14、he baseline and 6-month triglyceride levels is not statistically significant. Levels were lower overall, but the change was inconsistent across subjects. Several lowered their levels, but several others either did not change or increased their levels. On the other hand, the Pearson correlation betwe
15、en the baseline and 6-month weight measurements is 0.996, almost a perfect correlation. Unlike the triglyceride levels, all subjects lost weight and did so quite consistently.,Related ProceduresThe paired-samples t test is appropriate whenever two related sample means are to be compared. The differe
16、nce scores are assumed to follow a normal distribution. Before running the t test, you can assess the distribution of difference scores by examining the histogram of a computed difference variable. Test variables with extreme or outlying values should be carefully checked; boxplots can be used for t
17、his.,There are other procedures which you can use to test the assumption of normality. See Exploratory Data Analysis and One-Sample Kolmogorov-Smirnov Procedure for more information 以及本课程第2课。 Use the Runs Test procedure to check the assumption that the value of the test variable is independent of th
18、e order of observation. If you compute the difference between the paired variables, you can alternatively use the One-Sample T Test procedure. If your test variables do not satisfy the assumptions of the paired t test, try the Wilcoxon signed-rank test in the Two-Related-Samples Tests procedure. 本课介绍了配对样本的t检验,多谢浏览。,