1 / 19

Proc Logistic

Proc Logistic. Without specification, SAS models the first value of dependent variable as the “event”, in this case, y=0. proc logistic data = a.chd2018_a plots = none ; model chd =age; run ;.

mariaray
Download Presentation

Proc Logistic

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Proc Logistic

  2. Without specification, SAS models the first value of dependent variable as the “event”, in this case, y=0. • proclogisticdata= a.chd2018_a plots=none; • modelchd=age; • run;

  3. Without specification, SAS models the first value of dependent variable as the “event”, in this case, y=“Developed Chd”. procfreqdata=s5238.chd2018; tableschd*age; run; proclogisticdata= s5238.chd2018 plots=none; modelchd=age; run;

  4. Explicitly specify event value • proclogisticdata=a.chd2018_a plots=none; • modelchd(event="1")=age; • run;

  5. Explicitly specify event value proclogisticdata= s5238.chd2018 plots=none; modelchd(event="Developed Chd")=age; run;

  6. The descending option, in this case, the second value is modeled (y=1). proclogisticdata=a.chd2018_a plots=nonedescending; modelchd=age; run;

  7. Scoring new data. datato_predict; do age=25to50; output; end; run; proclogisticdata=a.chd2018_a noprint; modelchd(event="1")=age; scoredata=to_predictout=tmplog; run; procprintdata=tmplog; run;

  8. Scoring the data set used – the out= option • proclogisticdata=a.chd2018_a noprint; • modelchd(event="1")=age; • scoreout=tmplog; • run; • procprintdata=tmplog; • run;

  9. Create a data set with estimated coefficients proclogisticdata=a.chd2018_a outest=betas noprint; modelchd(event="1")=age; run; procprintdata=betas; run;

  10. Create a file of estimated parameters using ODS. odsoutputparameterestimates=betas; odsselectparameterestimates; proclogisticdata=a.chd2018_a; modelchd(event="1")=age; run; procprintdata=betas; run;

  11. Create a file of estimated parameters using ODS.By group processing. procsortdata=a.chd2018_a out=tmp; by male; run; odsoutputparameterestimates=betas; odsselectparameterestimates; proclogisticdata=tmp; by male; modelchd(event="1")=age; run; procprintdata=betas; run;

  12. Add covariance matrix to output. proclogisticdata=a.chd2018_a outest=betas covout; modelchd(event="1")=age; run; procprintdata=betas; format age 12.10; run;

  13. Display covariance matrix. proclogisticdata=a.chd2018_a; modelchd(event="1")=age/covb; run;

  14. Examine ODS output files. odstraceon; proclogisticdata=a.chd2018_a; modelchd(event="1")=age; run; odstraceoff;

  15. Put fit statistics into a file odsoutputfitstatistics=likelihood; odsselectfitstatistics; proclogisticdata=a.chd2018_a; modelchd(event="1")=age; run; procprintdata=likelihood; run;

  16. Specify plots. proclogisticdata=a.chd2018_a plots=effect; modelchd(event="Developed Chd")=age; run;

  17. The freq statement procfreqdata=a.chd2018_a noprint; tables age*chd/out=chdagecnt; run; procprintdata=chdagecnt; run; proclogisticdata=chdagecnt; modelchd(event="Developed Chd")=age; freq count; run;

  18. Create a binomial version of the data. Each observation is the number of observations and the number of events. procsql; createtable positives as selectage,count(*) as n1 from a.chd2018_a wherechd= 1 groupby age ; createtable counts as selectage,count(*) as n from a.chd2018_a groupby age ; createtable binary as select a.age,n1,n from positives a,counts b wherea.age=b.age ; select * from binary; quit;

  19. odsselectparameterestimates; proclogisticdata=a.chd2018_a; modelchd(event="1")=age; run; odsselectparameterestimates; proclogisticdata=binary; model n1/n=age; run;

More Related