Hi! I'm wondering if there is an option to include in the Proc Logistic preocedure that would output the number of observations used for each variable?
for example, if i am using gender as an independent variable, can I add something to the procedure that would output # males and # female observations in addition to all the statistical output?
Thanks!
You will easily get some useful information (means, frequencies) in proc logistic with option SIMPLE.
proc logistic data=sashelp.heart simple;
class sex smoking_status;
model status = sex smoking_status weight;
run;
every table can be captured with ODS OUTPUT.
Not AFAIK, in general, I run a proc freq/means ahead of time to get a table of characteristics.
Here's one way to get several proc freq results into a nice table at once:
https://gist.github.com/statgeek/e0903d269d4a71316a4e
/*This code is an example of how to generate a table with
Variable Name, Variable Value, Frequency, Percent, Cumulative Freq and Cum Pct
No macro's are required
Use Proc Freq to generate the list, list variables in a table statement if only specific variables are desired
Use ODS Table to capture the output and then format the output into a printable table.
*/
*Run frequency for tables;
ods table onewayfreqs=temp;
proc freq data=sashelp.class;
table sex age;
run;
*Format output;
data want;
length variable $32. variable_value $50.;
set temp;
Variable=scan(table, 2);
Variable_Value=strip(trim(vvaluex(variable)));
keep variable variable_value frequency percent cum:;
label variable='Variable'
variable_value='Variable Value';
run;
*Display;
proc print data=want(obs=20) label;
run;
You will easily get some useful information (means, frequencies) in proc logistic with option SIMPLE.
proc logistic data=sashelp.heart simple;
class sex smoking_status;
model status = sex smoking_status weight;
run;
every table can be captured with ODS OUTPUT.
Learn something new every day 😉
So do I
Mostly from you two
Steve Denham
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!
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.