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

hello,

please how write Logistic regression without specifying the variable selection method ?

thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

Which of the variables are not continuous?  Put those in a class statement and add /PARAM=GLM after the variable list.  Add /SOLUTION to the MODEL statement.

You should then get a Type 3 table of tests for the variables. In particular, there will be a test for the main effect of FLAG_CRISE_SYSTEMIQUE.  I hope this makes sense.  If not, please post your code and any part of the log that outlines ERRORs or WARNINGs.

 

SteveDenham

View solution in original post

5 REPLIES 5
ballardw
Super User

List the variables you want on the model statement.

 

Dummy example code:

 

model result = variable1 variable2 variable3 ;

 

ks94
Obsidian | Level 7

Thanks for your answer. Between my variables ;there are numeric and character variables ,so when i try this :

 

PROC logistic data=africa descending ;

model FLAG_CRISE_SYSTEMIQUE(event="1")=FLAG_CRISE_SYSTEMIQUE
TAUX_CHANGE_USD TOTAL_DETTE_PIB TAUX_INFLATION
FLAG_CRISE_INFLATION FLAG_DETTE_INTERIEURE
PAYS FLAG_DETTE_EXTERIEURE
FLAG_INDEPENDANCE FLAG_CRISE_MONETAIRE FLAG_CRISE_BANCAIRE;
run;

 

I've an error message , which required numeric variable or i must specified in the CLASS statement.

But my purpose is that I want to use this method to recognize my significant variables between the differents variables... my target variable is  FLAG_CRISE_SYSTEMIQUE.

I hope you understand my problem ?

ks94
Obsidian | Level 7

thank 

i found the solution to my problem with the code bellow:

proc logistic data=africa;
class FLAG_DETTE_INTERIEURE(param=ref ref='1') FLAG_DETTE_EXTERIEURE(param=ref ref='1') FLAG_INDEPENDANCE(param=ref ref='1') FLAG_CRISE_MONETAIRE(param=ref ref='1') FLAG_CRISE_INFLATION(param=ref ref='1');
model FLAG_CRISE_SYSTEMIQUE(event="1") = ANNEE TAUX_CHANGE_USD TOTAL_DETTE_PIB TAUX_INFLATION FLAG_DETTE_INTERIEURE FLAG_DETTE_EXTERIEURE FLAG_INDEPENDANCE FLAG_CRISE_MONETAIRE FLAG_CRISE_INFLATION;
run;

the variables which are Pr>khi-2 <0.05 are my significant variables. 

SteveDenham
Jade | Level 19

Which of the variables are not continuous?  Put those in a class statement and add /PARAM=GLM after the variable list.  Add /SOLUTION to the MODEL statement.

You should then get a Type 3 table of tests for the variables. In particular, there will be a test for the main effect of FLAG_CRISE_SYSTEMIQUE.  I hope this makes sense.  If not, please post your code and any part of the log that outlines ERRORs or WARNINGs.

 

SteveDenham

SteveDenham
Jade | Level 19
I guess I was a bit late in my suggestion. You seem to have solved the problem.

SteveDenham

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 5 replies
  • 846 views
  • 2 likes
  • 3 in conversation