Hi stata list!
I've posted this question to allstat before and stata technical support,
but received no answer. Don't know if you could help:
Below is the question I posted:
I have data collected across 4 sites and would like to perform a test to
see whether the relationship between 2 binary variables, say A and B,
differs between the sites.
I think it makes sense to treat the sites as a random sample of sites, and
thus use a random coefficient model with both random slope and intercept.
Test would then be via a likelihood ratio test with the nested random
intercept model (without the random slope).
1st. My question is: Is this all good?
Secondly, however, in one of the sites, the dependent variable (B) has
only one value. So in normal (fixed-effects) logistic regression, this
would be impossible due to the presence of empty cells. (In other words
for both levels in A, the outcomes in B are entirely 0 in this particular
site).
Modelling using random slopes and intercepts won't give me an error
message, but I wonder if the output is still valid.
For your information, my entire dataset consist of 248 observations. THe
smallest sites still have 28 observations. THe variable A has about half 0
and half 1 in all sites. THe variable B has about 85% 0 and 15% 1 in all
sites except the above.
I used gllamm in STATA for the modelling. What struck me was that for the
other sites, my unconditional log-odd-ratios (b1+u1) are (.000, .110, and
.175), but for the site with a pure B variable, STATA gives me a
log-odd-ratio of .888, considerably higher than the rest.
****
And also another query: I've written an ado file that lets you draw line
graphs easily, with dots representing means, and error bars and so on.
What do I do if I want to share this with you guys?
Thanks a lot.
Tim
*
* 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/