I am writing a macro to create customized reports by combining output from Proc GLM ODS tables (ParameterEstimates and ModelANOVA). The report needs to accommodate not only varying numbers of main effects, but also interactions of varying orders. Processing is conditional based on effect labels for each model term, which are extracted from the ODS datasets.
I realize that the Proc GLM option NAMELEN= can be used to specify the length of effect names in tables and output datasets (default=20); however, in no SAS manuals, online FAQs, or other documentation have I found a description of the algorithm used by SAS to abbreviate variable names into effect labels of the specified length. For main effect terms, the effect labels appear to be a simple truncation of the variable name if it exceeds the specified length. For interactions, though, effect labels do not appear to be simple, equal truncations of the constituent variable names; but it is not obvious what algorithm is being using to abbreviate the constituent variable names, joined by '*'s, into effect labels.
This seems like such a simple problem that I must be overlooking something obvious. Any thoughts or insights would be greatly appreciated!
~ Richard
I don't know the answer to your question. But if you set NAMELEN=200, and even in the case where you have variables with 32 character names, you can accomodate 5-way interactions before the truncation happens, that ought to suffice for most situations.
So the problem is in the report layouts and not GLM?
You could run GLM with NAMELEN=200 so you can unambiguously determine what GLM is doing, and then do the truncation yourself before the report, it's all under your control.
You need to provide more information to get help for us to understand why this is an issue. Sample code illustrating the issue would likely help here.
@rafaldow wrote:
The macro initially generates a set of verbose effect labels based on full variable names expressed in the GLM model statement, along with positioning codes that describe where in the report they should be placed. It tries to then emulate SAS's abbreviated effect labels to match with the abbreviated effect labels in the SAS ODS output datasets in order to extract the associated values (parameter estimates, SEs, test statistics, pvals). The abbreviated effect labels and an extensively reformatted set of statistical values are then added to the body of the report in appropriate places (designated by the positioning codes). A comprehensive list of verbose effect descriptions and abbreviated effect names are added at the end of the report, but the abbreviated effect names are still needed in the body of the report.
So, given the above, I still really have no idea what the problem is that you want to solve. It seems to keep changing. I agree with @Reeza , you need to show us sample code, plus you need to show us the output from GLM you are working with, and you need to show us what you want as a final table.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.