negative binomial regression

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

negative binomial regression

keltre19
urgent help needed: I am using SPSS 25 to perform a negative binomial
regression on overdispersed data. I am trying to work out the negative
binomial equation/interpretation (582 wards are columns; variables are rows)
= Dependent variable is Deaths 2011 (numeric figure for each 582 wards) +
Independent variables are: categorical treated as factors and the rest are %
proportions treated as covariates.

My Q: controlling for demographics and health variables, it was hypothesised
than an increase in an areas deprivation and farming activities will
statistically increase the risk of ward mortality.

1. How do I make predictions of deaths as I am at my wits end trying to
figure it out!! Going around and round in circles and getting nowhere :C
2. The code I am running is not doing what I want it to. I want to look at
deprivation (NIMDM) at 1 (most deprived, and then at other intervals for
comparisons) and see what the predicted deaths are in wards and its
influence this has on the other IVs. But when I run this code below it makes
no difference to running it without the       /EMMEANS
CONTROL=NIMDMrank2010(1) line
3. Then trying to place them on a scatterplot for comparisons. But when I
run this code which of the 4 variables created do I plot (if any). i know
XPPRED gives me the predicted log counts but how do I make them meaningful
in a figure.

GENLIN deaths11_fig BY farms11code avSOfarm_abovBEL grass_NEW crops_NEW
catttle11code sheep11code
    pigs11code poultry11code (ORDER=DESCENDING) WITH pcnt65to100A
SEXmalprcnt11 tot_livalone11 Qbeldeg
    FT31plushrs NIMDMrank2010 yesUNPcar LLTIyesTOT OCCprcnt51 LFAfarms11
FARMEDpcnt_NEW
  /MODEL farms11code avSOfarm_abovBEL grass_NEW crops_NEW catttle11code
sheep11code pigs11code
    poultry11code pcnt65to100A SEXmalprcnt11 tot_livalone11 Qbeldeg
FT31plushrs NIMDMrank2010 yesUNPcar
    LLTIyesTOT OCCprcnt51 LFAfarms11 FARMEDpcnt_NEW INTERCEPT=YES
OFFSET=NL_popul11
 DISTRIBUTION=NEGBIN(MLE) LINK=LOG
  /CRITERIA METHOD=FISHER(1) SCALE=1 COVB=ROBUST MAXITERATIONS=1000
MAXSTEPHALVING=50
    PCONVERGE=1E-006(ABSOLUTE) SINGULAR=1E-012 ANALYSISTYPE=3(WALD)
CILEVEL=95 CITYPE=WALD
    LIKELIHOOD=FULL
      /EMMEANS CONTROL=NIMDMrank2010(1)
  /MISSING CLASSMISSING=EXCLUDE
  /PRINT CPS DESCRIPTIVES MODELINFO FIT SUMMARY SOLUTION (EXPONENTIATED)
    /SAVE MEANPRED XBPRED COOK DEVIANCERESID.

I am hoping someone on here knows the syntax or point-and-click method to
solve this issue as I have exhausted youtube videos and reading SPSS syntax
books and journals, perhaps someone knows the solution off-hand, thanks in
advance for any advice, feel free to ask any questions, Kel




--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: negative binomial regression

Bruce Weaver
Administrator
Have you seen this example on the UCLA website?

  https://stats.idre.ucla.edu/spss/dae/negative-binomial-regression/

It appears to do some of the same things you are trying to do.  



keltre19 wrote
> --- snip ---
> I am hoping someone on here knows the syntax or point-and-click method to
> solve this issue as I have exhausted youtube videos and reading SPSS
> syntax
> books and journals, perhaps someone knows the solution off-hand, thanks in
> advance for any advice, feel free to ask any questions, Kel





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: negative binomial regression

Maguin, Eugene
In reply to this post by keltre19
I haven't seen the UCLA example that Bruce referenced. But isn't there something unexpected about this statement

(582 wards are columns; variables are rows)

Gene Maguin




-----Original Message-----
From: SPSSX(r) Discussion <[hidden email]> On Behalf Of keltre19
Sent: Monday, May 20, 2019 11:50 AM
To: [hidden email]
Subject: negative binomial regression

urgent help needed: I am using SPSS 25 to perform a negative binomial regression on overdispersed data. I am trying to work out the negative binomial equation/interpretation (582 wards are columns; variables are rows) = Dependent variable is Deaths 2011 (numeric figure for each 582 wards) + Independent variables are: categorical treated as factors and the rest are % proportions treated as covariates.

My Q: controlling for demographics and health variables, it was hypothesised than an increase in an areas deprivation and farming activities will statistically increase the risk of ward mortality.

1. How do I make predictions of deaths as I am at my wits end trying to
figure it out!! Going around and round in circles and getting nowhere :C
2. The code I am running is not doing what I want it to. I want to look at
deprivation (NIMDM) at 1 (most deprived, and then at other intervals for
comparisons) and see what the predicted deaths are in wards and its influence this has on the other IVs. But when I run this code below it makes
no difference to running it without the       /EMMEANS
CONTROL=NIMDMrank2010(1) line
3. Then trying to place them on a scatterplot for comparisons. But when I
run this code which of the 4 variables created do I plot (if any). i know XPPRED gives me the predicted log counts but how do I make them meaningful in a figure.

GENLIN deaths11_fig BY farms11code avSOfarm_abovBEL grass_NEW crops_NEW catttle11code sheep11code
    pigs11code poultry11code (ORDER=DESCENDING) WITH pcnt65to100A
SEXmalprcnt11 tot_livalone11 Qbeldeg
    FT31plushrs NIMDMrank2010 yesUNPcar LLTIyesTOT OCCprcnt51 LFAfarms11 FARMEDpcnt_NEW
  /MODEL farms11code avSOfarm_abovBEL grass_NEW crops_NEW catttle11code sheep11code pigs11code
    poultry11code pcnt65to100A SEXmalprcnt11 tot_livalone11 Qbeldeg FT31plushrs NIMDMrank2010 yesUNPcar
    LLTIyesTOT OCCprcnt51 LFAfarms11 FARMEDpcnt_NEW INTERCEPT=YES
OFFSET=NL_popul11
 DISTRIBUTION=NEGBIN(MLE) LINK=LOG
  /CRITERIA METHOD=FISHER(1) SCALE=1 COVB=ROBUST MAXITERATIONS=1000
MAXSTEPHALVING=50
    PCONVERGE=1E-006(ABSOLUTE) SINGULAR=1E-012 ANALYSISTYPE=3(WALD)
CILEVEL=95 CITYPE=WALD
    LIKELIHOOD=FULL
      /EMMEANS CONTROL=NIMDMrank2010(1)
  /MISSING CLASSMISSING=EXCLUDE
  /PRINT CPS DESCRIPTIVES MODELINFO FIT SUMMARY SOLUTION (EXPONENTIATED)
    /SAVE MEANPRED XBPRED COOK DEVIANCERESID.

I am hoping someone on here knows the syntax or point-and-click method to solve this issue as I have exhausted youtube videos and reading SPSS syntax books and journals, perhaps someone knows the solution off-hand, thanks in advance for any advice, feel free to ask any questions, Kel




--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: negative binomial regression

David Marso
Administrator
I concur.  The data will need to be transposed.


Maguin, Eugene wrote

> I haven't seen the UCLA example that Bruce referenced. But isn't there
> something unexpected about this statement
>
> (582 wards are columns; variables are rows)
>
> Gene Maguin
>
>
>
>
> -----Original Message-----
> From: SPSSX(r) Discussion &lt;

> SPSSX-L@.UGA

> &gt; On Behalf Of keltre19
> Sent: Monday, May 20, 2019 11:50 AM
> To:

> SPSSX-L@.UGA

> Subject: negative binomial regression
>
> urgent help needed: I am using SPSS 25 to perform a negative binomial
> regression on overdispersed data. I am trying to work out the negative
> binomial equation/interpretation (582 wards are columns; variables are
> rows) = Dependent variable is Deaths 2011 (numeric figure for each 582
> wards) + Independent variables are: categorical treated as factors and the
> rest are % proportions treated as covariates.
>
> My Q: controlling for demographics and health variables, it was
> hypothesised than an increase in an areas deprivation and farming
> activities will statistically increase the risk of ward mortality.
>
> 1. How do I make predictions of deaths as I am at my wits end trying to
> figure it out!! Going around and round in circles and getting nowhere :C
> 2. The code I am running is not doing what I want it to. I want to look at
> deprivation (NIMDM) at 1 (most deprived, and then at other intervals for
> comparisons) and see what the predicted deaths are in wards and its
> influence this has on the other IVs. But when I run this code below it
> makes
> no difference to running it without the       /EMMEANS
> CONTROL=NIMDMrank2010(1) line
> 3. Then trying to place them on a scatterplot for comparisons. But when I
> run this code which of the 4 variables created do I plot (if any). i know
> XPPRED gives me the predicted log counts but how do I make them meaningful
> in a figure.
>
> GENLIN deaths11_fig BY farms11code avSOfarm_abovBEL grass_NEW crops_NEW
> catttle11code sheep11code
>     pigs11code poultry11code (ORDER=DESCENDING) WITH pcnt65to100A
> SEXmalprcnt11 tot_livalone11 Qbeldeg
>     FT31plushrs NIMDMrank2010 yesUNPcar LLTIyesTOT OCCprcnt51 LFAfarms11
> FARMEDpcnt_NEW
>   /MODEL farms11code avSOfarm_abovBEL grass_NEW crops_NEW catttle11code
> sheep11code pigs11code
>     poultry11code pcnt65to100A SEXmalprcnt11 tot_livalone11 Qbeldeg
> FT31plushrs NIMDMrank2010 yesUNPcar
>     LLTIyesTOT OCCprcnt51 LFAfarms11 FARMEDpcnt_NEW INTERCEPT=YES
> OFFSET=NL_popul11
>  DISTRIBUTION=NEGBIN(MLE) LINK=LOG
>   /CRITERIA METHOD=FISHER(1) SCALE=1 COVB=ROBUST MAXITERATIONS=1000
> MAXSTEPHALVING=50
>     PCONVERGE=1E-006(ABSOLUTE) SINGULAR=1E-012 ANALYSISTYPE=3(WALD)
> CILEVEL=95 CITYPE=WALD
>     LIKELIHOOD=FULL
>       /EMMEANS CONTROL=NIMDMrank2010(1)
>   /MISSING CLASSMISSING=EXCLUDE
>   /PRINT CPS DESCRIPTIVES MODELINFO FIT SUMMARY SOLUTION (EXPONENTIATED)
>     /SAVE MEANPRED XBPRED COOK DEVIANCERESID.
>
> I am hoping someone on here knows the syntax or point-and-click method to
> solve this issue as I have exhausted youtube videos and reading SPSS
> syntax books and journals, perhaps someone knows the solution off-hand,
> thanks in advance for any advice, feel free to ask any questions, Kel
>
>
>
>
> --
> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text except the command. To leave the
> list, send the command SIGNOFF SPSSX-L For a list of commands to manage
> subscriptions, send the command INFO REFCARD
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD





-----
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: negative binomial regression

Bruce Weaver
Administrator
Agreed.  I thought that was odd too.  I hoped the OP might work out that
something was wrong after looking at the data file used for the UCLA
example.  Here's a relevant excerpt that should give a pretty good hint:

--- start of excerpt ---

Description of the data

Let’s pursue Example 1 from above.

We have attendance data on 314 high school juniors from two urban high
schools in the file
https://stats.idre.ucla.edu/wp-content/uploads/2016/02/nb_data.sav.  The
response variable of interest is days absent, daysabs.  The variable math is
the standardized math score for each student.  The variable prog is a
three-level nominal variable indicating the type of instructional program in
which the student is enrolled.

Let’s look at the data.  It is always a good idea to start with descriptive
statistics and plots.

    get file
"https://stats.idre.ucla.edu/wp-content/uploads/2016/02/nb_data.sav".
    descriptives variables = daysabs math.

--- end of excerpt ---

I assumed the OP knows that variable = column in SPSS.  



David Marso wrote

> I concur.  The data will need to be transposed.
>
>
> Maguin, Eugene wrote
>> I haven't seen the UCLA example that Bruce referenced. But isn't there
>> something unexpected about this statement
>>
>> (582 wards are columns; variables are rows)
>>
>> Gene Maguin
>
> --- snip ---





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: negative binomial regression

keltre19
In reply to this post by keltre19
I hope these answers help as I tried to keep them as brief as possible,
Thank you all for the kind suggestions, Kelly

Hello Bruce,
yes, I have seen the example on UCLA website, it was the most informative
website of all I found on the net, however they used an older version of
SPSS (ver. 19) I am running version 25, the syntax doesn’t work the way I
want it unfortunately, it must be missing something small within it (im
thinking due to software updates the syntax was modified) - I want to look
at deprivation (NIMDM) held at 1 (its most deprived ranking, and then at
other rankings for comparisons) and see what the predicted deaths are in
wards and its
influence this has on the other IVs.

GENLIN deaths11_fig BY farms11code avSOfarm_abovBEL grass_NEW crops_NEW
catttle11code sheep11code
    pigs11code poultry11code (ORDER=DESCENDING) WITH pcnt65to100A
SEXmalprcnt11 tot_livalone11 Qbeldeg
    FT31plushrs NIMDMrank2010 yesUNPcar LLTIyesTOT OCCprcnt51 LFAfarms11
FARMEDpcnt_NEW
  /MODEL farms11code avSOfarm_abovBEL grass_NEW crops_NEW catttle11code
sheep11code pigs11code
    poultry11code pcnt65to100A SEXmalprcnt11 tot_livalone11 Qbeldeg
FT31plushrs NIMDMrank2010 yesUNPcar
    LLTIyesTOT OCCprcnt51 LFAfarms11 FARMEDpcnt_NEW INTERCEPT=YES
OFFSET=NL_popul11
 DISTRIBUTION=NEGBIN(MLE) LINK=LOG
  /CRITERIA METHOD=FISHER(1) SCALE=1 COVB=ROBUST MAXITERATIONS=1000
MAXSTEPHALVING=50
    PCONVERGE=1E-006(ABSOLUTE) SINGULAR=1E-012 ANALYSISTYPE=3(WALD)
CILEVEL=95 CITYPE=WALD
    LIKELIHOOD=FULL
      /EMMEANS CONTROL=NIMDMrank2010(1)
  /MISSING CLASSMISSING=EXCLUDE
  /PRINT CPS DESCRIPTIVES MODELINFO FIT SUMMARY SOLUTION (EXPONENTIATED)
    /SAVE MEANPRED XBPRED COOK DEVIANCERESID.

The rest of the code seems to work for me, however it is when I include the
line  
/EMMEANS CONTROL=NIMDMrank2010(1)  
 it doesn’t seem to do what I need it to,


Hello Eugene and David,
Yes, it does seem different to the norm but I am using the 582 ward
geographical areas and treating them the same as an individual or ID (I just
included this line in the initial description to show the layout of my
data),
So I did transpose this dataset (wards = rows; variables = columns) it will
give me the characteristics of each of the 582 areas within each ward (for
descriptives) but this will not allow me then to carry out the negative
binomial regression as I only have the ward as variable names in rows
therefore I don’t think transposing is a viable option, keeping it in its
original format does overlap with the dataset layout on UCLA website,



--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: negative binomial regression

Maguin, Eugene
Would you tell us about this study please, particularly the design and definition of "ward" and of the DV, deaths11_fig. I could pretty easily be wrong but I think there's some things we (me, especially) don’t understand.
Gene Maguin





-----Original Message-----
From: SPSSX(r) Discussion <[hidden email]> On Behalf Of keltre19
Sent: Tuesday, May 21, 2019 6:44 AM
To: [hidden email]
Subject: Re: negative binomial regression

I hope these answers help as I tried to keep them as brief as possible, Thank you all for the kind suggestions, Kelly

Hello Bruce,
yes, I have seen the example on UCLA website, it was the most informative website of all I found on the net, however they used an older version of SPSS (ver. 19) I am running version 25, the syntax doesn’t work the way I want it unfortunately, it must be missing something small within it (im thinking due to software updates the syntax was modified) - I want to look at deprivation (NIMDM) held at 1 (its most deprived ranking, and then at other rankings for comparisons) and see what the predicted deaths are in wards and its influence this has on the other IVs.

GENLIN deaths11_fig BY farms11code avSOfarm_abovBEL grass_NEW crops_NEW catttle11code sheep11code
    pigs11code poultry11code (ORDER=DESCENDING) WITH pcnt65to100A
SEXmalprcnt11 tot_livalone11 Qbeldeg
    FT31plushrs NIMDMrank2010 yesUNPcar LLTIyesTOT OCCprcnt51 LFAfarms11 FARMEDpcnt_NEW
  /MODEL farms11code avSOfarm_abovBEL grass_NEW crops_NEW catttle11code sheep11code pigs11code
    poultry11code pcnt65to100A SEXmalprcnt11 tot_livalone11 Qbeldeg FT31plushrs NIMDMrank2010 yesUNPcar
    LLTIyesTOT OCCprcnt51 LFAfarms11 FARMEDpcnt_NEW INTERCEPT=YES
OFFSET=NL_popul11
 DISTRIBUTION=NEGBIN(MLE) LINK=LOG
  /CRITERIA METHOD=FISHER(1) SCALE=1 COVB=ROBUST MAXITERATIONS=1000
MAXSTEPHALVING=50
    PCONVERGE=1E-006(ABSOLUTE) SINGULAR=1E-012 ANALYSISTYPE=3(WALD)
CILEVEL=95 CITYPE=WALD
    LIKELIHOOD=FULL
      /EMMEANS CONTROL=NIMDMrank2010(1)
  /MISSING CLASSMISSING=EXCLUDE
  /PRINT CPS DESCRIPTIVES MODELINFO FIT SUMMARY SOLUTION (EXPONENTIATED)
    /SAVE MEANPRED XBPRED COOK DEVIANCERESID.

The rest of the code seems to work for me, however it is when I include the line /EMMEANS CONTROL=NIMDMrank2010(1)  it doesn’t seem to do what I need it to,


Hello Eugene and David,
Yes, it does seem different to the norm but I am using the 582 ward geographical areas and treating them the same as an individual or ID (I just included this line in the initial description to show the layout of my data), So I did transpose this dataset (wards = rows; variables = columns) it will give me the characteristics of each of the 582 areas within each ward (for
descriptives) but this will not allow me then to carry out the negative binomial regression as I only have the ward as variable names in rows therefore I don’t think transposing is a viable option, keeping it in its original format does overlap with the dataset layout on UCLA website,



--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: negative binomial regression

Rich Ulrich
In reply to this post by keltre19
Back to the beginning -- I think you have confused us all by mis-identifying
"Rows" and "columns".  If Death11  is a variable name, then you DO properly
have your dependent and independent variables defined, with a column
(as you look at your data in the editor) being one variable, such as Death11.

And each row is a different ward. But that is not what you wrote, more  than once.

Your question is about the lack of effect of the "/emmeans control" specification.
I don't have a sure answer for that, but I can raise one possibility.

What I can say about that is that I wonder whether your data are too sparse
for a full and proper solution.  Are there any Warnings given?   How many
Deaths are there?  Is this a sizeable number, or is it tiny? You have 30 or more
d.f.  in the predictors.  The total N of 582 is large enough for a regression,
according to one rule-of-thumb, but the rule-of-thumb about predicting
events ("Deaths") says that you should also have a large number of events.

And I wonder, further, about the appropriateness of the model.  If your Wards
do not have the same baseline Ns that are at risk for Death, I think you need
to normalize to get a Death-rate ... which would not, however, be a NegBin
model.

--
Rich Ulrich


From: SPSSX(r) Discussion <[hidden email]> on behalf of keltre19 <[hidden email]>
Sent: Monday, May 20, 2019 11:50 AM
To: [hidden email]
Subject: negative binomial regression
 
urgent help needed: I am using SPSS 25 to perform a negative binomial
regression on overdispersed data. I am trying to work out the negative
binomial equation/interpretation (582 wards are columns; variables are rows)
= Dependent variable is Deaths 2011 (numeric figure for each 582 wards) +
Independent variables are: categorical treated as factors and the rest are %
proportions treated as covariates.

My Q: controlling for demographics and health variables, it was hypothesised
than an increase in an areas deprivation and farming activities will
statistically increase the risk of ward mortality.

1.      How do I make predictions of deaths as I am at my wits end trying to
figure it out!! Going around and round in circles and getting nowhere :C
2.      The code I am running is not doing what I want it to. I want to look at
deprivation (NIMDM) at 1 (most deprived, and then at other intervals for
comparisons) and see what the predicted deaths are in wards and its
influence this has on the other IVs. But when I run this code below it makes
no difference to running it without the       /EMMEANS
CONTROL=NIMDMrank2010(1) line
3.      Then trying to place them on a scatterplot for comparisons. But when I
run this code which of the 4 variables created do I plot (if any). i know
XPPRED gives me the predicted log counts but how do I make them meaningful
in a figure.

GENLIN deaths11_fig BY farms11code avSOfarm_abovBEL grass_NEW crops_NEW
catttle11code sheep11code
    pigs11code poultry11code (ORDER=DESCENDING) WITH pcnt65to100A
SEXmalprcnt11 tot_livalone11 Qbeldeg
    FT31plushrs NIMDMrank2010 yesUNPcar LLTIyesTOT OCCprcnt51 LFAfarms11
FARMEDpcnt_NEW
  /MODEL farms11code avSOfarm_abovBEL grass_NEW crops_NEW catttle11code
sheep11code pigs11code
    poultry11code pcnt65to100A SEXmalprcnt11 tot_livalone11 Qbeldeg
FT31plushrs NIMDMrank2010 yesUNPcar
    LLTIyesTOT OCCprcnt51 LFAfarms11 FARMEDpcnt_NEW INTERCEPT=YES
OFFSET=NL_popul11
 DISTRIBUTION=NEGBIN(MLE) LINK=LOG
  /CRITERIA METHOD=FISHER(1) SCALE=1 COVB=ROBUST MAXITERATIONS=1000
MAXSTEPHALVING=50
    PCONVERGE=1E-006(ABSOLUTE) SINGULAR=1E-012 ANALYSISTYPE=3(WALD)
CILEVEL=95 CITYPE=WALD
    LIKELIHOOD=FULL
      /EMMEANS CONTROL=NIMDMrank2010(1)
  /MISSING CLASSMISSING=EXCLUDE
  /PRINT CPS DESCRIPTIVES MODELINFO FIT SUMMARY SOLUTION (EXPONENTIATED)
    /SAVE MEANPRED XBPRED COOK DEVIANCERESID.

I am hoping someone on here knows the syntax or point-and-click method to
solve this issue as I have exhausted youtube videos and reading SPSS syntax
books and journals, perhaps someone knows the solution off-hand, thanks in
advance for any advice, feel free to ask any questions, Kel




--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: negative binomial regression

Bruce Weaver
Administrator
In reply to this post by keltre19
I still don't completely understand what you are trying to do.  But I suspect
that your EMMEANS subcommands need more to them than you show below to get
what you want.  Here is a GENLIN example from one of my syntax files.  I was
using GENLIN to estimate a binary logit model, not a negative binomial
model.  But perhaps the EMMEANS sub-commands will give you an idea about
what you need to do.

GENLIN collegegrad (REFERENCE=FIRST)
       BY WHITE male (order = descending)
       WITH age speduc
  /MODEL
  WHITE
  speduc speduc*speduc
  age age*age
  male
  WHITE*speduc
  speduc*age
  speduc*age*age
   INTERCEPT=YES
   DISTRIBUTION=BINOMIAL LINK=LOGIT
  /EMMEANS TABLES=male*WHITE CONTROL=speduc(10) age(40) SCALE=TRANSFORMED
COMPARE=WHITE
  /EMMEANS TABLES=male*WHITE CONTROL=speduc(10) age(50) SCALE=TRANSFORMED
COMPARE=WHITE
  /EMMEANS TABLES=male*WHITE CONTROL=speduc(10) age(60) SCALE=TRANSFORMED
COMPARE=WHITE
  /EMMEANS TABLES=male*WHITE CONTROL=speduc(15) age(40) SCALE=TRANSFORMED
COMPARE=WHITE
  /EMMEANS TABLES=male*WHITE CONTROL=speduc(15) age(50) SCALE=TRANSFORMED
COMPARE=WHITE
  /EMMEANS TABLES=male*WHITE CONTROL=speduc(15) age(60) SCALE=TRANSFORMED
COMPARE=WHITE
  /EMMEANS TABLES=male*WHITE CONTROL=speduc(20) age(40) SCALE=TRANSFORMED
COMPARE=WHITE
  /EMMEANS TABLES=male*WHITE CONTROL=speduc(20) age(50) SCALE=TRANSFORMED
COMPARE=WHITE
  /EMMEANS TABLES=male*WHITE CONTROL=speduc(20) age(60) SCALE=TRANSFORMED
COMPARE=WHITE
  /MISSING CLASSMISSING=EXCLUDE
  /PRINT CPS DESCRIPTIVES MODELINFO FIT SUMMARY SOLUTION (EXPONENTIATED).


I used the SCALE=TRANSFORMED option to get log-odds, by the way.  

I didn't show it here, but I also used OMS to write the EMMEANS results to
another dataset, thus making them available for graphing.  

HTH.


keltre19 wrote
> --- snip ---
>
> The rest of the code seems to work for me, however it is when I include
> the
> line  
> /EMMEANS CONTROL=NIMDMrank2010(1)  
>  it doesn’t seem to do what I need it to,
>
> --- snip ---





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).