49.057 6 53 52.991 13 47 56.911 18 44

advertisement
49.057
/* This files is stored as blissf1.sas */
56.911 18 44
60.842 28 28
/* Apply the goodness-of-link procedure
64.759 52 11
to the Bliss beetle data using the
logistic link as the baseline.
6 53
52.991 13 47
*/
data set1;
68.691 53
6
72.611 61
1
76.542 60
0
run;
input z y1 y2;
x = log(z);
/* First fit a logistic regression
n = y1+y2;
model */
label y1 = number killed
y2 = number of survivors
proc logistic data=set1;
n = number exposed
model y1/n = x / itprint
x = log-dose;
covb converge=.00001 maxiter=50;
cards;
output out=setr1 p=phat;
run;
1019
/* Evaluate values of derviatives
1020
/* Use the GENMOD procedure to fit
of the family I link function */
the family I model identified
above */
data setr1; set setr1;
w = -1 -log(1-phat)/phat;
proc genmod data=setr1;
run;
a =
0.02;
g =
log((1-_mean_)**(-a) - 1) - log(a);
ginv =
/* Fit the augmented logistic
regression model
1 - (1+a*exp(_xbeta_))**(-1/a);
fwdlink link = g;
*/
invlink ilink = ginv;
make 'Obstats' out=setp2;
proc logistic data=setr1;
model y1/n = x / converge=.00001 covb
model y1/n = x w / itprint covb
dist=binomial itprint
converge=.00001 maxiter=100;
maxit=50 obstats alpha=.05 ;
run;
run;
1021
1022
/* Merge the files containing the mles
/* Use this to produce a postscript plot
of the success probabilities under
in the VINCENT system */
the two models and add the observed
proportions to the file as prob
/* filename graffile pipe 'lpr -Dpostscript';
*/
goptions gsfmode=replace gsfname=graffile
cback=white colors=(black)
data setp2; merge setp2 setr1;
targetdevice=ps300 rotate=landscape;*/
prob = y1/n;
run;
axis1 label = (h=0.45 in r=0 a=90 f=swiss
'Mortality Rate')
proc print data=setp2;
value =(h=0.35 in f=swiss)
run;
length = 6 in
order = 0.0 to 1.0 by 0.2;
/* Use this to create graphs in Windows */
axis2 label = (h=0.45 in f=swiss 'Log-dose')
goptions
cback=white colors=(black)
value=(h=0.35 in f=swiss)
device=WIN target=WINPRTC
length = 6 in
rotate=portrait;
order = 3.8 to 4.4 by 0.1;
1023
1024
/* Evaluate values of derviatives
of the second family of link
functions */
symbol1 v=none i=spline l=1 h=2 w=3;
symbol2 v=circle h=2;
data setr1; set setr1;
symbol3 v=none i=spline l=3 h=2 w=3;
w = (log(phat))/(1-phat);
run;
proc gplot data=setp2;
plot (phat prob pred)*x /
overlay vaxis=axis1 haxis=axis2;
/* Fit the augmented logistic
title ls=1.5 in h=0.6 in f=swiss
regression model
c=black 'Bliss Beetle Data';
*/
title2 h=0.4 in f=swiss c=black
'First Family of Link Functions';
proc logistic data=setr1;
model y1/n = x w / itprint covb
run;
converge=.00001 maxiter=100;
run;
1025
1026
/* Merge the files containing the mles
of the success probabilities under
the two models and add the observed
/* Use the GENMOD procedure to fit
proportions to the file as prob
*/
the model identified above */
data setp3; merge setp3 setr1;
proc genmod data=setr1;
prob = y1/n;
a = 2.59;
run;
g = log((_mean_**a)/(1-_mean_**a));
ginv =
(1+exp(-_xbeta_))**(-1/a);
proc print data=setp3;
fwdlink link = g;
run;
invlink ilink = ginv;
make 'Obstats' out=setp3;
proc gplot data=setp3;
model y1/n = x / converge=.00001 covb
plot (phat prob pred)*x /
dist=binomial itprint
overlay vaxis=axis1 haxis=axis2;
maxit=50 obstats alpha=.05;
title ls=1.5 in h=0.6 in f=swiss
run;
c=black 'Bliss Beetle Data';
title2 h=0.4 in f=swiss c=black
'Second Family of Link Functions';
run;
1027
1028
Maximum Likelihood Iteration History
Bliss Beetle Data
The LOGISTIC Procedure
Iter
Ridge
-2 Log L
Intercept
Model Information
0
0
645.441025
0.426299
x
0
1
0
395.941537
-39.615600
9.694171
WORK.SET1
2
0
374.092238
-54.667149
13.394642
Response Variable (Events)
y1
3
0
372.484917
-60.122455
14.736966
Response Variable (Trials)
n
4
0
372.470133
-60.711104
14.881848
8
5
0
372.470132
-60.717199
14.883348
Link Function
Logit
6
0
372.470132
-60.717199
14.883348
Optimization Technique
Fisher's scoring
Data Set
Number of Observations
Last Change in -2 Log L
-5.68434E-14
Response Profile
Last Evaluation of Gradient
Ordered
Value
Binary
Outcome
Total
Intercept
Frequency
-4.04121E-14
1
Event
291
2
Nonevent
190
x
-1.6622E-13
Convergence criterion (XCONV=0.00001) satisfied.
1029
1030
Analysis of Maximum Likelihood Estimates
Data Set
WORK.SETR1
Distribution
Standard
Parameter
DF
Estimate
Error
Binomial
Link Function
Pr > ChiSq
User
Response Variable (Events)
y1
Response Variable (Trials)
n
Intercept
1
-60.7172
5.1806
<.0001
Observations Used
x
1
14.8833
1.2647
<.0001
Number Of Events
291
8
Number Of Trials
481
Parameter Information
Parameter
Analysis of Maximum Likelihood Estimates
for the augmented model
Standard
Effect
Prm1
Intercept
Prm2
x
Iteration History For Parameter Estimates
Parameter
DF
Estimate
Error
Pr > ChiSq
Intercept
1
-25.9558
12.6884
0.0408
Iter
x
1
6.1258
3.1898
0.0548
0
0
-182.35937
-39.57241
9.5770409
w
1
1.6638
0.6187
0.0072
1
0
-182.34847
-40.03738
9.6885242
2
0
-182.34847
-40.04117
9.6894431
3
0
-182.34847
-40.04117
9.6894431
Log
1031
DF
Value
Value/DF
Deviance
6
3.4584
0.5764
Scaled Deviance
6
3.4584
0.5764
Pearson Chi-Square
6
3.3045
0.5507
Scaled Pearson X2
6
3.3045
0.5507
Log Likelihood
-182.3485
Analysis Of Parameter Estimates
Standard
Parameter
DF
Estimate
Error
Wald 95%
Confidence Limits
Intercept
1
-40.0412
3.2738
-46.458
-33.625
x
1
9.6894
0.7898
8.141
11.238
Scale
0
1.0000
0.0000
1.000
1.000
1033
Likelihood
Prm1
Prm2
1032
Criteria For Assessing Goodness Of Fit
Criterion
Ridge
Download