BookmarkSubscribeRSS Feed
PSB
Fluorite | Level 6 PSB
Fluorite | Level 6

Hi all. 

I'm interested in analyzing how different affective traits predict behaviors during time-out (in the context of a treatment program) using GEE in SAS.

- I have 49 youth, and my outcome is an overdispersed count variable with a negative binomial distribution. I also want to account for nesting of 3 levels: time-outs are nested within time [i.e., treatment week], and time is nested within child (ID).

- It is an unbalanced dataset, such that some kids got 30 time-outs while others only got 1 or 2.

- I've included # of timeouts within day as an offset term to account for the fact that youth with 1 time-out in a day are diff than youth with 4 time-outs in a day.

- I'm also interested in various interactions but haven't included them yet because I want to ensure that my model is correct.

 

Here's my syntax so far with centered (c) predictors:

Title "Model 1";

PROC GENMOD DATA = data.dataset;

CLASS ID cweek;

MODEL Behavior = meds age cx1 cx2 cx3 cweek /

dist = negbin link = log offset = timeout_withindaycount;

REPEATED SUBJECT = ID(cweek) / type = exch;

RUN;

 

My repeated line is probably wrong, as my time variable isn't a categorical variable but produces individual effects for all 8 weeks. However, I'm unsure how to properly include nesting across the 3 levels if time isn't on the CLASS statement. Any feedback on where I've gone wrong would be great. Sorry for the elementary questions. 

Thanks!

1 REPLY 1
StatDave
SAS Super FREQ

I assume that your response variable, behavior, is a count of some particular behavior type that a kid might exhibit. First, note that the GEE model that GENMOD fits is not a multi-level model (and I should note that the newer PROC GEE is generally the recommended procedure to use for fitting GEE models). The SUBJECT= effect simply designates which observations are considered correlated (in whatever way as controlled by the TYPE= option) - observations with the same value of the SUBJECT= effect are considered correlated; observations with different values are considered uncorrelated. In your case, it sounds like you would consider all observations within a kid to be correlated, so, assuming that each kid has a unique value of the ID variable, you would just specify SUBJECT=ID. Next, when you include an offset in a log-linked model, then you are trying to model the log of a rate - the rate being the count of some event over some exposure size or population size. To do that, the OFFSET= variable should be the log of the denominator of the rate - that is, the log of the exposure or population size. It should not be just the size. And I will note that the GEE model itself is a way of dealing with overdispersion as mentioned in this note. So, it might not be worthwhile to try to use the negative binomial distribution instead of the Poisson distribution since the negative binomial model is much more prone to fitting problems.

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
  • 1 reply
  • 423 views
  • 1 like
  • 2 in conversation