Programming the statistical procedures from SAS

Proc Logistic output to create a dataset as shown in the tab 2 of the excel attached

Reply
Occasional Contributor
Posts: 5

Proc Logistic output to create a dataset as shown in the tab 2 of the excel attached

In the excel attached, For the 1st tab - 'Step 1" I have figured out the code via external assistanceto get the desired output but what I don't get is the way to run the logistic proc on the original data set to get the desired output as shown in the 2nd tab of the excel attached. ( exactly same format and columns). The proc logistic will include only those independent variables which have a mean > 0.02

_________________Step 1_______________________________________

proc summary data=Experiment ;

  var _numeric_;

  output out=means (drop=_type_ _freq_);

run;

proc transpose data=means out=vertical;

  id _Stat_;

run;

proc sql ;

  select _name_ into :varlist separated by ' '

  from vertical

  where mean > 0.02

    ;

quit;

%put varlist=&varlist;


_________________Step 2_______________________________________

PROC LOGISTIC DATA=?? descending;

MODEL detractor = ?? ;

RUN;

______________________________________________________________

Super User
Posts: 18,528

Re: Proc Logistic output to create a dataset as shown in the tab 2 of the excel attached

proc logistic won't give that to you by default. You'll need to manipulate the files it does provide yourself.


EDIT:

Actually, its just a sort, but if you can write the logistic code then someone can help with obtaining the output.

Do you know the logistic code to write?

Occasional Contributor
Posts: 5

Re: Proc Logistic output to create a dataset as shown in the tab 2 of the excel attached

Well, since I will be writing the code for 'proc log' for the first time, I may not be sure about the accuracy but I will try out Tom's suggestion and see how it works. My ultimate aim is to achieve a 'data set' through 'proc log' output as given below.:

Binary VariablesCoeffSEWSSigOdds Ratio
I1.030.1360.7312.8
H0.790.1917.630.952.21
A0.570.1415.7411.77
K0.980.191.160.972.67
Q1.060.2419.7212.89
L1.160.2326.320.993.2
E0.870.299.050.962.38
X-1.020.1277.340.980.36
M0.70.2210.570.982.01
Super User
Super User
Posts: 6,687

Re: Proc Logistic output to create a dataset as shown in the tab 2 of the excel attached

I assume that the first ?? should be replaced with Experiment since that is the dataset you used in the previous step.

The second ?? you would want to replace with &VARLIST so that the list of variables you calculated in the first step is used.

You might need to add code to the SQL query to eliminate your dependent variable from VARLIST.

As to making the output look at the manual for PROC LOGISITIC and see what output datasets it can make. You can also look turn on ODS trace to see which of the printed outputs can be directed to datasets.

Ask a Question
Discussion stats
  • 3 replies
  • 242 views
  • 0 likes
  • 3 in conversation