I use proc surveyreg to conduct regression analyses, but I have several versions of independent variables for robustness. To simplify, I would like to use the dataset, CARs, in sashelp library. Let's assume that &indep1 - &indep3 are variables of interest.
After running the regression, I would like to see three regression results together to assess their robustness. Put differently, I would like to make tables as follows:
model 1 model 2 model 3
weight coff coff coff
wheelbase coff coff coff
length coff coff coff
I know it's very easy in stata, but how can I make the above table easily in SAS? One way I can think of is to get them merged using proc sql after estimating each model, which doesn't sound convenient. It turned out that this way requires more lines than I expected it would. I reasonably believe there is a better, simpler way for this. Thanks!
I'm not quite sure what sort of "table" you wanted for the final. You could either write reports from that data set or possibly transpose if for other comparisons. Since this basic example has 5 "coefficients" I'm not sure what your "table" actually wants.
Note that the Parameter length can vary based on your data and the combining step has a possibility of truncating the name if the later models have variable names that are longer than those in the earlier models. That would require a Length statement prior to the SET in the combining data step to set a default length for the for the variable to contain the longest value.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.