- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello all,
I have the following proc reg macro that I would like to output the regression parameters into data sets, but I cannot get it to work. The following code works:
%macro regA(dat, port);
proc reg data = &dat;
model &port = A B C D E;
restrict B = 0;
run;
%mend regA;
%regA(a3, core);
However, when I add the following statement (which I use all the time) after the restrict statement:
outest out = regA_&port
I get an error.
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It doesn't go in the RESTRICT statement, it goes in PROC REG
It's OUTEST and not OUTSET
If you type PROC REG DATA=&dat OUTEST=regA_&port you will get an error if the value of &port doesn't product a valid SAS data set name.
So what error do you get? Show us the relevant part of the SASLOG.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, the OUTEST was a typo. I have fixed it in the original post.
Here is the code that I am using:
%macro regA(dat, port) ;
proc reg data = &dat;
model &port =A B C D E;
restrict B = 0;
outest out = regA_&port;
run;
%mend regA;
And here is the error that I am receiving:
NOTE: The previous statement has been deleted.
ERROR 180-322: Statement is not valid or it is used out of proper order.
And I tried to put the outest statement in the top line along with the proc reg statement, but then my restrict statement didn't work?
the sas dataset name is allowable.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The relevant part of the SASLOG includes not only the error message, but some meaningful portion of the code in the SASLOG.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Update: I think that I got the output statement to work with the following code:
%macro regA(dat, port);
proc reg data = &dat outest = regA_&port;
model &port = A B C D E;
restrict B = 0;
run;
quit;
%mend regA;
But now it is only outputting the regression coefficients into the output dataset and not any of the statistics information like the tstat or the pvalue.
Am I using the wrong output statement!?
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You need the TABLEOUT option in the PROC REG statement.
Paige Miller