Hello community,
I would like to know how I could bring in the following formats for the variable "ATTRACTL" into my model output, so that the labels indicated by the formats can be seen in the model output...
"bothstatusNew" is a four level variable, I'm attempting simple multinomial regression with this code.
Or is it easiest to change the numeric level coding into character form coding using a data step and length statement for the predictor variable?
Thank you. Here I provide an example code:
Data psw.NewVar6;
set psw.NewVar5;
proc format;
value ATTRACTL
0 = 'Only Male'
1='Male and Female'
2= 'Only Female'
3= 'None'
;
run;
proc freq Data=psw.NewVar6;
tables ATTRACTL;
format ATTRACTL ATTRACTL.;
run;
proc logistic data = psw.NewVar6;
class ATTRACTL;
model bothstatusNEW = ATTRACTL;
run;
Sorry forgot to add bothstatusNEW to the class statement in the model code. This is the correction:
proc logistic data = psw.NewVar6;
class bothstatusNEW ATTRACTL;
model bothstatusNEW = ATTRACTL;
run;
Sorry forgot to add bothstatusNEW to the class statement in the model code. This is the correction:
proc logistic data = psw.NewVar6;
class bothstatusNEW ATTRACTL;
model bothstatusNEW = ATTRACTL;
run;
Add the same format statement to the proc logistic code.
Format is one of those statements that are available in almost every proc that displays or manipulates data without an explicit entry in the syntax.
A big advantage to the format approach is that if you want to see the results for a different grouping of values is to create a new format and apply that in the code instead of having to go back to a data step and add a new variable.
Such as:
proc format;
value ATTRACTLALt
0,2 = 'Only Male or Only Female'
1='Male and Female'
3= 'None'
;
run;
So do I place my format code within the model statement before the run command and after the model statement for example?
Scratch that, thank you Ballard I believe I understand what your are saying thank you for your response!!!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.