- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I am very new to SAS and am currently trying to translate some Stata code, including a regression. I am able to successfully get the same coefficients in the output but I haven't been able to save them. This is the code I am using:
proc glm;
absorb ID;
model kw = i txi / solution noint;
run;
quit;
I haven't been able to use the OUTPUT command (it says this can not be used with absorb) and OUTSTAT doesn't contain the coefficients. OUTEST doesn't seem to work with Proc glm either. I just need to save the coefficients since I'll be running this multiple times on large datasets.
Any help would be greatly appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You can output the coefficients using the ODS capabilities. See the ODS Output section of the SAS documentation for your version of PROC GLM. In 12.1, the table is named ParameterEstimates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@Doc_Duke wrote:
You can output the coefficients using the ODS capabilities. See the ODS Output section of the SAS documentation for your version of PROC GLM. In 12.1, the table is named ParameterEstimates.
When you use ABSORB, you cannot get coefficients for the main effects in the ABSORB statement — you can't get these coefficients via ODS or in some output destination like HTML. Why? Because SAS doesn't compute them. (You can get coefficients for other terms in the model, just not the coefficients for terms in the ABSORB statement).
This is a tradeoff you make when you choose ABSORB, the model is computed faster and uses less memory, but as a result you can't get coefficients for the ABSORBed variables.
According to the documentation at: https://documentation.sas.com/?cdcId=pgmmvacdc&cdcVersion=9.4&docsetId=statug&docsetTarget=statug_gl...
For a main-effect variable that does not participate in interactions, you can absorb the effect by naming it in an ABSORB statement. This means that the effect can be adjusted out before the construction and solution of the rest of the model. This is particularly useful when the effect has a large number of levels.
Note: When you use the ABSORB statement, the data set (or each BY group, if a BY statement appears) must be sorted by the variables in the ABSORB statement. The GLM procedure cannot produce predicted values or least squares means (LS-means) or create an output data set of diagnostic values if an ABSORB statement is used.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
ods trace on; proc glm data=sashelp.class; class sex; model weight=sex height; ods output FitStatistics=want1 OverallANOVA=want2; run; ods trace off;
Ksharp
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Check out ods output table names. For instance, HOVFTest is for Homogeneity of variance ANOVA