Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Nbreg and collapse


From   "Andrew Herring" <[email protected]>
To   <[email protected]>
Subject   st: Nbreg and collapse
Date   Wed, 7 Mar 2007 13:01:05 -0800

Hello

I have the sum of deaths over a year period in a nation by sex age
nationality cause_of_death and
district of residence and the mid-year population by age and sex
(exposed_population)
I am interested in the effect of nationality on risk of death
then:
collapse (sum) deaths, by (nation sex age exposed_population)
xi: nbreg deaths nation sex i.age, e(exposed_population)
resulting nationality: b=0.77(expected result)
but with the addition of cause and district it goes haywire
collapse (sum) deaths, by (nation sex age exposed_population district
cause_of_death)
xi: nbreg deaths nation sex i.age, e(exposed_population)
resulting nationality: b=7.2(non expected result)
How can I diagnose the problem here?
Thanks
Andrew Herring


-----Original Message-----
From: [email protected]
[mailto:[email protected]]On Behalf Of
[email protected]
Sent: Wednesday, March 07, 2007 10:49 AM
To: [email protected]
Subject: RE: st: Re: transposing rows


Thanks to all of you! all your suggestions have been precious...
Best
Mariarosaria
Citazione Nick Cox <[email protected]>:

> For the all string variable case, see -sxpose- from SSC.
>
> Nick
> [email protected]
>
> Sebastian F. B�chte
>
> > when using -xpose- for your data you should note that
> > - the column that holds the variable names needs to be named _varname
> > (otherwise the transposed variables will be named v1, v2, v3,...and
> > you will loose the original/intended variable names
> > - string variables may not be transposed as -xpose- creates all
> > variables with the default storage type - either float or double.
>
>
> *
> *   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/
>




-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/

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

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