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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1271 views
  • 0 likes
  • 5 in conversation