Discussion:
Logistic, Genmod, and Repeated Measures
(too old to reply)
Bruce A.
2008-09-18 17:10:05 UTC
Permalink
Hi all,

I'm trying to analyze a dataset with repeated observations on the same
subject with a dependent variable which is dichotomous. So I used PROC
GENMOD with the repeated statement. However, when I compare that to the
output when I use PROC LOGISTIC (which ignores dependency) I get the same
estimates, the same confidence intervals of those estimates, and therefore
I get the same p-hat values.

Shouldn't I get different answers? Am I using PROC GENMOD wrong? Am I
going crazy?

These are the two codes I used:

proc logistic data = drunks descending;
title "Using Logistic Regression ";
model accident = age vision drivers_ed / stb aggregate scale=none
link=logit;
output out = logistic_fit predprobs=(i);
run;

proc genmod data = drunks descending;
title "Using Genmod type = ind";
class case period;
model accident = age vision drivers_ed / dist=bin link = logit;
repeated subject = case / within=period type =unstr;
output out = genmod_fit_i p=phat;
run;

the dataset looked something like:
case accident age vision drivers_ed period
1 1 17 1 1 1
2 0 44 0 0 1
3 0 35 0 1 1
.
45 0 20 0 1 1
1 1 18 1 1 2
2 1 45 0 0 2
3 0 36 0 1 2
.
45 1 21 0 1 2

Thanks to anyone who has an idea!!!
Cheers,
Bruce A.
Peter Flom
2008-09-18 17:28:48 UTC
Permalink
Post by Bruce A.
I'm trying to analyze a dataset with repeated observations on the same
subject with a dependent variable which is dichotomous. So I used PROC
GENMOD with the repeated statement. However, when I compare that to the
output when I use PROC LOGISTIC (which ignores dependency) I get the same
estimates, the same confidence intervals of those estimates, and therefore
I get the same p-hat values.
Shouldn't I get different answers? Am I using PROC GENMOD wrong? Am I
going crazy?
Not sure about your genmod code, but I think you should be using PROC GLIMMIX

Peter

Peter L. Flom, PhD
Statistical Consultant
www DOT peterflom DOT com
Robin R High
2008-09-18 18:10:56 UTC
Permalink
Bruce,

Whether GENMOD or GLIMMIX is more appropriate here is not obvious, though
from GENMOD be sure you are looking at the table:

Analysis Of GEE Parameter Estimates
Empirical Standard Error Estimates

for the GEE analysis.

GENMOD also prints the Analysis Of Initial Parameter Estimates table,
which at the first iteration is the same as LOGISTIC.

Also, add the corrw option to the REPEATED statement in GENMOD, just to
see what the within case correlation of period is; if its close to 0, the
results would likely be nearly the same.

Robin High
UNMC





"Bruce A." <***@YAHOO.COM>
Sent by: "SAS(r) Discussion" <SAS-***@LISTSERV.UGA.EDU>
09/18/2008 12:18 PM
Please respond to
"Bruce A." <***@YAHOO.COM>


To
SAS-***@LISTSERV.UGA.EDU
cc

Subject
Logistic, Genmod, and Repeated Measures






Hi all,

I'm trying to analyze a dataset with repeated observations on the same
subject with a dependent variable which is dichotomous. So I used PROC
GENMOD with the repeated statement. However, when I compare that to the
output when I use PROC LOGISTIC (which ignores dependency) I get the same
estimates, the same confidence intervals of those estimates, and therefore
I get the same p-hat values.

Shouldn't I get different answers? Am I using PROC GENMOD wrong? Am I
going crazy?

These are the two codes I used:

proc logistic data = drunks descending;
title "Using Logistic Regression ";
model accident = age vision drivers_ed / stb aggregate scale=none
link=logit;
output out = logistic_fit predprobs=(i);
run;

proc genmod data = drunks descending;
title "Using Genmod type = ind";
class case period;
model accident = age vision drivers_ed / dist=bin link = logit;
repeated subject = case / within=period type =unstr;
output out = genmod_fit_i p=phat;
run;

the dataset looked something like:
case accident age vision drivers_ed period
1 1 17 1 1 1
2 0 44 0 0 1
3 0 35 0 1 1
.
45 0 20 0 1 1
1 1 18 1 1 2
2 1 45 0 0 2
3 0 36 0 1 2
.
45 1 21 0 1 2

Thanks to anyone who has an idea!!!
Cheers,
Bruce A.
Wensui Liu
2008-09-19 03:25:46 UTC
Permalink
peter,

i have to disagree with you and see no point to use glimmix. where is the
random effectin bruce's model?

On Thu, Sep 18, 2008 at 1:28 PM, Peter Flom <
Post by Peter Flom
Post by Bruce A.
I'm trying to analyze a dataset with repeated observations on the same
subject with a dependent variable which is dichotomous. So I used PROC
GENMOD with the repeated statement. However, when I compare that to the
output when I use PROC LOGISTIC (which ignores dependency) I get the same
estimates, the same confidence intervals of those estimates, and therefore
I get the same p-hat values.
Shouldn't I get different answers? Am I using PROC GENMOD wrong? Am I
going crazy?
Not sure about your genmod code, but I think you should be using PROC
GLIMMIX
Peter
Peter L. Flom, PhD
Statistical Consultant
www DOT peterflom DOT com
--
===============================
WenSui Liu
Acquisition Risk, Chase
Email : ***@chase.com
Blog : statcompute.spaces.live.com
===============================
Dale McLerran
2008-09-19 05:08:54 UTC
Permalink
Well, subject looks like a random effect. Whether to use GLIMMIX
or GENMOD (or NLMIXED!) has more to do with whether a marginal
interpretation is desired or whether a conditional interpretation
is desired. That is, do we want to make statements about average
effects in a population or about effects that might be observed
for an individual in some population.

If you want a population average interpretation, then you want
to use GENMOD. If you want a subject-specific interpretation,
then you want to fit a random effects model.

Dale

---------------------------------------
Dale McLerran
Fred Hutchinson Cancer Research Center
mailto: ***@NO_SPAMfhcrc.org
Ph: (206) 667-2926
Fax: (206) 667-5977
---------------------------------------
Subject: Re: Logistic, Genmod, and Repeated Measures
Date: Thursday, September 18, 2008, 8:25 PM
peter,
i have to disagree with you and see no point to use
glimmix. where is the
random effectin bruce's model?
On Thu, Sep 18, 2008 at 1:28 PM, Peter Flom <
Post by Peter Flom
Post by Bruce A.
I'm trying to analyze a dataset with repeated
observations on the same
Post by Peter Flom
Post by Bruce A.
subject with a dependent variable which is
dichotomous. So I used PROC
Post by Peter Flom
Post by Bruce A.
GENMOD with the repeated statement. However, when
I compare that to the
Post by Peter Flom
Post by Bruce A.
output when I use PROC LOGISTIC (which ignores
dependency) I get the same
Post by Peter Flom
Post by Bruce A.
estimates, the same confidence intervals of those
estimates, and therefore
Post by Peter Flom
Post by Bruce A.
I get the same p-hat values.
Shouldn't I get different answers? Am I using
PROC GENMOD wrong? Am I
Post by Peter Flom
Post by Bruce A.
going crazy?
Not sure about your genmod code, but I think you
should be using PROC
Post by Peter Flom
GLIMMIX
Peter
Peter L. Flom, PhD
Statistical Consultant
www DOT peterflom DOT com
--
===============================
WenSui Liu
Acquisition Risk, Chase
Blog : statcompute.spaces.live.com
===============================
Wensui Liu
2008-09-19 05:39:43 UTC
Permalink
well, dale, are you suggesting a repeated measure has to be a mixed model
with random effect?
Post by Dale McLerran
Well, subject looks like a random effect. Whether to use GLIMMIX
or GENMOD (or NLMIXED!) has more to do with whether a marginal
interpretation is desired or whether a conditional interpretation
is desired. That is, do we want to make statements about average
effects in a population or about effects that might be observed
for an individual in some population.
If you want a population average interpretation, then you want
to use GENMOD. If you want a subject-specific interpretation,
then you want to fit a random effects model.
Dale
---------------------------------------
Dale McLerran
Fred Hutchinson Cancer Research Center
Ph: (206) 667-2926
Fax: (206) 667-5977
---------------------------------------
Subject: Re: Logistic, Genmod, and Repeated Measures
Date: Thursday, September 18, 2008, 8:25 PM
peter,
i have to disagree with you and see no point to use
glimmix. where is the
random effectin bruce's model?
On Thu, Sep 18, 2008 at 1:28 PM, Peter Flom <
Post by Peter Flom
Post by Bruce A.
I'm trying to analyze a dataset with repeated
observations on the same
Post by Peter Flom
Post by Bruce A.
subject with a dependent variable which is
dichotomous. So I used PROC
Post by Peter Flom
Post by Bruce A.
GENMOD with the repeated statement. However, when
I compare that to the
Post by Peter Flom
Post by Bruce A.
output when I use PROC LOGISTIC (which ignores
dependency) I get the same
Post by Peter Flom
Post by Bruce A.
estimates, the same confidence intervals of those
estimates, and therefore
Post by Peter Flom
Post by Bruce A.
I get the same p-hat values.
Shouldn't I get different answers? Am I using
PROC GENMOD wrong? Am I
Post by Peter Flom
Post by Bruce A.
going crazy?
Not sure about your genmod code, but I think you
should be using PROC
Post by Peter Flom
GLIMMIX
Peter
Peter L. Flom, PhD
Statistical Consultant
www DOT peterflom DOT com
--
===============================
WenSui Liu
Acquisition Risk, Chase
Blog : statcompute.spaces.live.com
===============================
--
===============================
WenSui Liu
Acquisition Risk, Chase
Email : ***@chase.com
Blog : statcompute.spaces.live.com
===============================
Dale McLerran
2008-09-19 07:15:07 UTC
Permalink
Correlated measures that arise from repeated sampling from a
single subject conform to a random effects model. Whether one
conditions on those random effects in the analysis or whether
one averages over the random effects has more to do with the
interpretation that one wants to make.

Still, I would note that one can obtain a population average
(GEE-type marginal) interpretation after first fitting a
subject-specific (conditional/random-effect) model. All that
is necessary in that instance is to average over the random
effects. However, if one fits a population average model, it
is not possible to recover a subject-specific interpretation.

Dale

---------------------------------------
Dale McLerran
Fred Hutchinson Cancer Research Center
mailto: ***@NO_SPAMfhcrc.org
Ph: (206) 667-2926
Fax: (206) 667-5977
---------------------------------------
Subject: Re: Logistic, Genmod, and Repeated Measures
Date: Thursday, September 18, 2008, 10:39 PM
well, dale, are you suggesting a repeated measure has to be
a mixed model
with random effect?
Loading...