直线回归
一、编程
可用 REG过程:
Proc reg data=data.d7_1;
Model y=x;
Run;
分析结果
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Prob>F
Model 1 3737.41063 3737.41063 60.197 0.0001
Error 8 496.68937 62.08617
C Total 9 4234.10000
Root MSE 7.87948 R-square 0.8827
Dep Mean 154.30000 Adj R-sq 0.8680
C.V,5.10660
分析结果
Parameter Estimates
Parameter Standard T for H0:
Variable DF Estimate Error Parameter=0 Prob > |T|
INTERCEP 1 -17.357456 22.26443147 -0.780 0.4581
(常数项 a)
X 1 0.221894 0.02859949 7.759 0.0001
(回归系数 b)
回归方程,y=-17.357456+0.221894x
结果:
Standardized
Variable DF Estimate
INTERCEP 1 0.00000000
X 1 0.93951745
标准化偏回归系数 --stb选项
残差分析 --P选项
可计算出数据集中每个观察值的预测值及其标准误,并对残
差进行分析,其输出结果为:
Dep Var Predict Std Err
OBS Y Value Predict
1 165.0 164.6 2.823
2 …… …… ……
Sum of Residuals ( 残差和)
Sum of Squared Residuals ( 残差平方和)
Predicted Residual SS (Press) ( 预测值的残差平方和)
预测值均数的 95%可信区间 —clm选项
Dep Var Predict Std Err Lower95% Upper95%
Obs Y Value Predict Mean Mean Residual
1 165.0 164.6 2.823 158.1 171.1 0.4041
2 158.0 155.7 2.498 150.0 161.5 2.2799
3 130.0 142.4 2.925 135.7 149.2 -12.4065
4 180.0 175.0 3.653 166.6 183.4 4.9751
5 134.0 135.7 3.453 127.8 143.7 -1.7496
6 167.0 157.3 2.521 151.5 163.1 9.7266
7 186.0 189.9 5.220 177.9 201.9 -3.8919
8 145.0 133.3 3.678 124.8 141.8 11.6912
9 120.0 124.4 4.586 113.9 135.0 -4.4330
10 158.0 164.6 2.823 158.1 171.1 -6.5959
Sum of Residuals 0
Sum of Squared Residuals 496.6894
Predicted Resid SS (Press) 749.7489
预测值的参考值范围 —cli选项
Dep Var Predict Std Err Lower95% Upper95%
Obs Y Value Predict Predict Predict Residual
1 165.0 164.6 2.823 145.3 183.9 0.4041
2 158.0 155.7 2.498 136.7 174.8 2.2799
3 130.0 142.4 2.925 123.0 161.8 -12.4065
4 180.0 175.0 3.653 155.0 195.1 4.9751
5 134.0 135.7 3.453 115.9 155.6 -1.7496
6 167.0 157.3 2.521 138.2 176.4 9.7266
7 186.0 189.9 5.220 168.1 211.7 -3.8919
8 145.0 133.3 3.678 113.3 153.4 11.6912
9 120.0 124.4 4.586 103.4 145.5 -4.4330
10 158.0 164.6 2.823 145.3 183.9 -6.5959
Sum of Residuals 0
Sum of Squared Residuals 496.6894
Predicted Resid SS (Press) 749.7489
二、交互数据分析
1、交互数据分析 → 选择数据集;
2,Analyze→Fit(y x);
3,选择应变量 y,点击,y”;
选择自变量 x,点击,x”;
4,OK。
三、分析员应用
1、分析员应用 → 选择数据集;
2,Statistics→Regression →Simple… ;
3,选择应变量 y,点击,dependent,;
选择自变量 x,点击,independent”;
4,OK。
多元回归
一、编程
可用 REG过程:
Proc reg data=data.d7_8;
Model y=x1 x2 x3;
Run;
分析结果
Parameter Standard T for H0:
Variable DF Estimate Error Parameter=0 Prob >|T|
INTERCEP 1 -3035.536354 2168.6738473 -1.400 0.2111
X1 1 60.931823 36.29713798 1.679 0.1442
X2 1 37.808334 22.98080891 1.645 0.1510
X3 1 101.379460 121.97470310 0.831 0.4377
筛选自变量的多元回归 —逐步回归
编程:
Proc reg data=data.d7_8;
Model y=x1 x2 x3
/selection=stepwise(逐步回归 )
sle=0.25(入选变量的临界值 )
sls=0.25(剔除变量的临界值 );
Run;
入选和剔除变量的过程
Variable Number
Step Entered Removed In F Prob>F
1 X3 1 9.0643 0.0168
2 X1 2 1.6126 0.2447
3 X2 3 2.7067 0.1510
4 X3 2 0.6908 0.4377
筛选变量的结果
Parameter Standard Type II
Variable Estimate Error Sum of Squares F Prob>F
INTERCEP -4187.42 1630.82 467527.75 6.59 0.0371
X1 80.27 27.24 615945.47 8.69 0.0215
X2 46.45 20.04 381084.71 5.37 0.0535
回归方程,y=-4187.42+80.27x1+46.45x2
二、交互数据分析 (无法筛选变量 )
1、交互数据分析 → 选择数据集;
2,Analyze→Fit(y x);
3,选择应变量 y,点击,y”;
选择自变量 x1,x2,x3,点击,x”;
4,OK。
三、分析员应用
1、分析员应用 → 选择数据集;
2,Statistics→Regression →Linear… ;
3,选择应变量 y,点击,dependent,;
选择自变量 x1,x2,x3,点击,Quantative”;
4,OK。
筛选变量(前三步同前)
4,选择选择变量的方法:
Model→Method→Stepwise selection;
5,选择入选和剔除变量的临界值:
Model→Criteria
To Enter the Model,入选变量的临界值;
To Stay in the Model:剔除变量的临界值;
6,OK。
抛物线回归
一、编程可用 REG过程;
proc reg data=data.d8_2;
model y=x z;
run;
分析结果 —方差分析
Sum of Mean
Source DF Squares Square F Value Prob>F
Model 2 0.09173 0.04587 93.971 0.0004
Error 4 0.00195 0.00049
C Total 6 0.09369
Root MSE 0.02209 R-square 0.9792
Dep Mean 0.57857 Adj R-sq 0.9687
C.V,3.81852
分析结果 —参数估计
Parameter Standard T for H0:
Variable DF Estimate Error Parameter=0 Prob > |T|
INTERCEP 1 -3.817619 0.34127529 -11.186 0.0004
X 1 0.765714 0.05800320 13.201 0.0002
Z 1 -0.032381 0.00241053 -13.433 0.0002
回归方程,y=-3.8176+0.7657x+-0.0324x2
二、交互数据分析
1、交互数据分析 → 选择数据集;
2,Analyze→Fit(y x);
3,选择应变量 y,点击,y”;
选择自变量 x,点击,x”;
选择自变量 x,点击,Expand”,产生变量 x2;
4,OK。
三、分析员应用
1、分析员应用 → 选择数据集;
2,Statistics→Regression →Linear… ;
3,选择应变量 y,点击,dependent,;
选择自变量 x,z,点击,independent”;
4,OK。
Logistic回归
一、编程可用 LOGISTIC过程
proc logistic data=data.d9_1
order=data;
freq count;
model effect=treat;
run;
分析结果 —数据集信息
Data Set,DATA.D9_1
Response Variable,EFFECT
Response Levels,2
Number of Observations,4
Frequency Variable,COUNT
Link Function,Logit
Response Profile
Ordered
Value EFFECT Count
1 1 56
2 0 68
分析结果 —检验结果
Model Fitting Information and
Testing Global Null Hypothesis BETA=0
Intercept
Intercept and
Criterion Only Covariates Chi-Square for Covariates
AIC 172.737 152.361,
SC 175.558 158.001,
-2 LOG L 170.737 148.361 22.377 with 1 DF (p=0.0001)
Score,, 21.709 with 1 DF (p=0.0001)
( 卡方检验:模型存在)
分析结果 —模型的参数估计
Parameter Standard Wald Pr >
Variable DF Estimate Error Chi-Square Chi-Square
INTERCPT 1 -2.8904 0.6390 20.4594 0.0001
TREAT 1 1.7918 0.3979 20.2762 0.0001
模型方程:
专业结论:新法组的有效率与无效率的比值对数与传统组的比
值对数相比,其数量增加 1.7918。
t r e a t 7 9 1 818 9 0 42l o g i t,.)( ???p
分析结果 —标准化回归系数和比数比
Standardized Odds
Variable Estimate Ratio
INTERCPT,,
TREAT 0.495670 6.000
专业结论:新法组的有效率 /无效率的比值是传统法的比值的
6倍。新法的疗效高于传统法。
多个自变量对应变量的影响的大小比较
Standardized Odds
Variable Estimate Ratio
INTERCPT,,
SEX -0.350072 0.279
DEGREE -0.289086 0.348
专业结论:疾病严重程度对疗效的影响大于性别的影响。
二、交互数据分析
1、交互数据分析 → 选择数据集;
2,Analyze→Fit(y x);
3,选择应变量 effect,点击,y”;
选择自变量 treat,点击,x”;
4、选择频数变量 count,点击,Freq”;
5,选择自变量的类型,Method
Response Dist,Binomial,点击,OK”;
6,OK。
三、分析员应用
1、分析员应用 → 选择数据集;
2,Statistics→Regression →Logistic… ;
3,选择应变量 effect,点击,dependent,;
选择自变量 treat,点击,independent”;
4,在 mothed Pr{ }中,点击向下尖头,选择,1”;
三、分析员应用
5,选择频数变量:点击 Variable,进入变量定义界面
选择 count,点击,Frequency”,点击,OK”;
6,选择统计方法,Statistics→ Interval
在 For Conditional Odds Ratios下面的选项中;
选择 Profile Likelihood Limits,点击,OK”;
7,OK。
判别分析
只能用编程的方法,过程名称为 discrim
Proc discrim data=data.d14_1
distance manova listerr;
class group;
Var dbp chol;
Run;
分析结果
GROUP
1 2
CONSTANT -72.49746 -49.25511
DBP 8.41761 7.04324
CHOL 8.18104 6.45716
判别方程:
Z1=-72.49746+8041761DBP+8018104CHOL;
Z2=-49.25511+7.04324DBP+6.45716CHOL;
错判的例数和百分比:
Number of Observations and
Percent Classified into GROUP:
From GROUP 1 2 Total
1 12 3 15
80.00 20.00 100.00
2 3 13 16
18.75 81.25 100.00
Total 15 16 31
Percent 48.39 51.61 100.00
聚类分析
系统聚类法 --cluster
Proc cluster data=data.d14_8
method=centroid
outtree=tree;
Run;
Proc tree;
Run;
分析结果
Number Frequency Normalized
of of New Minimum
Clusters --Clusters Joined-- Cluster Distance Tie
12 OB4 OB7 2 0.104253
11 OB8 OB13 2 0.121561
10 CL11 OB9 3 0.167098
9 OB2 CL12 3 0.208890
8 CL10 OB12 4 0.218037
7 CL9 CL8 7 0.232609
6 OB5 OB6 2 0.240464
5 OB1 CL7 8 0.354330
4 OB3 CL6 3 0.526270
3 CL5 OB10 9 0.705369
2 CL3 CL4 12 0.790813
1 CL2 OB11 13 0.830729
O O O O
O O O O O B O B B O O O B
B B B B B 1 B 1 1 B B B 1
1 2 4 7 8 3 9 2 0 3 5 6 1
1 +
M |
i |
n |
i |XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
m 0.8 +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,
u |XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXX,
m |XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXX,
|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXX,
D |XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXX,
i |XXXXXXXXXX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XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,,,,,
s 0.2 +,XXXXXXXXXXXXX XXXXXXXXXXXXX,,,,,,
t |., XXXXXXX XXXXXXXXXXXXX,,,,,,
e |., XXXXXXX XXXXXXX,,,,,,,
r |., XXXXXXX XXXXXXX,,,,,,,
s |., XXXXXXX,,,,,,,,,
0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0
+--------+--------+--------+--------+--------+--------+--------+--------+--------+
N OB1 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................................
a XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
m OB2 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................
e XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
OB4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.........
o XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
f OB7 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.........
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
O OB8 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...........
b XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
s OB13 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...........
e XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
r OB9 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...............
v XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
a OB12 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................
t XXXXXXXXXXXXX
i OB10 XXXXXXXXXXXXX...............................................................
o XXXXX
n OB3 XXXXXXXXXXXXXXXXXXXXXXXXXXXXX...............................................
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
o OB5 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................
r XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
OB6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................
C X
l OB11 X...........................................................................
一、编程
可用 REG过程:
Proc reg data=data.d7_1;
Model y=x;
Run;
分析结果
Analysis of Variance
Sum of Mean
Source DF Squares Square F Value Prob>F
Model 1 3737.41063 3737.41063 60.197 0.0001
Error 8 496.68937 62.08617
C Total 9 4234.10000
Root MSE 7.87948 R-square 0.8827
Dep Mean 154.30000 Adj R-sq 0.8680
C.V,5.10660
分析结果
Parameter Estimates
Parameter Standard T for H0:
Variable DF Estimate Error Parameter=0 Prob > |T|
INTERCEP 1 -17.357456 22.26443147 -0.780 0.4581
(常数项 a)
X 1 0.221894 0.02859949 7.759 0.0001
(回归系数 b)
回归方程,y=-17.357456+0.221894x
结果:
Standardized
Variable DF Estimate
INTERCEP 1 0.00000000
X 1 0.93951745
标准化偏回归系数 --stb选项
残差分析 --P选项
可计算出数据集中每个观察值的预测值及其标准误,并对残
差进行分析,其输出结果为:
Dep Var Predict Std Err
OBS Y Value Predict
1 165.0 164.6 2.823
2 …… …… ……
Sum of Residuals ( 残差和)
Sum of Squared Residuals ( 残差平方和)
Predicted Residual SS (Press) ( 预测值的残差平方和)
预测值均数的 95%可信区间 —clm选项
Dep Var Predict Std Err Lower95% Upper95%
Obs Y Value Predict Mean Mean Residual
1 165.0 164.6 2.823 158.1 171.1 0.4041
2 158.0 155.7 2.498 150.0 161.5 2.2799
3 130.0 142.4 2.925 135.7 149.2 -12.4065
4 180.0 175.0 3.653 166.6 183.4 4.9751
5 134.0 135.7 3.453 127.8 143.7 -1.7496
6 167.0 157.3 2.521 151.5 163.1 9.7266
7 186.0 189.9 5.220 177.9 201.9 -3.8919
8 145.0 133.3 3.678 124.8 141.8 11.6912
9 120.0 124.4 4.586 113.9 135.0 -4.4330
10 158.0 164.6 2.823 158.1 171.1 -6.5959
Sum of Residuals 0
Sum of Squared Residuals 496.6894
Predicted Resid SS (Press) 749.7489
预测值的参考值范围 —cli选项
Dep Var Predict Std Err Lower95% Upper95%
Obs Y Value Predict Predict Predict Residual
1 165.0 164.6 2.823 145.3 183.9 0.4041
2 158.0 155.7 2.498 136.7 174.8 2.2799
3 130.0 142.4 2.925 123.0 161.8 -12.4065
4 180.0 175.0 3.653 155.0 195.1 4.9751
5 134.0 135.7 3.453 115.9 155.6 -1.7496
6 167.0 157.3 2.521 138.2 176.4 9.7266
7 186.0 189.9 5.220 168.1 211.7 -3.8919
8 145.0 133.3 3.678 113.3 153.4 11.6912
9 120.0 124.4 4.586 103.4 145.5 -4.4330
10 158.0 164.6 2.823 145.3 183.9 -6.5959
Sum of Residuals 0
Sum of Squared Residuals 496.6894
Predicted Resid SS (Press) 749.7489
二、交互数据分析
1、交互数据分析 → 选择数据集;
2,Analyze→Fit(y x);
3,选择应变量 y,点击,y”;
选择自变量 x,点击,x”;
4,OK。
三、分析员应用
1、分析员应用 → 选择数据集;
2,Statistics→Regression →Simple… ;
3,选择应变量 y,点击,dependent,;
选择自变量 x,点击,independent”;
4,OK。
多元回归
一、编程
可用 REG过程:
Proc reg data=data.d7_8;
Model y=x1 x2 x3;
Run;
分析结果
Parameter Standard T for H0:
Variable DF Estimate Error Parameter=0 Prob >|T|
INTERCEP 1 -3035.536354 2168.6738473 -1.400 0.2111
X1 1 60.931823 36.29713798 1.679 0.1442
X2 1 37.808334 22.98080891 1.645 0.1510
X3 1 101.379460 121.97470310 0.831 0.4377
筛选自变量的多元回归 —逐步回归
编程:
Proc reg data=data.d7_8;
Model y=x1 x2 x3
/selection=stepwise(逐步回归 )
sle=0.25(入选变量的临界值 )
sls=0.25(剔除变量的临界值 );
Run;
入选和剔除变量的过程
Variable Number
Step Entered Removed In F Prob>F
1 X3 1 9.0643 0.0168
2 X1 2 1.6126 0.2447
3 X2 3 2.7067 0.1510
4 X3 2 0.6908 0.4377
筛选变量的结果
Parameter Standard Type II
Variable Estimate Error Sum of Squares F Prob>F
INTERCEP -4187.42 1630.82 467527.75 6.59 0.0371
X1 80.27 27.24 615945.47 8.69 0.0215
X2 46.45 20.04 381084.71 5.37 0.0535
回归方程,y=-4187.42+80.27x1+46.45x2
二、交互数据分析 (无法筛选变量 )
1、交互数据分析 → 选择数据集;
2,Analyze→Fit(y x);
3,选择应变量 y,点击,y”;
选择自变量 x1,x2,x3,点击,x”;
4,OK。
三、分析员应用
1、分析员应用 → 选择数据集;
2,Statistics→Regression →Linear… ;
3,选择应变量 y,点击,dependent,;
选择自变量 x1,x2,x3,点击,Quantative”;
4,OK。
筛选变量(前三步同前)
4,选择选择变量的方法:
Model→Method→Stepwise selection;
5,选择入选和剔除变量的临界值:
Model→Criteria
To Enter the Model,入选变量的临界值;
To Stay in the Model:剔除变量的临界值;
6,OK。
抛物线回归
一、编程可用 REG过程;
proc reg data=data.d8_2;
model y=x z;
run;
分析结果 —方差分析
Sum of Mean
Source DF Squares Square F Value Prob>F
Model 2 0.09173 0.04587 93.971 0.0004
Error 4 0.00195 0.00049
C Total 6 0.09369
Root MSE 0.02209 R-square 0.9792
Dep Mean 0.57857 Adj R-sq 0.9687
C.V,3.81852
分析结果 —参数估计
Parameter Standard T for H0:
Variable DF Estimate Error Parameter=0 Prob > |T|
INTERCEP 1 -3.817619 0.34127529 -11.186 0.0004
X 1 0.765714 0.05800320 13.201 0.0002
Z 1 -0.032381 0.00241053 -13.433 0.0002
回归方程,y=-3.8176+0.7657x+-0.0324x2
二、交互数据分析
1、交互数据分析 → 选择数据集;
2,Analyze→Fit(y x);
3,选择应变量 y,点击,y”;
选择自变量 x,点击,x”;
选择自变量 x,点击,Expand”,产生变量 x2;
4,OK。
三、分析员应用
1、分析员应用 → 选择数据集;
2,Statistics→Regression →Linear… ;
3,选择应变量 y,点击,dependent,;
选择自变量 x,z,点击,independent”;
4,OK。
Logistic回归
一、编程可用 LOGISTIC过程
proc logistic data=data.d9_1
order=data;
freq count;
model effect=treat;
run;
分析结果 —数据集信息
Data Set,DATA.D9_1
Response Variable,EFFECT
Response Levels,2
Number of Observations,4
Frequency Variable,COUNT
Link Function,Logit
Response Profile
Ordered
Value EFFECT Count
1 1 56
2 0 68
分析结果 —检验结果
Model Fitting Information and
Testing Global Null Hypothesis BETA=0
Intercept
Intercept and
Criterion Only Covariates Chi-Square for Covariates
AIC 172.737 152.361,
SC 175.558 158.001,
-2 LOG L 170.737 148.361 22.377 with 1 DF (p=0.0001)
Score,, 21.709 with 1 DF (p=0.0001)
( 卡方检验:模型存在)
分析结果 —模型的参数估计
Parameter Standard Wald Pr >
Variable DF Estimate Error Chi-Square Chi-Square
INTERCPT 1 -2.8904 0.6390 20.4594 0.0001
TREAT 1 1.7918 0.3979 20.2762 0.0001
模型方程:
专业结论:新法组的有效率与无效率的比值对数与传统组的比
值对数相比,其数量增加 1.7918。
t r e a t 7 9 1 818 9 0 42l o g i t,.)( ???p
分析结果 —标准化回归系数和比数比
Standardized Odds
Variable Estimate Ratio
INTERCPT,,
TREAT 0.495670 6.000
专业结论:新法组的有效率 /无效率的比值是传统法的比值的
6倍。新法的疗效高于传统法。
多个自变量对应变量的影响的大小比较
Standardized Odds
Variable Estimate Ratio
INTERCPT,,
SEX -0.350072 0.279
DEGREE -0.289086 0.348
专业结论:疾病严重程度对疗效的影响大于性别的影响。
二、交互数据分析
1、交互数据分析 → 选择数据集;
2,Analyze→Fit(y x);
3,选择应变量 effect,点击,y”;
选择自变量 treat,点击,x”;
4、选择频数变量 count,点击,Freq”;
5,选择自变量的类型,Method
Response Dist,Binomial,点击,OK”;
6,OK。
三、分析员应用
1、分析员应用 → 选择数据集;
2,Statistics→Regression →Logistic… ;
3,选择应变量 effect,点击,dependent,;
选择自变量 treat,点击,independent”;
4,在 mothed Pr{ }中,点击向下尖头,选择,1”;
三、分析员应用
5,选择频数变量:点击 Variable,进入变量定义界面
选择 count,点击,Frequency”,点击,OK”;
6,选择统计方法,Statistics→ Interval
在 For Conditional Odds Ratios下面的选项中;
选择 Profile Likelihood Limits,点击,OK”;
7,OK。
判别分析
只能用编程的方法,过程名称为 discrim
Proc discrim data=data.d14_1
distance manova listerr;
class group;
Var dbp chol;
Run;
分析结果
GROUP
1 2
CONSTANT -72.49746 -49.25511
DBP 8.41761 7.04324
CHOL 8.18104 6.45716
判别方程:
Z1=-72.49746+8041761DBP+8018104CHOL;
Z2=-49.25511+7.04324DBP+6.45716CHOL;
错判的例数和百分比:
Number of Observations and
Percent Classified into GROUP:
From GROUP 1 2 Total
1 12 3 15
80.00 20.00 100.00
2 3 13 16
18.75 81.25 100.00
Total 15 16 31
Percent 48.39 51.61 100.00
聚类分析
系统聚类法 --cluster
Proc cluster data=data.d14_8
method=centroid
outtree=tree;
Run;
Proc tree;
Run;
分析结果
Number Frequency Normalized
of of New Minimum
Clusters --Clusters Joined-- Cluster Distance Tie
12 OB4 OB7 2 0.104253
11 OB8 OB13 2 0.121561
10 CL11 OB9 3 0.167098
9 OB2 CL12 3 0.208890
8 CL10 OB12 4 0.218037
7 CL9 CL8 7 0.232609
6 OB5 OB6 2 0.240464
5 OB1 CL7 8 0.354330
4 OB3 CL6 3 0.526270
3 CL5 OB10 9 0.705369
2 CL3 CL4 12 0.790813
1 CL2 OB11 13 0.830729
O O O O
O O O O O B O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e |XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,, XXXXXXX,
t |XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,, XXXXXXX,
w 0.4 +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,, XXXXXXX,
e |XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,, XXXXXXX,
e |XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,, XXXXXXX,
n |,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,, XXXXXXX,
|,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,, XXXXXXX,
C |,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,, XXXXXXX,
l |,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,, XXXXXXX,
u |,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,,,,,
s 0.2 +,XXXXXXXXXXXXX XXXXXXXXXXXXX,,,,,,
t |., XXXXXXX XXXXXXXXXXXXX,,,,,,
e |., XXXXXXX XXXXXXX,,,,,,,
r |., XXXXXXX XXXXXXX,,,,,,,
s |., XXXXXXX,,,,,,,,,
0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0
+--------+--------+--------+--------+--------+--------+--------+--------+--------+
N OB1 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................................
a XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
m OB2 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................
e XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
OB4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.........
o XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
f OB7 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.........
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
O OB8 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...........
b XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
s OB13 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...........
e XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
r OB9 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...............
v XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
a OB12 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................
t XXXXXXXXXXXXX
i OB10 XXXXXXXXXXXXX...............................................................
o XXXXX
n OB3 XXXXXXXXXXXXXXXXXXXXXXXXXXXXX...............................................
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
o OB5 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................
r XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
OB6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................
C X
l OB11 X...........................................................................