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.
You are a bit off base, but it also sounds like homework.
See here for some pointers.
http://www.ats.ucla.edu/stat/sas/seminars/sas_macros_introduction/default.htm
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".
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.