search for: glm

Displaying 20 results from an estimated 1124 matches for "glm".

Did you mean: gem
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 two functions to the same data produces much different results for me in terms of estimated theta and the coeff...
2006 Jan 15
1
problems with glm
Dear R users, I am having some problems with glm. The first is an error message "subscript out of bounds". The second is the fact that reasonable starting values are not accepted by the function. To be more specific, here is an example: > success <- c(13,12,11,14,14,11,13,11,12) > failure <- c(0,0,0,0,0,0,0,2,2) >...
2004 Sep 29
1
glm.fit and predict.glm: error ' no terms component'
Hi when I fit a glm by glm.fit(x,y,family = binomial()) and then try to use the object for prediction of newdata by: predict.glm(object, newdata) I get the error: Error in terms.default(object) : no terms component I know I can use glm() and a formula, but for my case I prefer glm.fit(x,y)... thanks for a...
2010 Dec 25
2
predict.lrm vs. predict.glm (with newdata)
Hi all I have run into a case where I don't understand why predict.lrm and predict.glm don't yield the same results. My data look like this: set.seed(1) library(Design); ilogit <- function(x) { 1/(1+exp(-x)) } ORDER <- factor(sample(c("mc-sc", "sc-mc"), 403, TRUE)) CONJ <- factor(sample(c("als", "bevor", "nachdem",...
2001 May 16
0
glm.nb difficulties
I'm having problems (or to be precise a student is having problems, which I'm having problems helping her with) trying to use glm.nb() from the MASS package to do some negative binomial fits on a data set that is, admittedly, wildly overdispersed (some zeros and some numbers in the hundreds). glm.nb is failing to converge, and furthermore is (to my surprise) producing values of theta that are larger and larger. Does any...
2000 Jan 13
0
problems with understanding behaviour of glm
Dear R users, I don't understand, what happens in glm in the following example (note that in S-Plus this example finishes with an almost perfect fit, but also 49 warnings): > fit.small <- glm(SKR.ein.aus ~ ., family = binomial, data = daten, maxit=100) Error in (if (is.empty.model(mt)) glm.fit.null else glm.fit)(x = X, y = Y, : inner loop 2; c...
2006 Mar 16
2
DIfference between weights options in lm GLm and gls.
Dear R-List users, Can anyone explain exactly the difference between Weights options in lm glm and gls? I try the following codes, but the results are different. > lm1 Call: lm(formula = y ~ x) Coefficients: (Intercept) x 0.1183 7.3075 > lm2 Call: lm(formula = y ~ x, weights = W) Coefficients: (Intercept) x 0.04193 7.30660 > lm3 Ca...
2009 Jun 17
2
glm binomial logit
Hi All, I am using "glm" function to build logistic regression. I noticed that glm function glm function is computing many other statistics which are not required for our analysis. As our dataset is very big and we have to run logistic regression on several samples the run time drastically increases if all those stat...
2010 May 03
2
Estimating theta for negative binomial model
Dear List, I am trying to do model averaging for a negative binomial model using the package AICcmodavg. I need to use glm() since the package does not accept glm.nb() models. I can get glm() to work if I first run glm.nb and take theta from that model, but is there a simpler way to estimate theta for the glm model? The two models are: mod.nb<-glm.nb(mantas~site,data=mydata) mod.glm<-glm(mantas~site,data=...
2011 Aug 24
1
How to do cross validation with glm?
Hi All, I have a fitted model called glm.fit which I used glm and data dat is my data frame pred= predict(glm.fit, data = dat, type="response") to predict how it predicts on my whole data but obviously I have to do cross-validation to train the model on one part of my data and predict on the other part. So, I searched for it...
2009 Jun 30
1
fitting in logistic model
I would like to know how R computes the probability of an event in a logistic model (P(y=1)) from the score s, linear combination of x and beta. I noticed that there are differences (small, less than e-16) between the fitting values automatically computed in the glm procedure by R, and the values "manually" computed by me applying the reverse formula p=e^s/(1+e^s); moreover I noticed that the minimum value of the fitting values in my estimation is 2.220446e-16, and there are many observation with this probability (instead the minimum value obtai...
2010 Jul 28
1
Variance-covariance matrix from GLM
Hello, Is there a way to obtain the variance-covariance matrix of the estimated parameters from GLM? my.glm<-glm(mat ~X,family = binomial, data =myDATA) out1<-predict(my.glm,se.fit = TRUE) std<-out1$se.fit se.fit is for getting the standard errors of the estimated parameters (\betas). Is there a way to get the variance-covariance matrix of the estimated parameters? Many thanks, Ba...
2003 Nov 24
2
statistical prediction for glm()
hello, I apologize that I poste this question again but I did not receive any replies on this topic and would like to know if the mail has been read over or if there is no method of statistical prediction computation for poisson errors in glm(). I am looking for a way to compute the model prediciton error of a glm() with poisson error family. cv.glm() does not work. (it prompts values around 90.00) A " not there isn't such a method" would be fine as well. Thanks in advance, Martin
2008 Jun 09
1
Cross-validation in R
Folks; I am having a problem with the cv.glm and would appreciate someone shedding some light here. It seems obvious but I cannot get it. I did read the manual, but I could not get more insight. This is a database containing 3363 records and I am trying a cross-validation to understand the process. When using the cv.glm, code below, I get me...
2008 Oct 14
1
library MICE warning message
...t of type 'double' to logical 11: In any(predictorMatrix[, j]) ... : coercing argument of type 'double' to logical 12: In any(predictorMatrix[j, ]) ... : coercing argument of type 'double' to logical 13: In eval(expr, envir, enclos) ... : non-integer #successes in a binomial glm! 14: In eval(expr, envir, enclos) ... : non-integer #successes in a binomial glm! 15: In eval(expr, envir, enclos) ... : non-integer #successes in a binomial glm! 16: In eval(expr, envir, enclos) ... : non-integer #successes in a binomial glm! 17: In eval(expr, envir, enclos) ... : non-integer #suc...
2011 Aug 01
2
GLM & ANOVA
Hola a todos, Estoy trabajando con modelos lineales generalizados (GLM), en particular con las funciones glm y anova.glm de R. Tengo una pregunta que es más bien técnica en el sentido estadístico (y un poco Off Topic y probablemente un tanto naive). No tengo claro si es correcto decir análisis de varianza o de devianza al utilizar GLMs, veo que en el help de anova.gl...
2007 Oct 02
1
problems with glm
I am having a couple of problems someone may be able to cast some light on. Question 1: I am making a logistic model but when i do this: glm.model = glm(as.factor(form$finished) ~ ., family=binomial, data=form[1:150000,]) I get this: Error in model.frame(formula, rownames, variables, varnames, extras, extranames, : variable lengths differ (found for 'barrier') which is very strange because when I name the predictiv...
2010 Apr 16
2
Weights in binomial glm
I have some questions about the use of weights in binomial glm as I am not getting the results I would expect. In my case the weights I have can be seen as 'replicate weights'; one respondent i in my dataset corresponds to w[i] persons in the population. From the documentation of the glm method, I understand that the weights can indeed be used for this...
2004 Oct 04
2
call step inside a function
...6 4 5 1 3 6 1 7 7 2 10 8 3 10 9 1 8 10 1 8 11 3 6 12 1 9 13 1 5 14 1 1 15 3 13 16 1 2 17 2 2 18 7 11 19 1 3 20 5 4 21 1 6 22 4 9 23 1 6 24 4 5 25 5 5 26 2 6 > program function(dataset) { tmp<-glm(weta~1, family=poisson, data=dataset) tmp.f<-step(tmp,~.+jd) } When I run program(data) in 1.9.0, an error message appears: Error in model.frame.default(formula = WETA ~ jd, data = dataset, drop.unused.levels = TRUE) : Object "dataset" not found Thanks for help...
2012 Nov 06
1
glm fitting routine and convergence
What kind of special magic does glm have? I'm working on a logistic regression solver (L-BFGS) in c and I've been using glm to check my results. I came across a data set that has a very high condition number (the data matrix transpose the data matrix) that when running my solver does not converge, but the same data set with...