Re: [R] Negative binomial GAMM using 'by' in factor interactions

2017-03-09 Thread Bert Gunter
Your queries appear to concern statistical issues. This list is about R programming and related; statistical issues are typically OT here. stats.stackexchange.com or a local statistical expert are probably better places to seek statistical advice. Cheers, Bert Bert Gunter "The trouble with

[R] Negative binomial GAMM using 'by' in factor interactions

2017-03-09 Thread Eva Maria Leunissen
I am using a GAMM to model my data (this is as far as I know the only way I can use the negative binomial distribution AND a correlation structure within the model). I measured animal detections (including zero detections) per hour at 3 different locations in an area. location is a factor in my

Re: [R] Negative binomial models and censored observations

2014-03-16 Thread Ben Bolker
Achim Zeileis Achim.Zeileis at uibk.ac.at writes: On Thu, 13 Mar 2014, Tim Marcella wrote: Hi, I am working with hurdle models in the pscl package to model zero inflated overdispersed count data and want to incorporate censored observations into the equation. 33% of the observed

Re: [R] Negative binomial models and censored observations

2014-03-14 Thread Achim Zeileis
On Thu, 13 Mar 2014, Tim Marcella wrote: Hi, I am working with hurdle models in the pscl package to model zero inflated overdispersed count data and want to incorporate censored observations into the equation. 33% of the observed positive count data is right censored, i.e. subject lost to

[R] Negative binomial models and censored observations

2014-03-13 Thread Tim Marcella
Hi, I am working with hurdle models in the pscl package to model zero inflated overdispersed count data and want to incorporate censored observations into the equation. 33% of the observed positive count data is right censored, i.e. subject lost to follow up during the duration of the study. Can

[R] Negative binomial distribution mixture model

2014-02-25 Thread Fabian Amman
Dear R community I'm new to R and I'd like to ask for hints how to approach the following problem: I have two vectors of count data 'observed_S' and 'observed_A'. Whereas 'observed_S' follows a neg. binomial distribution but 'observed_A' is a mixture of an unknown variable 'A' (also from a

[R] Negative binomial parameterisation in mgcv

2013-11-13 Thread Mark Payne
Dear R-help, The negative binomial distribution has several different parameterisations, but I can't seem to figure out what the exact one used in mgcv's negbin family is? negbin() requires a theta argument, but its not clear anywhere in the documentation (that I can find), how this parameter

Re: [R] Negative binomial parameterisation in mgcv

2013-11-13 Thread Prof Brian Ripley
On 13/11/2013 09:38, Mark Payne wrote: Dear R-help, The negative binomial distribution has several different parameterisations, but I can't seem to figure out what the exact one used in mgcv's negbin family is? negbin() requires a theta argument, but its not clear anywhere in the documentation

Re: [R] Negative binomial parameterisation in mgcv

2013-11-13 Thread Simon Wood
var(y) = mu + mu^2/theta where E(y) = mu. best, Simon On 13/11/13 10:38, Mark Payne wrote: Dear R-help, The negative binomial distribution has several different parameterisations, but I can't seem to figure out what the exact one used in mgcv's negbin family is? negbin() requires a theta

Re: [R] Negative Binomial Regression - glm.nb

2013-02-28 Thread Ben Bolker
Martin Spindler Martin.Spindler at gmx.de writes: Dear all, I would like to ask, if there is a way to make the variance / dispersion parameter $\theta$ (referring to MASS, 4th edition, p. 206) in the function glm.nb dependent on the data, e.g. $1/ \theta = exp(x \beta)$ and to estimate

Re: [R] Negative Binomial Regression - glm.nb

2013-02-28 Thread Rolf Turner
On 02/28/2013 08:27 PM, Martin Spindler wrote: Dear all, I would like to ask, if there is a way to make the variance / dispersion parameter $\theta$ (referring to MASS, 4th edition, p. 206) in the function glm.nb dependent on the data, e.g. $1/ \theta = exp(x \beta)$ and to estimate the

[R] Negative Binomial Regression - glm.nb

2013-02-27 Thread Martin Spindler
Dear all, I would like to ask, if there is a way to make the variance / dispersion parameter $\theta$ (referring to MASS, 4th edition, p. 206) in the function glm.nb dependent on the data, e.g. $1/ \theta = exp(x \beta)$ and to estimate the parameter vector $\beta$ additionally. If this is

Re: [R] Negative Binomial Regression - glm.nb

2013-02-27 Thread Prof Brian Ripley
On 28/02/2013 07:27, Martin Spindler wrote: Dear all, I would like to ask, if there is a way to make the variance / dispersion parameter $\theta$ (referring to MASS, 4th edition, p. 206) in the function glm.nb dependent on the data, e.g. $1/ \theta = exp(x \beta)$ and to estimate the

Re: [R] Negative Binomial GAMM - theta values and convergence

2012-12-07 Thread Simon Wood
Hi Raeanne, gamm fits using PQL, which doesn't always converge, however looking at your data, a couple of things stand out... 1. Trying a Tweedie seemed to give nicer residual plots than the negative binomial, and also converges with gamm. e.g. SB.gam3-gam(count~offset(vol_offset)+

[R] negative binomial GAMM with variance structures

2011-09-22 Thread Meredith Jantzen
Hello, I am having some difficulty converting my gam code to a correct gamm code, and I'm really hoping someone will be able to help me. I was previously using this script for my overdispersed gam data: M30 -gam(efuscus~s(mic, k=7) +temp +s(date)+s(For3k, k=7) + pressure+ humidity,

Re: [R] negative binomial GAMM with variance structures

2011-09-22 Thread Simon Wood
gamm can't estimate the theta parameter for a negative binomial automatically. It can only work with fixed user supplied values for theta (i.e. negbin(2.3) should work, but negbin(c(1,10)) won't). Is negative binomial the only thing you can use here (it doesn't seem like the most natural

Re: [R] Negative Binomial GLM

2011-09-01 Thread Jim Silverton
Hi all, I am using the negative binomila glm in MASS. This is my data alled data1: Reps Treats counts HSM11 0 21 HSM22 0 34 HSM33 0 27 PTM11 1 32 PTM22 1 20 PTM33 1 23 I goal is to do a GLM to extract the

[R] negative binomial regression with spatial weights matrix (not locations)

2011-07-19 Thread ChristyM
Hello, I have some data that exhibits a negative binomial distribution and also spatial structure. I would like to create a model that accounts for both. However, instead of locations, I have a distance matrix (cost matrix) describing the spatial relationships among the locations. I have tried

[R] negative binomial latent class regression in package flexmix

2011-02-23 Thread Carson Farmer
Hello list, Has anyone had any luck creating an M-step driver for negative binomial regression for use with package flexmix? I've had a look here: http://cran.r-project.org/web/packages/flexmix/vignettes/flexmix-intro.pdf as well as poking around in the flexmix source, but I haven't had much luck

[R] negative binomial regression, unbalanced panel

2010-11-24 Thread hl
I am a student who is doing empirical work for his thesis and trying to switch to R. I am familiar with Stata, and at the moment I am trying to replicate some of my previous work. I have a large unbalanced panel data set, observations for different countries between 1970 and 2007. My

Re: [R] Negative binomial

2010-01-05 Thread David Winsemius
On Jan 5, 2010, at 9:38 AM, Stefani Mallia wrote: Hi, I'm trying to fit a glm with a negative binomial error distribution and a log link, using the example found in the paper Stochastic Claims Reserving In General Insurance by England and Verrall. I am attaching a pdf since it is more

Re: [R] Negative binomial

2010-01-05 Thread David Winsemius
On Jan 5, 2010, at 12:20 PM, David Winsemius wrote: On Jan 5, 2010, at 9:38 AM, Stefani Mallia wrote: Hi, I'm trying to fit a glm with a negative binomial error distribution and a log link, using the example found in the paper Stochastic Claims Reserving In General Insurance by England

Re: [R] negative binomial lmer

2008-12-13 Thread David Winsemius
Perhaps because you have not loaded the package that contains it? If you have installed MASS (via the super package VR) then try: require(MASS) ?negative.binomial -- David Winsemius On Dec 11, 2008, at 4:29 PM, Marty Kardos wrote: Hi; I am running generalized linear mixed models (GLMMs)

Re: [R] negative binomial lmer

2008-12-13 Thread Ben Bolker
Marty Kardos wrote: Hi; I am running generalized linear mixed models (GLMMs) with the lmer function from the lme4 package in R 2.6.2. My response variable is overdispersed, and I would like (if possible) to run a negative binomial GLMM with lmer if possible. I saw a posting from

[R] negative binomial lmer

2008-12-11 Thread Marty Kardos
Hi; I am running generalized linear mixed models (GLMMs) with the lmer function from the lme4 package in R 2.6.2. My response variable is overdispersed, and I would like (if possible) to run a negative binomial GLMM with lmer if possible. I saw a posting from November 15, 2007 which indicated

[R] negative binomial predicted probabilities

2008-11-07 Thread Joseph Magagnoli
I estimated a negative binomial model using zelig. z.out- zelig(NEWBHC~ PW80 + CHNGBLK + XBLK,data=data, model=negbin) How do I calculate predicted probabilities for this model? Is it the same process as a poisson regression? Thanks in advance Joe [[alternative HTML version deleted]]

[R] Negative Binomial Predictions

2008-10-01 Thread Donald Catanzaro, PhD
Good Day All, I have a negative binomial model which I have developed using the MASS library. I now would like to develop some predictions from it. Running the predict.glm (stats library) using type=response gives me a non-integer value which was rather puzzling. I would like to confirm

Re: [R] Negative Binomial Predictions

2008-10-01 Thread Achim Zeileis
On Wed, 1 Oct 2008, Donald Catanzaro, PhD wrote: Good Day All, I have a negative binomial model which I have developed using the MASS library. I now would like to develop some predictions from it. Running the predict.glm (stats library) using type=response gives me a non-integer value

[R] Negative binomial GLM w/fixed dispersion parameter

2008-08-14 Thread Tobin, Jared
Hello r-help, As the title suggests, I'm attempting to fit a negative binomial GLM with a fixed dispersion parameter. Both glm.nb() and glm(..., family=negative.binomial(theta, ...)) (using MASS) do not appear to allow this; upon specifying a value for theta, each then proceeds to re-estimate

Re: [R] Negative Binomial Regression

2008-07-29 Thread Ben Bolker
jcarmichael jcarmichael314 at gmail.com writes: Hello. I am attempting to duplicate a negative binomial regression in R. SAS uses generalized estimating equations for model fitting in the GENMOD procedure. proc genmod data=mydata (where=(gender='F')); by agegroup; class id gender

Re: [R] Negative Binomial Regression

2008-07-29 Thread Prof Brian Ripley
On Tue, 29 Jul 2008, Ben Bolker wrote: jcarmichael jcarmichael314 at gmail.com writes: Hello. I am attempting to duplicate a negative binomial regression in R. SAS uses generalized estimating equations for model fitting in the GENMOD procedure. proc genmod data=mydata

Re: [R] Negative Binomial Regression

2008-07-29 Thread Ben Bolker
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Prof Brian Ripley wrote: | On Tue, 29 Jul 2008, Ben Bolker wrote: | | jcarmichael jcarmichael314 at gmail.com writes: | | | | Hello. | | I am attempting to duplicate a negative binomial regression in R. | SAS uses | generalized estimating equations

Re: [R] Negative Binomial Regression

2008-07-29 Thread Prof Brian Ripley
On Tue, 29 Jul 2008, Ben Bolker wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Prof Brian Ripley wrote: | On Tue, 29 Jul 2008, Ben Bolker wrote: | | jcarmichael jcarmichael314 at gmail.com writes: | | Hello. | | I am attempting to duplicate a negative binomial regression in R. | SAS uses

Re: [R] Negative Binomial Regression

2008-07-29 Thread Ben Bolker
Prof Brian Ripley wrote: 'poisson' _family_, I presume? oops, yes. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

[R] Negative Binomial Regression

2008-07-28 Thread jcarmichael
Hello. I am attempting to duplicate a negative binomial regression in R. SAS uses generalized estimating equations for model fitting in the GENMOD procedure. proc genmod data=mydata (where=(gender='F')); by agegroup; class id gender type; model count = var1 var2 var3 /dist=NB link=log

Re: [R] Negative Binomial Model

2008-05-14 Thread Ted Harding
On 14-May-08 09:11:31, Achim Zeileis wrote: On Wed, 14 May 2008, Mike Ryckman wrote: Hello, I am trying to run a negative binomial regression model in R and can't get the standard errors to match the output I get from the Stata nbreg command. I've tried a few different options but haven't

[R] Negative Binomial Model

2008-05-14 Thread Mike Ryckman
Hello, I am trying to run a negative binomial regression model in R and can't get the standard errors to match the output I get from the Stata nbreg command. I've tried a few different options but haven't had much luck. The closest I've found is: gamlss(formula, family = NBI, sigma.formula = ~

Re: [R] Negative Binomial Model

2008-05-14 Thread Achim Zeileis
On Wed, 14 May 2008, Mike Ryckman wrote: Hello, I am trying to run a negative binomial regression model in R and can't get the standard errors to match the output I get from the Stata nbreg command. I've tried a few different options but haven't had much luck. The closest I've found is:

Re: [R] Negative Binomial Model

2008-05-14 Thread Mike Ryckman
To: r-help@r-project.org Cc: Mike Ryckman Subject: Re: [R] Negative Binomial Model On 14-May-08 09:11:31, Achim Zeileis wrote: On Wed, 14 May 2008, Mike Ryckman wrote: Hello, I am trying to run a negative binomial regression model in R and can't get the standard errors to match the output I

Re: [R] Negative Binomial Model

2008-05-14 Thread Achim Zeileis
PROTECTED] Sent: Wednesday, May 14, 2008 2:38 AM To: r-help@r-project.org Cc: Mike Ryckman Subject: Re: [R] Negative Binomial Model On 14-May-08 09:11:31, Achim Zeileis wrote: On Wed, 14 May 2008, Mike Ryckman wrote: Hello, I am trying to run a negative binomial regression model in R and can't

[R] negative binomial lmer

2007-11-15 Thread H. Skaug
If lmer() does not do it, you can try: http://otter-rsch.com/admbre/examples/glmmadmb/glmmADMB.html It handles negative binomial responce (but you may have to remove data entries involving NA manually). Regards, hans Hi I am running an lmer which works fine with family=poisson mixed.model

Re: [R] negative binomial lmer

2007-11-15 Thread Bill.Venables
- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of H. Skaug Sent: Thursday, 15 November 2007 8:16 PM To: r-help@r-project.org Subject: [R] negative binomial lmer If lmer() does not do it, you can try: http://otter-rsch.com/admbre/examples/glmmadmb/glmmADMB.html It handles negative

[R] negative binomial lmer

2007-11-13 Thread Tonker
Hi I am running an lmer which works fine with family=poisson mixed.model-lmer(nobees~spray+dist+flwabund+flwdiv+round+(1|field),family=poisson,method=ML,na.action=na.omit) But it is overdispersed. I tried using family=quasipoisson but get no P values. This didnt worry me too much as i think my