BookmarkSubscribeRSS Feed
gaurav21s
Calcite | Level 5

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;

______________________________________________________________

3 REPLIES 3
Reeza
Super User

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?

gaurav21s
Calcite | Level 5

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
Tom
Super User Tom
Super User

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1487 views
  • 0 likes
  • 3 in conversation