DATA Step, Macro, Functions and more

Macro Problem...

Not applicable
Posts: 1

Macro Problem...

Good Evening All,

For the past thee hours I have been working on a problem that I just can not seem to understand. With no dataset or really any information (such as X and Y values) I am at a loss.

The problem:

Write a macro to fit a multiple regression model where Y is identified as one macro variable, and each X is identified as another macro variable.

There is more to the problem, but once I understand that I feel I can complete the rest.

So far I have been thinking;

% macro exercise(x, y);

%let x = value 1;

%let y = value 2;

The second part of the problem is:

Your macro should do the following:
a. Fit the model.
b. Plot the residuals versus each X.
c. Plot the residuals versus Y.

So from here I'm thinking:

%let x = value 1;

%let y = value 2;

% macro exercise(x, y, proc sgplot data = abc, scatter x=y, y=residual_q);

But I am completely off base here I feel and have no idea what to do.

Super User
Posts: 23,661

Re: Macro Problem...

You are a bit off base, but it also sounds like homework.

See here for some pointers.

Super User
Super User
Posts: 8,068

Re: Macro Problem...

Seems to me that you first need to understand how to perform the requested analysis and produce the proper outputs.  Then you can worry about how to convert it so that it is "macrotized".

Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation