比较配对设计的SPSS与SAS实现

    技术2022-05-13  17

    配对设计主要研究某种实验处理前后的对比状况,来判定该种处理是否有效。该种方法能够有效地控制非实验因素对结果的影响。

    需要注意的是实验前后的结果不是独立的,就是说实验前的状况对实验后的结果是有影响的。统计学上通常会通过差值来消除这种影响,也可以考虑进行两独立样本的检验。这里分别用两种软件实现第一种方法。

    例子:考察16个病人服药前后的weights和triglyceride levels,具体数据见附件。

    1.SPSS

    Analyze-Compare Means-Paired Samples T test,然后选择配对变量

    2.SAS(UNIVARIATE语句详解参考:http://543484067.qzone.qq.com/blog/1294717032)

    将数据导入SAS后进行如下操作

    data y;   set a;   tg=tg0-tg4;   wgt=wgt0-wgt4;run;proc univariate data=y normal;var tg wgt;run;

    下面我们看看两种结果的比较:   


    Paired Samples Statistics MeanNStd. DeviationStd. Error MeanPair 1Triglyceride138.441629.047.26Final triglyceride124.381629.4127.353Pair 2Weight198.381633.4728.368Final weight190.311633.5088.377

     

     

    Paired Samples Test

     

     

    Paired Differences

     

     

     

     

     

    Mean

    Std. Deviation

    Std. Error Mean

    Pair 1

    Triglyceride - Final triglyceride

    14.063

    46.875

    11.719

    Pair 2

    Weight - Final weight

    8.063

    2.886

    .722

     

    Paired Samples Test

     

     

    Paired Differences

     

     

    95% Confidence Interval of the Difference

     

     

    Lower

    Upper

    Pair 1

    Triglyceride - Final triglyceride

    -10.915

    39.040

    Pair 2

    Weight - Final weight

    6.525

    9.600

     

    Paired Samples Test

     

     

     

     

     

     

     

     

    t

    df

    Sig. (2-tailed)

    Pair 1

    Triglyceride - Final triglyceride

    1.200

    15

    .249

    Pair 2

    Weight - Final weight

    11.175

    15

    .000

     

    SAS结果(部分):

          变量:   tg

                                                                  矩

                                        N                     16               权重总和                16                                    均值             14.0625           观测总和               225                                    标准差        46.8749667       方差             2197.2625                                    偏度          -0.0645782         峰度            -1.1826074                                    未校平方和         36123         校正平方和      32958.9375                                    变异系数      333.333096      标准误差均值    11.7187417

                                                             基本统计测度

                                                   位置                    变异性

                                             均值     14.06250     标准差         46.87497                                         中位数   18.00000     方差               2197                                         众数       .                  极差          152.00000                                                                        四分位极差     79.50000

                                                            位置检验: Mu0=0

                                              检验      --统计量---    -------P 值-------

                                              学生 t    t  1.200001    Pr > |t|    0.2487                                          符号      M         1          Pr >= |M|   0.8036                                          符号秩    S        23        Pr >= |S|   0.2522

     

              变量:   wgt

                                                                  矩

                                        N                     16                          权重总和                16                                    均值              8.0625                      观测总和               129                                    标准差        2.88602957                 方差            8.32916667                                    偏度          0.72763584                   峰度             -0.479326                                    未校平方和           1165                    校正平方和        124.9375                                    变异系数      35.7957156                标准误差均值    0.72150739

                                                             基本统计测度

                                                   位置                    变异性

                                             均值     8.062500      标准差          2.88603                                         中位数   7.000000      方差            8.32917                                         众数     6.000000       极差           10.00000                                                                       四分位极差      4.50000

                                                            位置检验: Mu0=0

                                              检验      --统计量---    -------P 值-------

                                              学生 t    t  11.17452    Pr > |t|    <.0001                                          符号      M         8          Pr >= |M|   <.0001                                          符号秩    S        68         Pr >= |S|   <.0001附:

    patidagegendertg0tg1tg2tg3tg4wgt0wgt1145018014810611310019819625601399411975922372333500152185861491182332314461112145136149821791815640156104157799721921764911671388810717116916676301381321461431322222198631160128150118123167167952010712012919517419920010450156103126135922332291161194144114114121179181124911079315614815015815313611145107129861591571511459018614212812210121621315520112107103891482572551660110410311779130151146



    最新回复(0)