A macro to run a simple linear regression with dependent and independent variables as macro parameters.
Dataset: sashelp.cars
Dependent variable =msrp; Independent variables = enginesize, cylinders, horsepower
What's your question? Please detail your question and show what you've tried and the issues your having.
Make the regression work as plain SAS code. Then it is a simple matter to transform it into a macro.
In general you don't need macros to do regression.
You need macros when you want your code to be dynamic and do different things in different situations.
SUGGESTION to @Merlin: you get much better answers, and quicker answers, if you avoid these extremely succinct problem statements, and actually take the time to explain your question, and why you think there are situations where macros might be needed.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.