现在的位置: 首页 > 综合 > 正文

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

2018年10月24日 ⁄ 综合 ⁄ 共 4428字 ⁄ 字号 评论关闭

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

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

例子:考察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
  Mean N Std. Deviation Std. Error Mean
Pair 1 Triglyceride 138.44 16 29.04 7.26
Final triglyceride 124.38 16 29.412 7.353
Pair 2 Weight 198.38 16 33.472 8.368
Final weight 190.31 16 33.508 8.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
附:

patid age gender tg0 tg1 tg2 tg3 tg4 wgt0 wgt1
1 45 0 180 148 106 113 100 198 196
2 56 0 139 94 119 75 92 237 233
3 50 0 152 185 86 149 118 233 231
4 46 1 112 145 136 149 82 179 181
5 64 0 156 104 157 79 97 219 217
6 49 1 167 138 88 107 171 169 166
7 63 0 138 132 146 143 132 222 219
8 63 1 160 128 150 118 123 167 167
9 52 0 107 120 129 195 174 199 200
10 45 0 156 103 126 135 92 233 229
11 61 1 94 144 114 114 121 179 181
12 49 1 107 93 156 148 150 158 153
13 61 1 145 107 129 86 159 157 151
14 59 0 186 142 128 122 101 216 213
15 52 0 112 107 103 89 148 257 255
16 60 1 104 103 117 79 130 151 146


抱歉!评论已关闭.