similar to: glm.fit() and binomial family

Displaying 20 results from an estimated 5000 matches similar to: "glm.fit() and binomial family"

2006 Jun 09
1
glm with negative binomial family
I am analysing parasite egg count data and am having trouble with glm with a negative binomial family. In my first data set, 55% of the 3000 cases have a zero count, and the non-zero counts range from 94 to 145,781. Eventually, I want to run bic.glm, so I need to be able to use glm(family= neg.bin(theta)). But first I ran glm.nb to get an estimate of theta: > hook.nb<- glm.nb(fh,
2004 Jun 15
1
AIC in glm.nb and glm(...family=negative.binomial(.))
Can anyone explain to me why the AIC values are so different when using glm.nb and glm with a negative.binomial family, from the MASS library? I'm using R 1.8.1 with Mac 0S 10.3.4. >library(MASS) > dfr <- data.frame(c=rnbinom(100,size=2,mu=rep(c(10,20,100,1000),rep(25,4))), + f=factor(rep(seq(1,4),rep(25,4)))) > AIC(nb1 <- glm.nb(c~f, data=dfr)) [1] 1047 >
2007 Mar 20
1
How does glm(family='binomial') deal with perfect sucess?
Hi all, Trying to understand the logistic regression performed by glm (i.e. when family='binomial'), and I'm curious to know how it treats perfect success. That is, lets say I have the following summary data x=c(1,2,3,4,5,6) y=c(0,.04,.26,.76,.94,1) w=c(100,100,100,100,100,100) where x is y is the probability of success at each value of x, calculated across w observations.
1999 Apr 19
1
Algorithm used by glm, family=binomial?
Does anyone know what algorithm R uses in glm, family=binomial (i.e. a logit model)? I assume that it's in the source somewhere, but I wasn't able to find it. I'd like to know what file it's in (in a unix distribution of R). Thanks for your help. --------------------------- Barnet Wagman wagman at enteract.com 1361 N. Hoyne, 2nd floor Chicago, IL 60622 773-645-8369
2018 Apr 14
1
about family=binomial in glm funtion
Hei, I just wonder the use of family=binomial in glm function. As I learned from book (e.g. Andy Field) that logistic regression (binary logit) can use glm funtion with family = binomial. Here the y is a factor variable (e.g. value = 1 or 2). But I have also seen i many other cases, same function glm with family=binomial, but y is a variable with several column , like y= cbind(y1, y2), and
2005 Oct 16
1
BIC doesn't work for glm(family=binomial()) (PR#8208)
Full_Name: Ju-Sung Lee Version: 2.2.0 OS: Windows XP Submission from: (NULL) (66.93.61.221) BIC() requires the attribute $nobs from the logLik object but the logLik of a glm(formula,family=binomial()) object does not include $nobs. Adding attr(obj,'nobs') = value, seems to allow BIC() to work. Reproducing the problem: library(nmle); BIC(logLik(glm(1~1,family=binomial())));
2010 Nov 13
1
Define a glm object with user-defined coefficients (logistic regression, family="binomial")
Hi there, I just don't find the solution on the following problem. :( Suppose I have a dataframe with two predictor variables (x1,x2) and one depend binary variable (y). How is it possible to define a glm object (family="binomial") with a user defined logistic function like p(y) = exp(a + c1*x1 + c2*x2) where c1,c2 are the coefficents which I define. So I would like to do no
2013 Jan 30
1
starting values in glm(..., family = binomial(link =log))
Try this: Age_log_model = glm(Arthrose ~ Alter, data=x, start=c(-1, 0), family=quasibinomial(link = log)) Ravi Ravi Varadhan, Ph.D. Assistant Professor The Center on Aging and Health Division of Geriatric Medicine & Gerontology Johns Hopkins University rvaradhan@jhmi.edu<mailto:rvaradhan@jhmi.edu> 410-502-2619 [[alternative HTML version deleted]]
2011 Aug 26
2
How to find the accuracy of the predicted glm model with family = binomial (link = logit)
Hi All, When modeling with glm and family = binomial (link = logit) and response values of 0 and 1, I get the predicted probabilities of assigning to my class one, then I would like to compare it with my vector y which does have the original labels. How should I change the probabilities into values of zero and 1 and then compare it with my vector y to find out about the accuracy of my
2009 May 27
1
Hierarchical glm with binomial family
Dear members of the R help list, I want to do a hierarchical glm with binomial family but am unsure about how to write the syntax which involves nesting. I want to test whether the risk of being attacked by Herbivores for Meadowsweet plants is significantly dependent on the Distance to heterospecific source plants. Dependent variable = Herbivory (yes/no) Explanatory continuous variable =
2006 Feb 17
2
Something changed and glm(..., family=binomial) doesn't work now
I ran logistic regression models last week using glm (...,family=binomial) and got a set of results. Since then I have loaded the Epi package for ROC analysis. Now when I run those same models I get completely different results, with most being: Warning message: fitted probabilities numerically 0 or 1 occurred in: glm.fit(x = X, y = Y, weights = weights, start = start, etastart = etastart,
2008 Mar 25
2
gamlss and glm binomial family
Dear all and Mikis I have the opportunity to compare fits with the 'classical' glm and gamlss and no smoother of any kind just the same model formula (both with the binomial family). I get exactly the same coefficients but very different residuals, gamlss giving residuals which are extremely close to 'normal' and glm very far... How can this be ? Thanks in advance for
2005 Apr 11
1
glm family=binomial logistic sigmoid curve problem
I'm trying to plot an extrapolated logistic sigmoid curve using glm(..., family=binomial) as follows, but neither the fitted() points or the predict()ed curve are plotting correctly: > year <- c(2003+(6/12), 2004+(2/12), 2004+(10/12), 2005+(4/12)) > percent <- c(0.31, 0.43, 0.47, 0.50) > plot(year, percent, xlim=c(2003, 2007), ylim=c(0, 1)) > lm <- lm(percent ~ year)
2005 Jul 15
2
glm(family=binomial(link=logit))
Hi I am trying to make glm() work to analyze a toy logit system. I have a dataframe with x and y independent variables. I have L=1+x-y (ie coefficients 1,1,-1) then if I have a logit relation with L=log(p/(1-p)), p=1/(1+exp(L)). If I interpret "p" as the probability of success in a Bernouilli trial, and I can observe the result (0 for "no", 1 for
2007 Aug 14
1
glm(family=binomial) and lmer
Dear R users, I've notice that there are two ways to conduct a binomial GLM with binomial counts using R. The first way is outlined by Michael Crawley in his "Statistical Computing book" (p 520-521): >dose=c(1,3,10,30,100) >dead = c(2,10,40,96,98) >batch=c(100,90,98,100,100) >response = cbind(dead,batch-dead) >model1=glm(y~log(dose),binomial)
2008 Oct 10
1
Coefficients in a polynomial glm with family poisson/binomial
Dear R-users When running a glm polynomial model with one explanatory variable (example Y~X+X^2), with a poisson or binomial error distribution, the predicted values obtained from using the predict() function and those obtained from using the coefficients from the summary table "as is" in an equation of the form Y=INTERCEPT+ XCoef x X + XCoef x X^2, differ considerably. The former are
2013 Jan 29
1
starting values in glm(..., family = binomial(link = log))
Dear R-helpers, i have a problem with a glm-model. I am trying to fit models with the log as link function instead of the logit. However, in some cases glm fails to estimate those models and suggests to give start values. However, when I set start = coef(logistic_model) within the function call, glm still says it cannot find starting values? This seems to be more of a problem, when I include a
2018 Jun 04
0
aic() component in GLM-family objects
>>>>> Ben Bolker >>>>> on Sun, 3 Jun 2018 17:33:18 -0400 writes: > Is it generally known/has it been previously discussed here that the > $aic() component in GLM-family objects (e.g. results of binomial(), > poisson(), etc.) does not as implemented actually return the AIC, but > rather -2*log-likelihood + 2*(model_has_scale_parameter)
2011 Mar 02
2
problem with glm(family=binomial) when some levels have only 0 proportion values
Hello everybody I want to compare the proportions of germinated seeds (seed batches of size 10) of three plant types (1,2,3) with a glm with binomial data (following the method in Crawley: Statistics,an introduction using R, p.247). The problem seems to be that in two plant types (2,3) all plants have proportions = 0. I give you my data and the model I'm running: success failure
2018 Jun 17
1
aic() component in GLM-family objects
FWIW p. 206 of the White Book gives the following for names(binomial()): family, names, link, inverse, deriv, initialize, variance, deviance, weight. So $aic wasn't there In The Beginning. I haven't done any more archaeology to try to figure out when/by whom it was first introduced ... Section 6.3.3, on extending families, doesn't give any other relevant info. A patch for