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

Re: st: Gllamm weightings

From   "Dominic Muston" <>
To   <>
Subject   Re: st: Gllamm weightings
Date   Thu, 18 Aug 2005 09:28:22 +0100

Just to close this off, I've sorted out my problem now and I think I
understand weightings in gllamm a bit better as a result.

Level one (age within centre) weightings should reflect both the
importance of the data row within level two and between level two, ie =
weighting of age within centre x weighting of centre. Level two (centre)
weightings all set to one.


>>> Dominic Muston 16/08/2005 10:50:35 >>>
Can anyone please help me with a problem using the weightings option of

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:

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