search for: glmfit

Displaying 20 results from an estimated 24 matches for "glmfit".

Did you mean: lmfit
2005 Jul 25
5
passing formula arguments cv.glm
...at deals with leave-one-out-cross-validation (LOOCV) for a logistic model. This wrapper will be used as part of a bigger program. Here is my wrapper funtion : logistic.LOOCV.err <- function( formu=NULL, data=NULL ){ cost.fn <- function(cl, pred) mean( abs(cl-pred) > 0.5 ) glmfit <- glm( formula=formu, data=data, family="binomial" ) print("glmfit is OK") err <- cv.glm( data=data, glmfit=glmfit, cost=cost.fn, K=nrow(data) )$delta[2] print("cv.glm OK") } When I run the above function line by...
2012 Jun 19
1
Error when trying to update cpglm model
...t)               mu<-as.vector(exp(X%*%beta))         phi<-1; p<-1.6                dat$resp<-rtweedie(nrow(dat),p,mu,phi) ## cpglm model modPC1<-cpglm(resp~period,data=dat) head(modPC1@model.frame) ## Simulating new response vector and re-fitting the model sim.hnp<-function(glmfit){   dat.1<-glmfit@model.frame   n<-nrow(dat.1)   dat.1[,1]<-rtweedie(n,glmfit$p,fitted(glmfit),glmfit$phi)      mfun<-update(object=glmfit,data=dat.1)   # rp<-resid(mfun,type='pearson')   # sort(abs(rp)) } sim.hnp(modPC1) # Error in is.data.frame(data) : object 'dat.1...
2007 Feb 23
1
Bootstrapping stepAIC() with glm.nb()
...pdate(object, data = data[index[, i], ]) res[[i]] <- stepAIC(up.obj, trace = FALSE) } res } #################### library(MASS) # 'glm' objects x1 <- runif(100, -4, 4) x2 <- runif(100, -4, 4) y <- 1 + 2 * x1 + rnorm(100, sd = 3) dat <- data.frame(y, x1, x2) glmFit <- glm(y ~ x1 + x2, data = dat) fn(glmFit, data = dat) # 'aov' objects quine.hi <- aov(log(Days + 2.5) ~ .^4, quine) fn(quine.hi, data = quine) However, for "negbin" objects returned by glm.nb() the following problem occurs: quine.nb <- glm.nb(Days ~ .^4, data = quin...
2007 Jan 26
0
R crash with modified lmer code
...(method %in% c("ML", "REML")) method <- "Laplace" if (method == "AGQ") stop("method = \"AGQ\" not yet implemented for supernodal representation") if (method == "PQL") cv$usePQL <- TRUE glmFit <- glm.fit(X, Y, weights = weights, offset = offset, family = family, intercept = attr(mt, "intercept") > 0) Y <- as.double(glmFit$y) mer <- .Call(mer_create, fl, Zt, X, Y, 0, nc, cnames) if (!is.null(start)) mer <- setOmega(mer, s...
2005 Nov 08
1
Interpretation of output from glm
...r is LT (I expect a logistic relation between LT and the probability of being mature) and the other are variables I expect to modify this relation. I want to test if all predictors contribute significantly for the fit or not I fit the full model, and get these results > summary(HMMaturation.glmfit.Full) Call: glm(formula = Mature ~ LT + CondF + Biom + LT:CondF + LT:Biom, family = binomial(link = "logit"), data = HMIndSamples) Deviance Residuals: Min 1Q Median 3Q Max -3.0983 -0.7620 0.2540 0.7202 2.0292 Coefficients: Estimate Std...
2009 Aug 26
3
tweedie and lmer
...family of distributions could be used to fit a model with random effects. Upon installing the tweedie package and attempting to fit the following model: lmer(SUS ~ 1 + (1| GRP),REML=FALSE,data=mydata,family=tweedie(var.power=1.55,link.power=0)) I get the following error: Error in famType(glmFit$family) : unknown GLM family: ?Tweedie? If it helps, im on a mac with R V 2.9.1, lme4 V.0.999375-31, Tweedie V2.0. Thanks, Mohammad AlMarzouq
2012 Feb 01
3
Probit regression with limited parameter space
Dear R helpers, I need to estimate a probit model with box constraints placed on several of the model parameters. I have the following two questions: 1) How are the standard errors calclulated in glm (family=binomial(link="probit")? I ran a typical probit model using the glm probit link and the nlminb function with my own coding of the loglikehood, separately. As nlminb does not
2011 Aug 20
2
a Question regarding glm for linear regression
...a question about glm in R. I would like to fit a model with glm function, I have a vector y (size n) which is my response variable and I have matrix X which is by size (n*f) where f is the number of features or columns. I have about 80 features, and when I fit a model using the following formula,? glmfit = glm(y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x10 + x11 + x12 + x13 + x14 + x15 + x16 + x17 + x18 + x19 + x20 + x21 + x22 + x23 + x24 + x25 + x26 + x27 + x28 + x29 + x30 + x31 + x32 + x33 + x34 + x35 + x36 + x37 + x38 + x39 + x40 + x41 + x42 + x43 + x44 + x45 + x46 + x47 + x48 + x49 + x50...
2012 Apr 02
7
Calculating NOEL using R and logistic regression - Toxicology
Hello, I used the glm function in R to fit a dose-response relationship and then have been using dose.p to calculate the LC50, however I would like to calculate the NOEL (no observed effect level), ie the lowest dose above which responses start occurring. Does anyone know how to do this? [[alternative HTML version deleted]]
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 hint christoph $platform [1] "i686-pc-linux-gnu" $arch [1]
2009 Oct 22
1
What happen for Negative binomial link in Lmer fonction?
Dear R users, I'm performing some GLMMs analysis with a negative binomial link. I already performed such analysis some months ago with the lmer() function but when I tried it today I encountered this problem: Erreur dans famType(glmFit$family) : unknown GLM family: 'Negative Binomial' Does anyone know if the negative binomial family has been removed from this function? I really appreciate any response. Emmanuelle [[alternative HTML version deleted]]
2009 Oct 26
1
What happen for negative binomail link in lmer() fonction?
Dear R users, I’m performing some GLMMs analysis with a negative binomial link. I already performed such analysis some months ago with the lmer() function but when I tried it today I encountered this problem: *Erreur dans famType(glmFit$family) : unknown GLM family: ‘Negative Binomial’* Does anyone know if the negative binomial family has been removed from this function? I really appreciate any response. Emmanuelle [[alternative HTML version deleted]]
2009 Oct 29
1
lmer and negative binomial family
...inter+saison+milieu*zone+(1|code),family=neg.bin(0.451),REML=TRUE,data=manu) But now (R version 2.9.2 and lme4 version 0.999375-32), that gives (even with the library MASS loaded): m1a<-lmer(mapos~ninter+saison+milieu*zone+(1|code),family=neg.bin(0.451),REML=TRUE,data=manu) Error in famType(glmFit$family) : unknown GLM family: 'Negative Binomial' Any idea about what happens ? Patrick [[alternative HTML version deleted]]
2011 Aug 28
1
Trying to extract probabilities in CARET (caret) package with a glmStepAIC model
...t; classProbs = TRUE," in the trainControl. Thereafter everytime I run train I get this message: "undefined columns selected" I copy the syntax: fitControl <- trainControl(method = "cv", number = 10, classProbs = TRUE,returnResamp = "all", verboseIter = FALSE) glmFit <- train(Descr, Categ, method = "glmStepAIC",tuneLength = 4,trControl = fitControl) Thank you. Best regards, Jon Toledo, MD Postdoctoral fellow University of Pennsylvania School of Medicine Center for Neurodegenerative Disease Research 3600 Spruce Street 3rd Floor Maloney Building Ph...
2013 Nov 21
0
Cost function in cv. glm for a fitted logistic model when cutoff value of the model is not 0.5
I have a logistic model fitted with the following R function: glmfit<-glm(formula, data, family=binomial) A reasonable cutoff value in order to get a good data classification (or confusion matrix) with the fitted model is 0.2 instead of the mostly used 0.5. And I want to use the `cv.glm` function with the fitted model: cv.glm(data, glmfit, cost, K) Since...
2012 Apr 03
0
Off Topic: Re: Calculating NOEL using R and logistic regression - Toxicology
...ated example: >> >> set.seed(101) >> X = rep(1:10,each=10) >> lp = -5 + 0.5*X >> Y = rbinom(length(X),size=1,p=1/(1+exp(-lp))) >> # is this the NOEL? >> min(X[Y==1]) # picks out observations with adverse effects, chooses the >> smallest value >> glmfit = glm(Y~X,family=binomial) >> plot(1:10, predict(glmfit,newdata=data.frame(X=1:10),type="response"), >> type="l",ylim=c(0,1),xlab="X",ylab="Y") >> rug(jitter(X[Y==0]),side=1) >> rug(jitter(X[Y==1]),side=3) >> >> On Tue, Apr...
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
2004 Apr 06
1
Storing p-values from a glm
...ample one could do it this way: v <- summary(fit)$coefficients[,4] the coefficient attribute is a matrix, and with the "4" you refere to the pvalue (at least in lm - don't know if summary(glm) produces sligthely different output). to skip the intercept (1st row): v <- summary(glmfit)$coefficients[-1,4] hope this helps, Arne -- Arne Muller, Ph.D. Toxicogenomics, Aventis Pharma arne dot muller domain=aventis com > -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Roy Sanderson > Sen...
2008 Mar 25
0
Behaviour of interactions in glm
...d 10,000 records and about 30 columns). So, I've prepared my data using something similar to: glmdata <- read.table("C:\\MyData.csv", sep=",", header=TRUE) glmdata$FactorA <- C(factor(glmdata$FactorA),base=1) glmdata$FactorB <- C(factor(glmdata$FactorB),base=2) glmfit <- glm(Response ~ 1 + FactorA:FactorB, family=(Gamma( link="log")), weights = Weight, data=glmdata) After some playing around, I've found I get slightly different results with FactorA*FactorB, FactorA+FactorB+FactorA:FactorB, FactorA:FactorB - but whatever I do I always get 6 c...
2009 Nov 04
1
What happen for Negative binomial link in Lmer
...R users, >> >> I'm performing some GLMMs analysis with a negative binomial link. >> >> I already performed such analysis some months ago with the lmer() >> >> function but when I tried it today I encountered this problem: >> >> Erreur dans famType(glmFit$family) : unknown GLM family: 'Negative >> >> Binomial' >> >> >> >> Does anyone know if the negative binomial family has been removed from >> >> this function? >> >> I really appreciate any response. >> >> Emmanuelle &...