UCLA Academic Technology Services HomeServicesClassesContactJobs
Search

SAS Code Fragments
Running Logistic Regression with a Labeled Outcome Variable

 
data test;
  input drunk x;
cards;
1 0
1 3
1 5
0 3
0 4
0 2
;
run;

proc logistic data=test descending;
  model drunk = x;
run;
* NOTE THAT WHEN "drunk" is labeled, the results get reversed!!! ;
proc format ;
  value drunklab 0="not drunk" 1="drunk";
run;
 
data test2;
  set test;
  format drunk drunklab.;
run;

proc logistic data=test2 descending  ;
  model drunk = x;
run;
* NOTE USING order=internal makes SAS use numbers as basis for ordering ;
proc logistic data=test2 descending  order=internal  ;
  model drunk = x;
run;

 

How to cite this page

Report an error on this page

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California