I am using proc GLM with dummy variables coding for different groups and a continuous variable. Then, I can get coeffcients and CI for all variables and interactions.
I then compute group-specific intercept and slopes for the 0-group as follows:
intercept + ca t0
cont + cont*cat 0
How then can I get the corresponding CI?
Example:
data tmp; input cont cat outcome; datalines; 1.1 0 0.8 1.5 0 0.6 2.1 0 0.6 5.1 0 0.2 2.1 1 0.9 1.1 1 0.7 1.4 1 0.8 4.7 1 0.3 ; run; proc glm data=tmp; class cat; model outcome = cont | cat / solution clparm; run;
Parameter | Estimate | Standard Error | t Value | Pr > |t| | 95% Confidence | Limits |
Intercept | 0.989189 | 0.128196 | 7.72 | 0.0015 | 0.633259 | 1.34512 |
cont | -0.13514 | 0.04707 | -2.87 | 0.0454 | -0.26582 | -0.00445 |
cat 0 | -0.10905 | 0.178144 | -0.61 | 0.5735 | -0.60366 | 0.385561 |
cat 1 | 0 | . | . | . | . | . |
cont*cat 0 | 0.000383 | 0.06342 | 0.01 | 0.9955 | -0.1757 | 0.176466 |
cont*cat 1 | 0 | . | . | . | . | . |
Okay, then you need to re-parameterize the model so that each of these terms of interest is an individual term in the model.
model outcome = cat cont*cat / solution clparm;
The group specific slopes are the cont*cat terms. The group specific intercepts are the cat term.
These are essentially the confidence intervals for predicted values.
So you need to add the desired levels of conc and cat to your dataset, with missing values for outcome, and then the OUTPUT statement data set will contain the desired confidence intervals.
I am afraid predicted values CI are not what I am looking for.
To be more precise, let's assume my model is as follows:
outcome = b0 + b1 * group + (b2 + b3*group) * x
with "group" being a binary variabe.
I am looking for the CIs of the group-specific intercept (b0 + b1*group) and the group-specific slopes (b2 + b3*group) with no regard to the value of x.
Okay, then you need to re-parameterize the model so that each of these terms of interest is an individual term in the model.
model outcome = cat cont*cat / solution clparm;
The group specific slopes are the cont*cat terms. The group specific intercepts are the cat term.
I accepted the answer a bit fast (because I am mainly interested in the slopes).
Your solution works for slopes, but the intercept still have to be added to "cat".
Is there a workaround for that?
Output:
Intercept | 0.9891891892 | 0.12819646 | 7.72 | 0.0015 | 0.6332587543 | 1.3451196241 |
cat 0 | -.1090473452 | 0.17814433 | -0.61 | 0.5735 | -.6036552868 | 0.3855605963 |
cat 1 | 0.0000000000 | . | . | . | . | . |
cont*cat 0 | -.1347517730 | 0.04250296 | -3.17 | 0.0338 | -.2527589074 | -.0167446387 |
cont*cat 1 | -.1351351351 | 0.04707033 | -2.87 | 0.0454 | -.2658233265 | -.0044469437 |
Add the NOINT option into the MODEL statement.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.