BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
smar
Fluorite | Level 6

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;
ParameterEstimateStandard Errort ValuePr > |t|95% ConfidenceLimits
Intercept0.9891890.1281967.720.00150.6332591.34512
cont-0.135140.04707-2.870.0454-0.26582-0.00445
cat 0-0.109050.178144-0.610.5735-0.603660.385561
cat 10.....
cont*cat 00.0003830.063420.010.9955-0.17570.176466
cont*cat 10.....

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
smar
Fluorite | Level 6

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.

PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
smar
Fluorite | Level 6

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:


Intercept0.98918918920.128196467.720.00150.63325875431.3451196241
cat 0-.10904734520.17814433-0.610.5735-.60365528680.3855605963
cat 10.0000000000.....
cont*cat 0-.13475177300.04250296-3.170.0338-.2527589074-.0167446387
cont*cat 1-.13513513510.04707033-2.870.0454-.2658233265-.0044469437
PaigeMiller
Diamond | Level 26

Add the NOINT option into the MODEL statement.

--
Paige Miller

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 5 replies
  • 978 views
  • 2 likes
  • 2 in conversation