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

st: Re: Analysis of binary cluster data with missing values


From   "Louise Linsell" <[email protected]>
To   <[email protected]>
Subject   st: Re: Analysis of binary cluster data with missing values
Date   Thu, 13 Nov 2003 10:45:42 +0000

Dear Stata users,

I have a dataset that looks something like this - each person has
observations on 2 hips and 2 knees and I wish to calcuate the odds ratio
of hips to knees, taking account of the clustering within person using
robust standard errors.

id    hip    knee  row   
1     1        0       1      
1     1        0       2           (1=replaced, 2=not replaced)
2     .         1       3      
2     0        1       4      
3     1        0       5     
3     0        .       6      
4     1        0       7     
4     .        .        8     

I have tried all of the following commands 

logistic hip knee, cluster(id)
xtlogit hip knee, i(id) or
svymean hip, by(knee)

but all of them drop any record (line) with a missing value (.), so in
the above dataset, rows 3, 6 and 8 would be dropped, despite there being
a non-missing observation in the other group that should be included in
the analysis. This gives incorrect estimates for the odds ratio when you
calculate them by hand from the equivalent 2x2 table.  e.g from the
above example, if I was calculating the OR by hand I would get

                 yes (1)     no (0)

hips            4              2

knees         2              4

OR = (4X4)/(2X2) = 4

However if all the rows with the missing values are dropped, you get

                yes (1)     no (0)

hips            4              1

knees         1              4

OR = (4X4)/(1X1) = 16

Any ideas or suggestions on how to calculate the correct odds ratio and
robust s.e. would be much appreciated.

Louise
*
*   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