资源描述
秩和检验(非参数检验),实习十二,目的要求,掌握利用univariate过程完成配对设计资料的非参数检验;掌握利用npar1way过程及选择项Wilcoxon的使用完成完全随机设计两组、多组资料的秩和检验;熟悉利用freq过程完成随机区组设计资料的秩和检验且能对结果作分析。,非参数统计的适用情况,(1)等级资料;(2)偏态分布;(3)分布不明;(4)个别数据偏离过大;(5)各组方差明显不齐。,非参数统计的优缺点,优点:不受总体分布的限制,适用范围广。缺点:没有充分利用资料提供的信息。检验效能低于参数检验。适用参数检验条件的资料,应首选参数检验。,例1某研究者欲研究保健食品对小鼠抗疲劳作用,将同种属的小鼠按性别和年龄相同、体重相近配成对子,共10对,并将每对中的两只小鼠随机分到保健食品两个不同的剂量组,过一定时期将小鼠杀死,测得其肝糖原含量(mg/100g),结果见下表,问不同剂量组的小鼠肝糖原含量有无差别?,配对资料的秩和检验,dataSAS1;inputx1x2;d=x1-x2;Cards;620.16958.47866.50838.42641.22788.90812.91815.20738.96783.17899.38910.92760.78758.49694.95870.80749.92862.26793.94805.48;,procunivariatenormal;vard;run;,TestsforLocation:Mu0=0Test-Statistic-pValue-Studentstt-2.25916Pr|t|0.0502SignM-3Pr=|M|0.1094SignedRankS-21Pr=|S|0.0313TestsforNormalityTest-Statistic-pValue-Shapiro-WilkW0.843269PrD0.1362Cramer-vonMisesW-Sq0.106441PrW-Sq0.0824Anderson-DarlingA-Sq0.657567PrA-Sq0.0625,符号秩和,单样本秩和检验,dataa;inputnf;cards;2.152.102.202.122.422.522.622.722.993.193.374.57;procunivariatenormalmu0=2.15;varnf;run;,TestsforLocation:Mu0=2.15Test-Statistic-pValue-Studentstt2.898449Pr|t|0.0145SignM3.5Pr=|M|0.0654SignedRankS29.5Pr=|S|0.0059TestsforNormalityTest-Statistic-pValue-Shapiro-WilkW0.837966PrD0.1500Cramer-vonMisesW-Sq0.092826PrW-Sq0.1281Anderson-DarlingA-Sq0.651796PrA-Sq0.0704,例2为比较两种刺激物的对人的影响力的持续时间,现随机抽取13个试验对象接受第一种刺激物,6个试验对象接受第二种刺激物。持续时间如下表,问二种刺激物的持续时间是否有差异?,两独立样本秩和检验,持续时间表(minutes),PROCNPAR1WAY过程格式,PROCNPAR1WAYWilcoxon;CLASS变量;VAR变量表;RUN;,datasas1;doa=1to2;inputn;doj=1ton;inputx;output;end;end;cards;,131.941.942.922.922.922.923.273.273.273.273.703.703.7463.273.273.273.703.703.74;,procsort;排序过程bya;run;procunivariatenormal;考虑各组的正态性varx;bya;run;procnpar1waywilcoxon;classa;varx;exact;输出精确的概率run;,结果,TheNPAR1WAYProcedureWilcoxonScores(RankSums)forVariablexClassifiedbyVariableaSumofExpectedStdDevMeanaNScoresUnderH0UnderH0Score-113110.50130.011.0047848.5002679.5060.011.00478413.250,每组得分和H0成立时的得分和H0成立时的标准差平均得分,Averagescoreswereusedforties.WilcoxonTwo-SampleTestStatistic(S)79.5000NormalApproximationZ1.7265One-SidedPrZ0.0421Two-SidedPr|Z|0.0843tApproximationOne-SidedPrZ0.0507Two-SidedPr|Z|0.1014,T统计量,正态近似法结果(超出表范围时使用),近似t检验结果,ExactTestOne-SidedPr=S0.0527Two-SidedPr=|S-Mean|0.1054,小样本时可通过加exact选项要求输出精确的概率。大样本时可直接采用正态近似的结果。,例3多组独立样本资料的秩和检验,datasasbook;doa=1to4;doj=1to10;inputx;output;end;end;cards;,1.231.141.631.001.352.011.641.131.011.702.590.963.960.231.612.941.963.680.542.592.503.923.330.232.073.902.842.423.723.000.400.512.490.742.592.363.003.313.213.12;procsort;bya;run;,procunivariatenormal;bya;varx;run;procnpar1waywilcoxon;classa;varx;run;,WilcoxonScores(RankSums)forVariablexClassifiedbyVariableaSumofExpectedStdDevMeanaNScoresUnderH0UnderH0Score110130.00205.032.00661013.000210202.50205.032.00661020.250310275.00205.032.00661027.500410212.50205.032.00661021.250,Averagescoreswereusedforties.Kruskal-WallisTestChi-Square7.7513DF3PrChi-Square0.0514,k3,且每组例数均大于5,则此时不能查表,且H值近似服从自由度为k-1的卡方分布。,例4:随机区组设计的秩和检验dataex107;dob=1to8;doa=1to4;inputx;output;end;end;cards;8.49.69.811.711.612.711.812.09.49.110.49.89.88.79.912.08.38.08.68.6,8.69.89.610.68.99.010.611.48.38.28.510.8;procfreq;tablesb*a*x/scores=rankcmh2;/*得到FRIEDMAN统计量*/run;,SummaryStatisticsforabyxControllingforbCochran-Mantel-HaenszelStatistics(BasedonRankScores)StatisticAlternativeHypothesisDFValueProb1NonzeroCorrelation114.13040.00022RowMeanScoresDiffer314.54430.0023TotalSampleSize=32,作业:page204,第4、6、7题,
展开阅读全文