turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Confidence intervals of continuous-by-class effect

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-09-2016 06:21 AM

Hi,

I am running a simple linear regression in proc glm:

y = x + a + x*a,

where y is days of sickness absence per year, x is calendar year (treated as a continuous variable) and a a cohort effect (two categories). I would like to know whether the change in y over the time is different for my two cohorts. I have the estimates for my two slopes and so far I am fine. However, I get stuck when I try to get the 95% confidence intervals to go with each of the estimates.

Could someone help me out? Thanks in advance!

Accepted Solutions

Solution

06-17-2016
02:55 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to chrnie

06-16-2016 02:24 PM

Good looking graph, so things seem to be going OK.

The NOTE you referred to really is about the calculation of Rsquared under a no-intercept model, and gets fired in whenever the NOINT option is executed. What should be interesting would be the solution table generated. That should have the intercepts and slope coefficients, now expressed directly rather than as deviations. And with the CLPARM option, you should have 95% confidence limits for them, so there should be no need to manipulate the results from the full factorial model.

Steve Denham

All Replies

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to chrnie

06-09-2016 08:14 AM

Do you have model statement option CLPARM?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to data_null__

06-09-2016 08:18 AM

Yes I do. Sorry for being a bit vague. The question is more about what to do with the output - do I add the confidence limits of the treatment group with those of the reference group in the same way as I did to get the parameter estimate?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to chrnie

06-09-2016 09:11 AM

You need SOLUTION option too because you have CLASS variable. proc glm data=sashelp.class; class sex; model weight=sex age sex*age/solution clparm; run;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Ksharp

06-10-2016 02:46 AM

Thanks! The model that I run looks exactly like the example you posted. This is my output:

How do I go from here to the confidence interval of yr*cohort PsA_K? Do I add -3.81090 and -10.70668 to get the lower confidence limit (and similarly for the upper confidence limit)?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to chrnie

06-10-2016 04:59 AM

No. -10.70668 just is the lower confidence limit of yr*cohort PsA_K .

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to chrnie

06-14-2016 01:25 PM

What do you get if you try fitting the following (with obvious changes to your data):

```
proc glm data=sashelp.class;
class sex;
model weight=sex sex*age/noint solution clparm;
quit;
run;
```

This should give unique and non-biased estimates for the intercepts (sex in this case) and for the separate slopes for each sex, rather than the deviations from the reference level intercept and slope.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

06-16-2016 03:00 AM

Steve: I tried fitting the model according to your suggestion. The log gives me the following note:

NOTE: Due to the presence of CLASS variables, an intercept is implicitly fitted. R-Square has

been corrected for the mean.

I have done some research myself and have realized that, when dealing with interactions, the confidence interval will depend on the level of the covariate (please correct me if I am wrong!). I found this code for proc plm that provides the confidence intervals that I was after (graphically):

**proc** **plm** resore=PsA_K_est;

effectplot slicefit (x=yr sliceby=cohort) / clm;

**run**;

And this is what the result looks like:

Solution

06-17-2016
02:55 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to chrnie

06-16-2016 02:24 PM

Good looking graph, so things seem to be going OK.

The NOTE you referred to really is about the calculation of Rsquared under a no-intercept model, and gets fired in whenever the NOINT option is executed. What should be interesting would be the solution table generated. That should have the intercepts and slope coefficients, now expressed directly rather than as deviations. And with the CLPARM option, you should have 95% confidence limits for them, so there should be no need to manipulate the results from the full factorial model.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

06-17-2016 02:55 AM

You are right. I must have done something wrong when I ran the model yesterday. This is the solution table:

This is what I was after! Thanks a lot!