Dear List,

I want to ask a AIC question based on package library(MuMIn)

The relative importance of 16 explanatory variables

are assessed using delta AIC in a generalized linear model.


Please kindly advise if it is possible to show models

with any two only certain variables.

Thank you.


Elaine

I asked a similar question and got a great help for models

with only one variable as below.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In effect, you want

data(Cement)
lm1 <- lm(y ~ ., data = Cement)
dd <- dredge(lm1, subset = X1)

want <- with(dd, is.na(X) & is.na(X2) & is.na(X3) & is.na(X4))
want
## how many models selected?
sum(want)
## OK selected just 1, show it
dd[want, , drop = FALSE]

Oh, actually, I suppose you could automate this, so it will return all
models with single variable:

dd <- dredge(lm1)
parms <- !is.na(dd[, -c(1, (ncol(dd) - c(0:7)))])
want <- which(rowSums(parms) == 1)
dd[want, ]

Having said all this, I don't think this is a good way to do model
selection.

G

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to