Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Gllamm weightings


From   "Dominic Muston" <[email protected]>
To   <[email protected]>
Subject   st: Gllamm weightings
Date   Tue, 16 Aug 2005 10:50:35 +0100

Can anyone please help me with a problem using the weightings option of
gllamm?

I'm running a 2-level poisson regression model. When I run the model
without weighting, Stata tells me (correctly) that I have 377 level 1
units and 7 level 2 units. When I run the model including a weighting
option, Stata tells me (incorrectly) that I have only 2 level 2 units;
and the number of level 1 units given is much higher.

I appreciate that using weighting may inflate the number of level 1
units, but I can't see why it should reduce the number of level 2 units.
I'm probably doing something very wrong! The trace option hasn't given
me any clues. The reason for using weightings is as a means of
"age-standardising" the centre and arm specific rates.

Here's the data:

n: number of events
pyears: person-years of exposure
centre: trial centre (1-8)
arm: arm (intervention=1, control=2)
age: age (years)
wt1: level 1 weighting = given to each age within centre
wt2: level 2 weighting = weighting given to each centre

For each combination of centre, arm and age, we have the number of
events (n) and the person-years of exposure (pyears). For a given age,
wt1 does not vary by centre or arm. For a given centre, wt2 does not
vary by age or arm.

Here's my Stata coding:

* Data / equation set-up
gen constant = 1
gen lpyears = ln(pyears)
eq cons: constant
eq arm: arm

* Gllamm model without weighting
gllamm n , offset(lpyears) i(centre) family(poisson) link(log) nrf(2)
eqs(cons arm)

* Gllamm model with weighting
gllamm n , offset(lpyears) i(centre) family(poisson) link(log) nrf(2)
eqs(cons arm) weight(wt)

Any help very much appreciated!

Dominic Muston.

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index