I am fitting the following:
offspring.survival_STAB <-glmulti(ST~ STAB + Age + BS+ BSP + Sex,
data=ST,
exclude="BS:BSP",
level=2,
fitfunc=glm,
crit="aicc",
family = Gamma(link = "inverse"),
method = "h")
The ain of this code is to get all the possible interactions excluding the interaction "BS:BSP".
However I get this error when I add exclude=c() in the formula:
Error in glmulti(ST ~ STAB + Age + BS + BSP + Sex, data = ST, exclude = "BS:BSP", :
Improper call of glmulti.
Am I missing something about exclude=c()? Is another way to specify interactions terms in 'glmulti'?
glmulti
does not take a formula as input. You specify the regression model by text arguments:From the docs at https://www.rdocumentation.org/packages/glmulti/versions/0.5-1/topics/glmulti
From the comments it seems
glmulti
does not work one way or the other. Then there is doing it yourself!This function takes a data frame and constructs an equation with all main effects and all pair-wise interactions, except those given as an argument. It assumes the left-hand side is in column 1 and that the remaining columns constitute the right-hand predictors. Accomodate the code as you wish: