BookmarkSubscribeRSS Feed
Sanchit
Fluorite | Level 6

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

4 REPLIES 4
Reeza
Super User

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

PGStats
Opal | Level 21

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

PG
Merlin
Calcite | Level 5
I am want to know in which case we need macro language when doing regression ? Or Another preditif analysis
PaigeMiller
Diamond | Level 26

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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1285 views
  • 0 likes
  • 5 in conversation