search for: glm

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

Did you mean: gem
2010 May 19
8
Generating all possible models from full model
...s worried that I am missing models or have made a mistake somewhere. It is also difficult to alter models if I want to change a term. For example, below are the set of models I would like to run. Is there a way to specify the full model and have R generate the rest? I.e. specify m1234567<-glm.convert(glm.nb(mantas~site*year+cosmonth+sinmonth+coslunar+sinlunar+plankton, data=mydata)) and have R run all the other models. library(MASS) #Intercept only m0<-glm.convert(glm.nb(mantas~1,data=mydata)) #One term - 7 models #Manta abundance is greater at one of the two sites m1<...
2006 Jun 14
4
a new way to crash R? (PR#8981)
Dear R Team, First, thank you for incredibly useful software! Now the bad news: The attached script (or the original version with real data) will reliably crash R on my machine. I am using: R version: either 2.2.1 or 2.3.1 Windows 2000 Professional, Service Pack 4 512 MB of RAM On my machine the script will crash R on line 42 [ probits21 <- lapply(... ]. In both this script and the
2008 Sep 03
1
test if all predictors in a glm object are factors
I'm trying to develop some graphic methods for glm objects, but they only apply for models where all predictors are discrete factors. How can I test for this in a function, given the glm model object? That is, I want something that will serve as an equivalent of is.discrete.glm() in the following context: myplot.glm <- function(model, ...)...
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: > ho...
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...
2010 Aug 01
1
Modifying glm.fit() / execution path
Hello all, I'm sure I'm missing something simple here, but I can't figure out how to modify the glm.fit() function and then get R to use it (sort of). I'm doing something along the lines of: glm.fit<-edit(glm.fit) # add something trivial to the top of the glm.fit function like: print("Hello world!") #now have a modified glm.fit in position 1/.GlobalEnv x<-rnorm(20) y<-rn...
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...
2011 Feb 08
1
Error in example Glm rms package
Hi all! I've got this error while running example(Glm) library("rms") > example(Glm) Glm> ## Dobson (1990) Page 93: Randomized Controlled Trial : Glm> counts <- c(18,17,15,20,10,20,25,13,12) Glm> outcome <- gl(3,1,9) Glm> treatment <- gl(3,3) Glm> f <- glm(counts ~ outcome + treatment, family=poisson())...
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", &quo...
2010 Mar 16
3
function arguments: name of an object vs. call producing the object?
In a function, say foo.glm for glm objects I want to use the name of the object as a label for some output, but *only* if a glm object was passed as an argument, not a call to glm() producing that object. How can I distinguish these two cases? For example, I can use the following to get the name of the argument: foo.glm...
2011 Jan 28
2
help with S4 objects: trying to use a "link-glm" as a class in an object definition
Hi, I'm trying to make a new S4 object with a slot for a "link-glm" object. R doesn't like me have a slot of class "link-glm" > class(make.link("probit")) [1] "link-glm" > setClass("a",representation(item="link-glm")) [1] "a" Warning message: undefined slot classes in definition of "a...
2005 Nov 28
3
glm: quasi models with logit link function and binary data
# Hello R Users, # # I would like to fit a glm model with quasi family and # logistical link function, but this does not seam to work # with binary data. # # Please don't suggest to use the quasibinomial family. This # works out, but when applied to the true data, the # variance function does not seams to be # appropriate. # # I couldn'...
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...
2009 Dec 07
5
confint for glm (general linear model)
Hi, I have a glm gives summary as follows, Estimate Std. Error z value Pr(>|z|) (Intercept) -2.03693352 1.449574526 -1.405194 0.159963578 A 0.01093048 0.006446256 1.695633 0.089955471 N 0.41060119 0.224860819 1.826024 0.067846690 S...
2002 Mar 29
1
glm start/offset bugs (PR#1422)
--fupGvOGOQM Content-Type: text/plain; charset=us-ascii Content-Description: message body and .signature Content-Transfer-Encoding: 7bit There's a simple bug in the handling of the start and offset arguments in glm and glm.fit. The bug exists in the latest development version of R (version information below), but it appears that glm.R has not been touched much lately, so the bug affects at least the most recent stable release of R. Here is a simple example: > data(ships, package=MASS) > ships.glm &lt...
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) >...
2003 Aug 19
3
logistic regression without intercept
I want to do a logistic regression without an intercept term. This option is absent from glm, though present in some of the inner functions glm uses. I gather glm is the standard way to do logistic regression in R. Hoping it would be passed in, I said > r <- glm(brain.cancer~epilepsy+other.cancer, c3, > family=binomial(link="logit"), intercept=FALSE) which prod...
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 Jun 02
2
Sweave glm.fit
Dear R users, After running Sweave, this is what I get : Warning messages: 1: glm.fit: algorithm did not converge 2: glm.fit: algorithm did not converge There is no glm.fit function in my code. Where does it come from ? From Sweave ? From system.time ? Thanks for your help, Jimmy [[alternative HTML version deleted]]
2000 Jan 10
5
bug in glm (PR#397)
Dear R-team As I didn't get any answer to my bug-report last week I have taken the effort and extracted a minimal data set from my data (see below) where the following bug occurs: > glm(SKR.ein.aus ~ ., family = binomial, data = bugdata, na.action = na.omit) Error in names<-.default(*tmp*, value = ynames) : names attribute must be the same length as the vector In addition: Warning messages: 1: fitted probabilities of 0 or 1 occurred in: (if (is.empty.model(mt)) glm.fit.null el...