search for: dropterm

Displaying 20 results from an estimated 47 matches for "dropterm".

2008 Feb 10
2
Do I need to use dropterm()??
Hello, I'm having some difficulty understanding the useage of the "dropterm()" function in the MASS library. What exactly does it do? I'm very new to R, so any pointers would be very helpful. I've read many definitions of what dropterm() does, but none seem to stick in my mind or click with me. I've coded everything fine for an interaction that runs as fo...
2009 Jan 29
1
Inconsistency in F values from dropterm and anova
Hi, I'm working on fitting a glm model to my data using Gamma error structure and reciprocal link. I've been using dropterm (MASS) in the model simplification process, but the F values from analysis of deviance tables reported by dropterm and anova functions are different - sometimes significantly so. However, the reported residual deviances, degrees of freedom, etc. are not different. I don't know how to calculat...
2002 Oct 04
1
dropterm in a function
I'm trying to use 'dropterm' (from MASS) in a function along the lines run <- function(dat){ fit <- (something)(Y ~ (something), data = dat) lr <- dropterm(fit, test = "Chisq") return(fit, lr) } but running 'run' I get (those scoping rules again...?) Error in terms.formula(formula, spec...
2002 Sep 12
1
dropterm, binomial.glm, F-test
...*' 0.05 `.' 0.1 ` ' 1 (Dispersion parameter for binomial family taken to be 1) Null deviance: 4117.4 on 14 degrees of freedom Residual deviance: 4053.1 on 10 degrees of freedom AIC: 4131.3 >anova(minimod,test="Chisq") >anova(minimod,test="F") >dropterm(minimod,test="Chisq") >dropterm(minimod,test="F") produces the following, suggesting that the anova function does not deal with the F-test for quasibinomial family.... should it or is dropterm() doing something odd? cheers, andrew > anova(minimod,test="Chisq&qu...
2017 Aug 23
0
MASS:::dropterm.glm() and MASS:::addterm.glm() should use ... for extractAIC()
...m occurs in a package and not in the R-core, I don't know if the message should have been sent here. Anyway, I have added a copy to Pr Ripley. I hope it could have been fixed. Sincerely Marc Le 09/07/2017 ? 16:05, Marc Girondot via R-devel a ?crit?: > Here is a change required from MASS:::dropterm.glm() and > MASS:::addterm.glm(). > > Thanks > > Marc > > > The stepAIC() function from package MASS uses extractAIC() to get the > AIC from a model. > Several methods exist: > extractAIC.glm() for example, some in MASS packages and some in stats > package. &g...
2012 Feb 08
2
dropterm in MANOVA for MLM objects
...fans, I have got a difficult sounding problem. For fitting a linear model using continuous response and then for re-fitting the model after excluding every single variable, the following functions can be used. library(MASS) model = lm(perf ~ syct + mmin + mmax + cach + chmin + chmax, data = cpus) dropterm(model, test = "F") But I am not sure whether any similar functions is available in R for multivariate data with categorical response. My data looks like the following: mat <- matrix(rnorm(700), ncol=5, dimnames=list( paste("f", c(1:140), sep="_"), c("A"...
2007 Jun 27
1
stepAIC on lm() where response is a matrix..
dear R users, I have fit the lm() on a mtrix of responses. i.e M1 = lm(cbind(R1,R2)~ X+Y+0). When i use summary(M1), it shows details for R1 and R2 separately. Now i want to use stepAIC on these models. But when i use stepAIC(M1) an error message comes saying that dropterm.mlm is not implemented. What is the way out to use stepAIC in such cases. regards, ____________________________________________________________________________________ The fish are biting.
2002 Apr 28
2
dropterm() in MASS
To compare two different models, I've compared the result of using dropterm() on both. Single term deletions Model: growth ~ days + I(days^0.5) Df Sum of Sq RSS AIC <none> 2.8750 -0.2290 days 1 4.8594 7.7344 4.6984 I(days^0.5) 1 0.0234 2.8984 -2.1722 AND Single term deletions Model: growth ~ days + I(days...
2017 Jun 08
1
stepAIC() that can use new extractAIC() function implementing AICc
I would like test AICc as a criteria for model selection for a glm using stepAIC() from MASS package. Based on various information available in WEB, stepAIC() use extractAIC() to get the criteria used for model selection. I have created a new extractAIC() function (and extractAIC.glm() and extractAIC.lm() ones) that use a new parameter criteria that can be AIC, BIC or AICc. It works as
2002 Apr 01
0
something confusing about stepAIC
Folks, I'm using stepAIC(MASS) to do some automated, exploratory, model selection for binomial and Poisson glm models in R 1.3. Because I wanted to experiment with the small-sample correction AICc, I dug around in the code for the functions glm.fit stepAIC dropterm.glm addterm.glm extractAIC.glm and came across something I just don't understand. stepAIC() passes dropterm.glm() a model object. dropterm.glm() then fits a number of submodels, computing for each some measure DeltaFit of the relative change in goodness of fit. It then returns to stepAIC() w...
2011 Aug 15
1
update() ignores object
Hi all, I'm extracting the name of the term in a regression model that dropterm specifies as the least significant one, and I'm assigning this name to an object. However, when I use update(), it ignores this object. Is there a way I can make it not ignore it? A reproducible example is below: > lm(x1~1+y1*y2+y3+y4,data=anscombe)->my.lm > rownames(dropterm(my.lm,te...
2007 Mar 13
3
inconsistent behaviour of add1 and drop1 with a weighted linear model
...35.371 17.012 x1 1 18.576 16.794 9.329 > drop1(update(model,.~.+x1))#this or... Single term deletions Model: y ~ x2 + x1 Df Sum of Sq RSS AIC <none> 14.456 7.380 x2 1 15.708 30.164 14.942 #{4}# x1 1 23.466 37.922 17.918 #{2}# > dropterm(update(model,.~.+x1))#...this Single term deletions Model: y ~ x2 + x1 Df Sum of Sq RSS AIC <none> 14.456 7.380 x2 1 15.708 30.164 14.942 x1 1 23.466 37.922 17.918 #and the same thing happens with the x2 variable - compare below with above > ad...
2008 Sep 30
2
weird behavior of drop1() for polr models (MASS)
I would like to do a SS type III analysis on a proportional odds logistic regression model. I use drop1(), but dropterm() shows the same behaviour. It works as expected for regular main effects models, however when the model includes an interaction effect it seems to have problems with matching the parameters to the predictor terms. An example: library("MASS"); options(contrasts = c("contr.treatment&...
2009 May 05
0
stepAICc function (based on MASS:::stepAIC.default)
Dear all, I have tried to modify the code of MASS:::stepAIC.default(), dropterm() and addterm() to use AICc instead of AIC for model selection. The code is appended below. Somehow the calculations are still not correct and I would be grateful if anyone could have a look at what might be wrong with this code... Here is a working example: ## require(nlme) model1=lme(distance...
2009 Jan 28
1
StepAIC with coxph
Hi, i'm trying to apply StepAIC with coxph...but i have the same error: stepAIC(fitBMT) Start: AIC=327.77 Surv(TEMPO,morto==1) ˜ VOD + SESSO + ETA + ........ Error in dropterm.default(fit,scope$drop, scale=scale,trace=max(0, : number of rows in use has changed: remove missing values? anybody know this error?? Thanks. Michele [[alternative HTML version deleted]]
2011 Jun 20
1
Stepwise model comparisons for mlogit
I am trying to perform a backwards stepwise variable selection with an mlogit model. The usual functions, step(), drop1(), and dropterm() do not work for mlogit models. Update() works but I am only able to use it manually, i.e. I have to type in each variable I wish to remove by hand on a separate line. My goal is to write some code that will systematically remove a certain set of variables one at a time and compare the AIC o...
2009 Feb 18
1
using stepAIC with negative binomial regression - error message help
...I use stepAIC on the model I get the message:   > stepAIC(glm.nb.full) Start:  AIC=19240.46 mantas ~ site + year + cosday + sinday + daylength + lunarpercent +     sstmean + sststd + sshmean + sshstd + cosdir + sindir + spd +     temp + alt + tideht + high + falling + low + plankton   Error in dropterm.default(object, ...) :   number of rows in use has changed: remove missing values?       I know some of my predictors are missing values for certain dates.  I assume this is what “number of rows in use has changed” means.  Must I remove all rows that are missing values?  Or is there an option that...
2007 May 24
4
Function to Sort and test AIC for mixed model lme?
Hi List I'm running a series of mixed models using lme, and I wonder if there is a way to sort them by AIC prior to testing using anova (lme1,lme2,lme3,....lme7) other than by hand. My current output looks like this. anova (lme.T97NULL.ml,lme.T97FULL.ml,lme.T97NOINT.ml,lme.T972way.ml,lme.T97fc. ml, lme.T97ns.ml, lme.T97min.ml) Model df AIC BIC logLik
2008 Feb 11
0
Testing for differecnes between groups, need help to find the right test in R. (Kes Knave)
...) 2. Testing for differecnes between groups, need help to find the right test in R. (Kes Knave) 3. Using 'sapply' and 'by' in one function (David & Natalia) 4. Re: Using 'sapply' and 'by' in one function (Gabor Grothendieck) 5. Do I need to use dropterm()?? (DaniWells) 6. Re: Using 'sapply' and 'by' in one function (Gabor Grothendieck) 7. Re: R on Mac PRO does anyone have experience with R on such a platform ? (Rod) 8. Re: Do I need to use dropterm()?? (Bernard Leemon) 9. Re: Which package should I use if I estima...
2003 Mar 06
6
type III Sum Sq in ANOVA table - Howto?
Hello, as far as I see, R reports type I sums of squares. I'd like to get R to print out type III sums of squares. e.g. I have the following model: vardep~factor1*factor2 to get the type III sum of squares for factor1 I've tried anova(lm(vardep~factor2+factor1:factor2),lm(vardep~factor1*factor2)) but that didn't yield the desired result. Could anyone give me a hint how to proceed?