DATA Step, Macro, Functions and more

Linear Regression : Macro Basics

Reply
Occasional Contributor
Posts: 9

Linear Regression : Macro Basics

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

Super User
Posts: 23,694

Re: Linear Regression : Macro Basics

What's your question? Please detail your question and show what you've tried and the issues your having.  

Esteemed Advisor
Posts: 5,523

Re: Linear Regression : Macro Basics

Make the regression work as plain SAS code. Then it is a simple matter to transform it into a macro.

PG
Occasional Learner
Posts: 1

Re: Linear Regression : Macro Basics

I am want to know in which case we need macro language when doing regression ? Or Another preditif analysis
Respected Advisor
Posts: 2,996

Re: Linear Regression : Macro Basics

[ Edited ]

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.

--
Paige Miller
Ask a Question
Discussion stats
  • 4 replies
  • 419 views
  • 0 likes
  • 5 in conversation