01-16-2017 04:05 PM
I have a binary outcome, with 1="Yes" and 2="No". Can I run logistic regression with the given formatting? Or, do I need to convert the values to 1="Yes" and 0="No", especially when I am interested in probability of "Yes"?
01-16-2017 04:19 PM
You can run PROC LOGISTIC on the data you have. The response variable can be numeric or character, and it can have a format or not.
By default, the procedure will model the lower value of the (formatted) response variable, but you can use the (EVENT='value') option to override. For example, the following sets the formatted value of the response, thus overriding the default:
proc format; value YorN 1="Yes" 2="No"; run; data a; set sashelp.class; if sex="M" then Y=1; else Y=2; format Y YorN.; run; proc logistic data=a; model y(event="Yes") = height weight; run;
01-17-2017 02:35 PM
Thanks! But, if the procedure models lower value by default, then shouldn't the default model in your example be the one with event="Yes" (as it has the value of 1)? My understanding so far is that the default model will be on the greater value. Or am I missing something?
01-17-2017 02:54 PM
I wrote a working program. Run it. Then change the syntax and rerun it. Experiment. That's how you will learn.
I think you will discover that since "No" comes before "Yes" in alphabetical order, the default for the formatted response is "No".
If you remove the format, the default response will be the smaller numerical value.