mohsinm Tracker
https://communities.sas.com/kntur85557/tracker
mohsinm TrackerMon, 20 May 2024 05:50:23 GMT2024-05-20T05:50:23ZRe: Macro error while performing logistic regression of each independent variable against Target var
https://communities.sas.com/t5/SAS-Data-Science/Macro-error-while-performing-logistic-regression-of-each/m-p/912161#M10710
<P><a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892">@PaigeMiller</a> but it is given for linear regression and not for logistic regression. In the comment also complete solution is not given. Thanks.</P>Fri, 19 Jan 2024 11:52:06 GMThttps://communities.sas.com/t5/SAS-Data-Science/Macro-error-while-performing-logistic-regression-of-each/m-p/912161#M10710mohsinm2024-01-19T11:52:06ZMacro error while performing logistic regression of each independent variable against Target variabl
https://communities.sas.com/t5/SAS-Data-Science/Macro-error-while-performing-logistic-regression-of-each/m-p/910466#M10689
<P>Hi all,</P><P> </P><P>I have a list of multiple independent variables. I want to run a logistic regression model of each independent variable against an dependent variable and the same process should be repeated for each independent variable against the same target variable and the output statistics should be saved in a dataset.</P><P> </P><P>I am using SAS Viya 3.5 version.</P><P> </P><P>However, while running the code mentioned in the last, it is showing the following error.</P><P> </P><P><SPAN>ERROR: The %DO statement is not valid in open code.</SPAN></P><P><SPAN>ERROR: The %end statement is not valid in open code.</SPAN></P><P> </P><P><SPAN>Is there any other way through which I can get the similar output?</SPAN></P><P> </P><P><SPAN>Thanks.</SPAN></P><P> </P><P> </P><P>%let dependent_variable = Cholesterol_Status;</P><P>%let independent_variables = AgeAtStart Smoking_Status;</P><P> </P><P> </P><P>%let variable_list = %scan(&independent_variables, 1);</P><P>%let i = 1;</P><P> </P><P>%do %while (%length(%scan(&independent_variables, &i)) > 0);</P><P> </P><P> </P><P> %let current_variable = %scan(&independent_variables, &i);</P><P> </P><P> </P><P> proc logistic data=mycaslib.mydata;</P><P> model &dependent_variable = &current_variable;</P><P> score data=mycaslib.mydata out=out_rstore;</P><P> run;</P><P> </P><P> </P><P> %let i = %eval(&i + 1);</P><P> </P><P>%end;</P><P> </P>Thu, 04 Jan 2024 15:13:47 GMThttps://communities.sas.com/t5/SAS-Data-Science/Macro-error-while-performing-logistic-regression-of-each/m-p/910466#M10689mohsinm2024-01-04T15:13:47Z