BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
PaigeMiller
Diamond | Level 26

You can't use an asterisk in a CLASS statement. 

 

In the future, please click on the {i} icon and paste your SASLOG into the window that appears.

I stated originally that I want correlation between variables and I still do. I thought Proc Corr/GLM/REG would give me that. That's why I was trying to use them. But someone on another thread stated that Proc Logistic would work for both continuous and categorical variables, so if I can just use that, that would work I believe? I don't need to fit the model or anything I believe.

 

Unfortunately, I still believe that this is not a good approach, in my opinion you DO need a model, you don't want correlations. Why? Because a model treats your Y variable (presence or absence of the disease) as the response. Correlations do not treat the presence or absence of the disease as the response.

 

But ... whether to use a model or not ... whether to use correlations ... that's your decision, not mine. 

 

Finally, let's clear things up once and for all, PROC LOGISTIC works with class Y variables, and continuous or class X variables. So, it would seem to fit your situation, except you still state you don't want a model, and PROC LOGISTIC gives you a model. And it has to have a Y variable and one or more X variables.

--
Paige Miller
Reeza
Super User

If you don't need a model, why are you running a model?

 

I really really feel you need to consult a statistician here because you're not sure what you're doing and you're definitely not quite understanding the appropriate analysis techniques. Or ask a teacher, colleague or supervisor for some assistance. Or read a journal article that does this and see how they do the analysis and present the data. The typical approach is formulate a hypothesis, do univariate analysis, then do multivariate analysis.

 


@hpatel3 wrote:

@PaigeMiller @Reeza

 

After going back and reviewing, I don't think Proc reg or corr would give me the best results. I stated originally that I want correlation between variables and I still do. I thought Proc Corr/GLM/REG would give me that. That's why I was trying to use them. But someone on another thread stated that Proc Logistic would work for both continuous and categorical variables, so if I can just use that, that would work I believe? I don't need to fit the model or anything I believe.

 

So TO SEE IF THERE IS A CORRELATION between my risk factors and whether they develop the disease, I tried this:

 

libname Hetal "\\tuftsmc\home\hpatel3\SAS Datasets";
run; 



proc logistic data=hetal.es_regre;
class age_diag EF_reg Hx_Sync FHX_ES FHX_SD LBBB AF_prior * Hx_Sync FHX_ES FHX_SD LBBB AF_prior;
model adv_hf (event="1")= age_diag EF_REG Hx_sync FHX_ES FHX_SD LBBB AF_prior;
run;

 

 

 

However got this error:

 

SAS error.PNG

 

 

 

 

I'm not sure exactly what should be done based on this error. Is asking me to clarify numeric or character variables??? I'm not sure how to write this out in my code.

 

My class statement is: all variables * categorical variables <-- That is what I was supposed to do, correct?

 

And my model statement is: disease status variable = all variables  <--is this correct as well?

 

Thanks!


 

 

 

 

Reeza
Super User

and their correlation with disease status (Variable ADV_HF): 1= they have the disease / 0 or blank = they don't have it.

 

I interpreted this as the outcome, or Y variable, which is binary to me. I believe you're correct with the OP not understanding what they want to do though.

 


@PaigeMiller wrote:

As I stated, you seem to have reversed X and Y. Logistic regression is what you use with binary Y.

 

But, the whole issue remains unclear as to what the original poster really wants to achieve, and so I think until he clarifies the situation, I'm going to pause here. On the one hand he wants correlation but on the other hand he was talking about fitting a model with PROC REG or PROC GLM.


 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 17 replies
  • 3755 views
  • 1 like
  • 3 in conversation