Displaying 20 results from an estimated 5000 matches similar to: "R stepping through multiplie interactions"
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
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 follows: two sets
2012 Oct 30
2
error in lm
Hi everybody
I am trying to run the next code but I have the next problem
Y1<-cbind(score.sol, score.com.ext, score.pur)
> vol.lm<-lm(Y1~1, data=vol14.df)
> library(MASS)
> stepAIC(vol.lm,~fsex+fjob+fage+fstudies,data=vol14.df)
Start: AIC=504.83
Y1 ~ 1
Error in addterm.mlm(fit, scope$add, scale = scale, trace = max(0, trace -
:
no addterm method implemented for
2008 Aug 01
5
drop1() seems to give unexpected results compare to anova()
Dear all,
I have been trying to investigate the behaviour of different weights in
weighted regression for a dataset with lots of missing data. As a start
I simulated some data using the following:
library(MASS)
N <- 200
sigma <- matrix(c(1, .5, .5, 1), nrow = 2)
sim.set <- as.data.frame(mvrnorm(N, c(0, 0), sigma))
colnames(sim.set) <- c('x1', 'x2') # x1 & x2 are
2012 Feb 08
2
dropterm in MANOVA for MLM objects
Dear R 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
2017 Oct 27
2
Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing
Hello Tyler,
I want to bring to your attention the following document: "What
happens if you omit the main effect in a regression model with an
interaction?" (https://stats.idre.ucla.edu/stata/faq/what-happens-if-you-omit-the-main-effect-in-a-regression-model-with-an-interaction).
This gives a useful review of the problem. Your example is Case 2: a
continuous and a categorical regressor.
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^2)
Df Sum
2007 Jul 31
2
choosing between Poisson regression models: no interactions vs. interactions
R gurus,
I'm working on data analysis for a small project. My response
variable is total vines per tree (median = 0, mean = 1.65, min = 0,
max = 24). My predictors are two categorical variables (four sites
and four species) and one continuous (tree diameter at breast height
(DBH)). The main question I'm attempting to answer is whether or not
the species identity of a tree has
2010 Apr 07
1
Step by significance
Does anybody know how to perform a step function by significance of p instead
of AIC? I want to perform a forward-backward stepwise logistic regression
and want to compare the results obtained by steps of significance and by
steps of AIC. Thank you
--
View this message in context: http://n4.nabble.com/Step-by-significance-tp1754237p1754237.html
Sent from the R help mailing list archive at
2009 May 07
1
Step and stepAIC
Hi all,
I’m using "step" and "stepAIC" for stepwise regression. After each step, I would like to make an additional calculation based on the independent variables that have been selected until this step and their corresponding weights. Where do I have to add this calculation?
And a second question: Is it possible, to define a certain limit of factors for the regression,
2017 Nov 02
2
Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing
Hello Tyler,
Thank you for searching for, and finding, the basic description of the
behavior of R in this matter.
I think your example is in agreement with the book.
But let me first note the following. You write: "F_j refers to a
factor (variable) in a model and not a categorical factor". However:
"a factor is a vector object used to specify a discrete
classification"
2002 Nov 05
1
add1 in glm
I'm having a bit of difficulty using the stepwise model-building tools
in a glm context. Here, for example is one problem I have had using
add1, where the abbreviation "." does not work as I expected it to do. I
someone could point me towards some examples involving the interactive
building of glm models I would be grateful.
The data set that I am using is the
2003 Jun 25
2
probelem of function inside function
Hi,
I encountered a problem when I am trying to write my
own function which contains another function. To
simplify a problem, I tried the following simplified
function, hope someone can idenfity the problem for
me.
I have a simple data frame called "testdata" as
following:
>
2017 Aug 23
0
MASS:::dropterm.glm() and MASS:::addterm.glm() should use ... for extractAIC()
Hi,
I have sent this message to this list the July, 7th. It was about a
problem in MASS package.
Until now there is no change in the devel version.
As the problem 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
2017 Nov 04
2
Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing
Hello Tyler,
I rephrase my previous mail, as follows:
In your example, T_i = X1:X2:X3. Let F_j = X3. (The numerical
variables X1 and X2 are not encoded at all.) Then T_{i(j)} = X1:X2,
which in the example is dropped from the model. Hence the X3 in T_i
must be encoded by dummy variables, as indeed it is.
Arie
On Thu, Nov 2, 2017 at 4:11 PM, Tyler <tylermw at gmail.com> wrote:
> Hi
2005 Aug 15
2
stepAIC invalid scope argument
I am trying to replicate the first example from stepAIC from the MASS
package with my own dataset but am running into error. If someone can
point where I have gone wrong, I would appreciate it very much.
Here is an example :
set.seed(1)
df <- data.frame( x1=rnorm(1000), x2=rnorm(1000), x3=rnorm(1000) )
df$y <- 0.5*df$x1 + rnorm(1000, mean=8, sd=0.5)
# pairs(df); head(df)
lo <-
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,
2002 Sep 12
1
dropterm, binomial.glm, F-test
Hi there -
I am using R1.5.1 on WinNT and the latest MASS (Venables and Ripley) library.
Running the following code:
>minimod<-glm(miniSF~gtbt*f.batch+log(mxjd),data=gtbt,family="binomial")
>summary(minimod,cor=F)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.91561 0.32655 2.804 0.005049 **
gtbtgt 0.47171
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.
2017 Nov 06
2
Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing
Hello Tyler,
You write that you understand what I am saying. However, I am now at
loss about what exactly is the problem with the behavior of R. Here
is a script which reproduces your experiments with three variables
(excluding the full model):
m=expand.grid(X1=c(1,-1),X2=c(1,-1),X3=c("A","B","C"))
model.matrix(~(X1+X2+X3)^3-X1:X3,data=m)