Displaying 20 results from an estimated 7000 matches similar to: "glm.nb difficulties"
2012 Apr 14
1
R Error/Warning Messages with library(MASS) using glm.
Hi there,
I have been having trouble running negative binomial regression (glm.nb)
using library MASS in R v2.15.0 on Mac OSX.
I am running multiple models on the variables influencing the group size of
damselfish in coral reefs (count data). For total group size and two of my
species, glm.nb is working great to deal with overdispersion in my count
data. For two of my species, I am getting a
2009 Aug 13
2
glm.nb versus glm estimation of theta.
Hello,
I have a question regarding estimation of the dispersion parameter (theta)
for generalized linear models with the negative binomial error structure. As
I understand, there are two main methods to fit glm's using the nb error
structure in R: glm.nb() or glm() with the negative.binomial(theta) family.
Both functions are implemented through the MASS library. Fitting the model
using these
2003 Mar 12
2
quasipoisson, glm.nb and AIC values
Dear R users,
I am having problems trying to fit quasipoisson and negative binomials glm.
My data set
contains abundance (counts) of a species under different management regimens.
First, I tried to fit a poisson glm:
> summary(model.p<-glm(abund~mgmtcat,poisson))
Call:
glm(formula = abund ~ mgmtcat, family = poisson)
.
.
.
(Dispersion parameter
2012 Oct 22
1
glm.nb - theta, dispersion, and errors
I am running 9 negative binomial regressions with count data.
The nine models use 9 different dependent variables - items of a clinical
screening instrument - and use the same set of 5 predictors. Goal is to
find out whether these predictors have differential effects on the items.
Due to various reasons, one being that I want to avoid overfitting models,
I need to employ identical types of
2002 Jun 20
1
Possible bug with glm.nb and starting values (PR#1695)
Full_Name: Ben Cooper
Version: 1.5.0
OS: linux
Submission from: (NULL) (134.174.187.90)
The help page for glm.nb (in MASS package) says that it takes "Any other
arguments for the glm() function except family"
One such argument is start "starting values for the parameters in the linear
predictor."
However, when called with starting values glm.nb returns:
Error in
2002 Feb 13
0
glmms with negative binomial responses
I am trying to find a way to analyze a "simple" mixed model with two
levels of a treatment, a random blocking factor, and (wait for it)
negative binomial count distributions as the response variable. As far as
I can tell, the currently available R offerings (glmmGibbs, glmmPQL in
MASS, and Jim Lindsey's glmm code) aren't quite up to this. From what I
have read (e.g.
2008 Apr 21
1
estimate of overdispersion with glm.nb
Dear R users,
I am trying to fully understand the difference between estimating
overdispersion with glm.nb() from MASS compared to glm(..., family =
quasipoisson).
It seems that (i) the coefficient estimates are different and also (ii) the
summary() method for glm.nb suggests that overdispersion is taken to be one:
"Dispersion parameter for Negative Binomial(0.9695) family taken to be
2001 Oct 03
1
tiny typo in optim/N-M documentation (PR#1109)
In the optim() documentation, the control parameter "maxit" says
"There is no other stopping criteria." That should be "are", or
"criterion" ...
While I'm at it -- poking at the code a little bit, it looks as if the
initial simplex is set from the initial point by displacing each
parameter value by max(0.1,0.1*pmax(fabs(Bvec))), where Bvec is the
2004 Nov 09
1
glm.nb stop on Error.
Hi,
I make an analysis sequence on R. In some cases the function glm.nb fail to
ajust the model. Its Ok. The problem is that this error stop the program. I
need treat this error and not stop the program. Something like this:
...
model <- glm.nb(y~x,maxit=1000)
if(glm.nb fail) {
teste[i] <- 0
}
else {
teste[i] <- anova(modelo)$"P(>|Chi|)"[2]
}
...
I try this:
...
2011 Jan 27
1
Quasi-poisson glm and calculating a qAIC and qAICc...trying to modilfy Bolker et al. 2009 function to work for a glm model
Sorry about re-posting this, it never went out to the mailing list when I
posted this to r-help forum on Nabble and was pending for a few days, now
that I am subscribe to the mailing list I hope that this goes out:
I've been a viewer of this forum for a while and it has helped out a lot,
but this is my first time posting something.
I am running glm models for richness and abundances. For
2008 Oct 03
1
Problem with glm.nb estimation
Dear All,
I've been using already for a year glm.nb() from the MASS package.
But today, R gave me an error message when estimating one of my usual
models:
> depEsf.nb <- glm.nb(depE ~ manuf00E + corps00E + lngdp00E + lngdp00sqE +
> lnpop00E + indshE + scishE + mechshE + elecshE + chemshE + drugshE +
> urban_dummyE + aggl_dummyE
+ + eE1 + eE2 + eE3 + eE4 + eE5 + eE6 + eE7 +
2003 Jan 27
1
help page for anova.glm/variation between S-PLUS and R behavior
When using test="F" in stat.anova() / anova.glm(), R uses the assumed
dispersion parameter for the specified family (e.g. scale=1 for binomial),
while S-PLUS automatically uses the estimated dispersion parameter
(residual deviance/residual df). I think there are good reasons for the
behavior in R -- it fits with the "you get what you actually asked for"
philosophy -- and
2009 Feb 18
1
Help on warning message from Neg. Binomial error during glm
I am using glm.nb, a ~b*c ( b is categorical and c is continuous). when I
run this model I get the warning message:
Warning messages:
1: In theta.ml(Y, mu, sum(w), w, limit = control$maxit, trace =
control$trace > :
iteration limit reached
2: In theta.ml(Y, mu, sum(w), w, limit = control$maxit, trace =
control$trace > :
iteration limit reached
What does this mean?
--
Graduate
2004 Nov 10
0
glm.nb
Hi,
I make some simulations with rnbinom and try to test with glm.nb.
But in some data set the glm.nb fail.
Look:
pop <- rnbinom(n=1000,size=1,mu=0.05)
> glm.nb(pop~1,maxit=1000)
Error in while ((it <- it + 1) < limit && abs(del) > eps) { :
missing value where TRUE/FALSE needed
look some pop charactetistics:
> summary(pop)
Min. 1st Qu. Median Mean 3rd Qu.
2008 Apr 04
2
suggested minor patch for optim.R
optim ignores misspelled control parameters, so that trying
to set (e.g.) "maxint=1000" in the control argument silently
does nothing. The patch below (watch out for line breaks! also
posted at http://www.zoo.ufl.edu/bolker/optim_patch.R , and
http://www.zoo.ufl.edu/bolker/optim_new.R) adds
three lines to optim.R that issue a warning if any names of
elements of "control" fail
2008 Apr 17
2
glm(quasipoisson) with non-integer response
Hi,
I have count data that have been meddled with enough to make them non
integers. Using glm(poisson) returns a "non integer" error but
glm(quasipoisson) does not. Just wondering if anyone knows if I am
violating the assumptions of a quasipoisson error structure by using
these non-integer response data?
Thanks! I'd welcome your thoughts and/or references...
Mark
2007 Aug 15
0
Negative Binomial: glm.nb
Hi Folks,
I'm playing with glm.nb() in MASS.
Reference: the negative binomial distribution
P(y) = (Gamma(theta+y)/(Gamma(theta)*y!))*(p^theta)*(1-p)^y
y = 0,1,2,...
in the notation of the MASS book (section 7.4), where
p = theta/(mu + theta) so (1-p) = mu/(mu + theta)
where mu is the expected value of Y. It seems from ?glm.nb that
an initial value of theta is either supplied, or
2010 Nov 27
1
d.f. in F test of nested glm models
Dear all,
I am fitting a glm to count data using poison errors with the log link. My
goal is to test for the significance of model terms by calling the anova
function on two nested models following the recommendation in Michael
Crawley's guide to Statistical Computing.
Without going into too much detail, essentially, I have a small
overdispersion problem (errors do not fit the poisson
2010 Sep 11
3
confidence bands for a quasipoisson glm
Dear all,
I have a quasipoisson glm for which I need confidence bands in a graphic:
gm6 <- glm(num_leaves ~ b_dist_min_new, family = quasipoisson, data = beva)
summary(gm6)
library('VIM')
b_dist_min_new <- as.numeric(prepare(beva$dist_min, scaling="classical", transformation="logarithm")).
My first steps for the solution are following:
range(b_dist_min_new)
2010 Oct 19
2
Strange glm(, quasipoisson) error
Dear list,
I have recently encountered an odd error when running glm(dep~indep,
quasipoisson): while, with a subset of my data, I could get a
perfectly reasonable model, once I include all of my data (17K+
observations, 29 variables), I get the following error:
Error in if (any(y < 0)) stop("negative values not allowed for the
quasiPoisson family") :
missing value where