proc surveyreg data=basu2 ;
class DR;
by sic;
model NI = R DR DR_R / clb solution;
run;Hi all!
I can obtain parameter estimates for each group by sic as seen in the above code.
The reason why I got them is to use these parameters in another regression's independent variables. To do so, I need to put them in my data set again and merge this set to another data file and do the final regression I want.
Well.. I found how to put parmest into dataset when using PRCO REG but PROC SURVEYREG... that does not work.
ods output ParameterEstimates = parms;
proc reg data=sashelp.baseball;
model logsalary = nHits nBB YrMajor / clb;
quit;
proc print data=parms noobs;
run;I have tried sth similar like the above. but even code color does not turn up to blue or navy, meaning it is not a valid code... I need to use surveryreg instead of just reg as I have a dummy variable and the data is a panel.
I thank you again your help very much again!
@JKCho wrote:
proc surveyreg data=basu2 ; class DR; by sic; model NI = R DR DR_R / clb solution; run;Hi all!
I can obtain parameter estimates for each group by sic as seen in the above code.
The reason why I got them is to use these parameters in another regression's independent variables. To do so, I need to put them in my data set again and merge this set to another data file and do the final regression I want.
Well.. I found how to put parmest into dataset when using PRCO REG but PROC SURVEYREG... that does not work.
ods output ParameterEstimates = parms; proc reg data=sashelp.baseball; model logsalary = nHits nBB YrMajor / clb; quit; proc print data=parms noobs; run;I have tried sth similar like the above. but even code color does not turn up to blue or navy, meaning it is not a valid code... I need to use surveryreg instead of just reg as I have a dummy variable and the data is a panel.
I thank you again your help very much again!
Do NOT trust the editor code highlighting to tell you whether code is valid or not.
Did you actually run something like:
ods output ParameterEstimates = surveyparms; proc surveyreg data=basu2 ; class DR; by sic; model NI = R DR DR_R / clb solution; run;
If that does not create an output data set then show us the log.
ODS TRACE ON; will show you in the log what output objects with what names a procedure creates.
Here's some instructions and explanations on how to capture output that is shown.
https://blogs.sas.com/content/sastraining/2017/03/31/capturing-output-from-any-procedure-with-an-ods...
@JKCho wrote:
proc surveyreg data=basu2 ; class DR; by sic; model NI = R DR DR_R / clb solution; run;Hi all!
I can obtain parameter estimates for each group by sic as seen in the above code.
The reason why I got them is to use these parameters in another regression's independent variables. To do so, I need to put them in my data set again and merge this set to another data file and do the final regression I want.
Well.. I found how to put parmest into dataset when using PRCO REG but PROC SURVEYREG... that does not work.
ods output ParameterEstimates = parms; proc reg data=sashelp.baseball; model logsalary = nHits nBB YrMajor / clb; quit; proc print data=parms noobs; run;I have tried sth similar like the above. but even code color does not turn up to blue or navy, meaning it is not a valid code... I need to use surveryreg instead of just reg as I have a dummy variable and the data is a panel.
I thank you again your help very much again!
@JKCho wrote:
proc surveyreg data=basu2 ; class DR; by sic; model NI = R DR DR_R / clb solution; run;Hi all!
I can obtain parameter estimates for each group by sic as seen in the above code.
The reason why I got them is to use these parameters in another regression's independent variables. To do so, I need to put them in my data set again and merge this set to another data file and do the final regression I want.
Well.. I found how to put parmest into dataset when using PRCO REG but PROC SURVEYREG... that does not work.
ods output ParameterEstimates = parms; proc reg data=sashelp.baseball; model logsalary = nHits nBB YrMajor / clb; quit; proc print data=parms noobs; run;I have tried sth similar like the above. but even code color does not turn up to blue or navy, meaning it is not a valid code... I need to use surveryreg instead of just reg as I have a dummy variable and the data is a panel.
I thank you again your help very much again!
Do NOT trust the editor code highlighting to tell you whether code is valid or not.
Did you actually run something like:
ods output ParameterEstimates = surveyparms; proc surveyreg data=basu2 ; class DR; by sic; model NI = R DR DR_R / clb solution; run;
If that does not create an output data set then show us the log.
@JKCho wrote:
I have tried similar codes you suggested and tried some codes again.
ods output ParameterEstimates = surveyparms;
proc surveyreg data=basu2 ;
class DR;
by sic;
model NI = R DR DR_R / solution;
run;
This is the code works with NO clb.
That might be the reason and, as usual, sas code does not work by a small difference.
Just because an option, such as CLB is valid for one procedure, such as REG, does not mean that it is valid in another procedure.
I would expect that the LOG showed an error that CLB was not a valid option for the Surveyreg Model statement.
Which is why we say "Read the LOG" and POST the log as well as "Read the documentation".
Using options without knowing what they do or if they are valid is a poor way to program in any language, not just SAS.
A CAT command in Unix means something quite different than a CAT command on an HP3000 or the CAT function in a SAS data step.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.