BookmarkSubscribeRSS Feed
rhampton16
Fluorite | Level 6

I've checked through the archives and found some similar questions but none quite what I am confused about, I will try to explain it as clearly as possible. 

 

I am running a model with a continuous variable X, a Categorical variable Y with 3 levels, and a Categorical variable Z with 3 levels in proc mixed with the straightforward model  A = X|Y|Z. I understand how SAS dummy codes the categorical variables and how to estimate the simple slopes within conditions/ use the e option to see which groups get which weights in the estimate, but I am unclear about how these numbers map onto a regression equation in the form of regression weights. 

 

This would be something like A = b0+  b1*X + b2*Y1 + b3*Y2 ... b*Z3 + b8*Y1*Z1 + b9*Y1*Z2 ... b17*Y3*Z8 + e

 

So b1 would be the slope of X averaged across all 9 unique dummy code combinations and then slopes for each unique conditions of Y (b2-b4) and Z (b5-b7) as simple slopes would be...the value you get from the Estimate command?

estimate "name" X 1 X*Y 1 0 0;
estimate "name2" X 1 X*Y 0 1 0;
estimate "name3" X 1 X*Y 0 0 1;

or does the value generated by the estimate command already include b1? So the actual regression weight would be something like "estimate 'name' X 0 X*Y 1 0 0" even though this doesn't actually work in SAS?

 

Similarly for the 3-way interaction, would b9 (for Y1*Z2) be the combination of the estimate at the reference (Y3 and Z3 by default in SAS) + the estimate for Y1 and Z2? Or...?

 

I guess another way to put it would be: For the made up output below, you would have these estimates for X*Y but these are all at the reference group for Z (Z3 by default). If you use the estimate command like above, is the value estimated the same as those below, except instead of being at the reference group, it is averaged across all levels of Z? If yes, that simplifies things a little, but given that the base estimate for X is included in the estimate command (X 1), I wasn't sure if this was the case. 

X            4

X*Y2          -2

X*Y3          2

X*Y1          0

 

2 REPLIES 2
PaigeMiller
Diamond | Level 26

If you add the SOLUTION option to your MODEL statement, you get the exact regression coefficients computed by PROC MIXED. No need to compute these via an ESTIMATE statement.

--
Paige Miller
SteveDenham
Jade | Level 19

I don't think those estimates are not going to give you what you are looking for.. Have you included the SOLUTION option for your MODEL statement? That should have the continuous by categorical slope changes from the overall slope.  From those, you could calculate the individual slope parameter estimates.

So, the ESTIMATE statements you provide look pretty good - the X*Y estimates are the marginal slopes across all levels of Z. In the end, you will need 16 ESTIMATE statements to cover all the possibilities (one for X, three for X*Y, three for X*Z and nine for X*Y*Z).

 

As an aside, I think that if you didn't have a categorical by categorical interaction, you could get all of your slopes from the SOLUTION vector, provided you used the NOINT option in your model statement.

 

SteveDenham

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 318 views
  • 0 likes
  • 3 in conversation