BookmarkSubscribeRSS Feed

[SAS 프로그래밍 고수 백승민] Proc logistic, Genmod와 Proc Nlmixed 비교

Started ‎06-11-2020 by
Modified ‎06-11-2020 by
Views 98

data Remission;
  input remiss cell smear infil li blast temp;
  datalines;
1   .8   .83  .66  1.9  1.1     .996
1   .9   .36  .32  1.4   .74    .992
0   .8   .88  .7    .8   .176   .982
0  1     .87  .87   .7  1.053   .986
1   .9   .75  .68  1.3   .519   .98
0  1     .65  .65   .6   .519   .982
1   .95  .97  .92  1    1.23    .992
0   .95  .87  .83  1.9  1.354  1.02
0  1     .45  .45   .8   .322   .999
0   .95  .36  .34   .5  0      1.038
0   .85  .39  .33   .7   .279   .988
0   .7   .76  .53  1.2   .146   .982
0   .8   .46  .37   .4   .38   1.006
0   .2   .39  .08   .8   .114   .99
0  1     .9   .9   1.1  1.037   .99
1  1     .84  .84  1.9  2.064  1.02
0   .65  .42  .27   .5   .114  1.014
0  1     .75  .75  1    1.322  1.004
0   .5   .44  .22   .6   .114   .99
1  1     .63  .63  1.1  1.072   .986
0  1     .33  .33   .4   .176  1.01
0   .9   .93  .84   .6  1.591  1.02
1  1     .58  .58  1     .531  1.002
0   .95  .32  .3   1.6   .886   .988
1  1     .6   .6   1.7   .964   .99
1  1     .69  .69   .9   .398   .986
0  1     .73  .73   .7   .398   .986
;
run;

proc logistic data = remission;
        model remiss = li;
run;

Proc genmod data=remission;
        model remiss = li/ dist=bin link=logit;
run;
 

proc nlmixed data = remission tech = quanew maxiter = 1000;
        parms b0 = 0.1 b1 = 0.2;
        eta  = b0 + b1 * li;
        prob = exp(eta) / (1 + exp(eta));
        LH   = (prob ** remiss) * ((1 - prob) ** (1 - remiss));
        LL   = log(LH);
        model remiss ~ general(LL);
run;

proc nlmixed data=remission tech = quanew maxiter = 1000;
        parms b0 = 0.1 b1 = 0.2;
        eta=b0 + b1*li /*+ u*/ ;
        expeta=exp(eta);
        p=expeta/(1+expeta);
        model remiss~ binary(p);
run;

Version history
Last update:
‎06-11-2020 05:45 AM
Updated by:
Contributors

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Article Labels
Article Tags