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

Re: st: Adjust after Poisson and offset not constant within by group


From   [email protected]
To   [email protected]
Subject   Re: st: Adjust after Poisson and offset not constant within by group
Date   Mon, 19 Jan 2004 09:32:48 -0600

Fred Wolfe <[email protected]> demonstrates a problem
with -adjust-.

> Perhaps I am not understanding this correctly, but I get an error
> that I don't expect after adjust.
>
> . xi:xtgee zoster1 ra age65 sex,i(pat) robust eform fam(poisson)
>        nolog exposure(exposure)
>
> <output cut>
>
> . adjust age65 sex,by(ra) exp ci
> offset (ln(exposure)) not constant within by()
> 
> However,
> 
> . tab exposure,m
> 
>    exposure |      Freq.     Percent        Cum.
> ------------+-----------------------------------
>          .5 |     92,635      100.00      100.00
> ------------+-----------------------------------
>       Total |     92,635      100.00
>
> shows that the exposure is constant.

I have found the problem in -adjust- and will get a correction
into the next ado update.

  Details for anyone interested:
  When -adjust- looks at `e(offset)' it checks if the first 3
  chars are "ln(" and if so it calls -substr()- to pull out from
  `e(offset)' the string starting at the 4th position through to
  all but the last.  This call was formed incorrectly and was
  leaving the last character, ")", in place.  The code that
  followed that then failed and caused the error message.


Ken Higbee    [email protected]
StataCorp     1-800-STATAPC

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