turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- Base SAS Programming
- /
- Macro Problem...

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

12-14-2012 07:16 PM

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.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Dart246

12-14-2012 11:26 PM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Dart246

12-14-2012 11:40 PM

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".