Desktop productivity for business analysts and programmers

questions about the logistic regression

Reply
Contributor
Posts: 20

questions about the logistic regression

I am using the sas enterprise guide to analyze the relationship between three numerical variables(explanatory ones) and one binary variable(response one), while by using the logistic regression, all the result shows these three variables having the same p value and intercept and standard error, so I do not know why this goes wrong?

Community Manager
Posts: 3,466

Re: questions about the logistic regression

Any chance that you can share some of your data, and the MODEL code that you're generated using the Logistic Regression task?

Contributor
Posts: 20

Re: questions about the logistic regression

Posted in reply to ChrisHemedinger

PROC SQL;
CREATE VIEW WORK.SORTTempTableSorted AS
SELECT *
FROM WORK.QUERY_FOR_TELCODATA_EXTRACT_0002
;
QUIT;
TITLE;
TITLE1 "Logistic Regression Results";
FOOTNOTE;
FOOTNOTE1 "Generated by the SAS System (&_SASSERVERNAME, &SYSSCPL) on %TRIM(%QSYSFUNC(DATE(), NLDATE20.)) at %TRIM(%SYSFUNC(TIME(), TIMEAMPM12.))";
PROC LOGISTIC DATA=WORK.SORTTempTableSorted
PLOTS(ONLY)=NONE
;
MODEL churn (Event = '0')= /
SELECTION=NONE
INFLUENCE
LINK=LOGIT
;

OUTPUT OUT=BIGDATA.PREDLOGREGPREDICTIONS(LABEL="Logistic regression predictions and statistics for WORK.QUERY_FOR_TELCODATA_EXTRACT_0002")
PREDPROBS=INDIVIDUAL
UPPER=upper_churn
LOWER=lower_churn ;
RUN;
QUIT;

/* -------------------------------------------------------------------
End of task code
------------------------------------------------------------------- */
RUN; QUIT;
%_eg_conditional_dropds(WORK.SORTTempTableSorted);
TITLE; FOOTNOTE;
ODS GRAPHICS OFF;

 

 

 

 

 

and the target variable is churn. the value is 0,1.

For the explanatory variables, they are income(just the normal money),and other charges.But the separate logistic regression for these three, Analysis of Maximum Likelihood for estimate. standard error and chi are the same. I do not know where goes wrong.



Super User
Posts: 24,026

Re: questions about the logistic regression

There’s no variables in your model statement?

Did you add variables to your model?

Contributor
Posts: 20

Re: questions about the logistic regression

Thanks for your reply.

Yes, I used the automatic function of SAS enterprise guide, the task----regression---logistic regression, than select the dependent variable and independent variable. while the result for three x is all the same.

Community Manager
Posts: 3,466

Re: questions about the logistic regression

You might need to visit the Model->Effects page and add those vars as main effects.  This will add them to your MODEL statement.  There are also many options to nest/combine these effects if you need to analyze those.

 

Should result in code like:

 

	MODEL __RESPONSE=Horsepower MPG_City MPG_Highway		/
		SELECTION=NONE
		LINK=LOGIT

[Disclaimer: not a statistician -- just familiar with this how these task options work Smiley Wink ]

Contributor
Posts: 20

Re: questions about the logistic regression

Posted in reply to ChrisHemedinger

Thanks a lot for your reply.

MODEL Churn=household_income		/
		SELECTION=NONE
		LINK=LOGIT

This is the new code, while it can not work. I can not find the reason. 

Super User
Posts: 13,947

Re: questions about the logistic regression

"It can not work" is awful vague.

Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.

No output? Post any log in a code box.

Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

Ask a Question
Discussion stats
  • 7 replies
  • 171 views
  • 4 likes
  • 4 in conversation