Skip to content
Prev 141949 / 398498 Next

glm syntax question

Henrique Dallazuanna from Curitiba writes:
[snip]
[snip]
~ "))
OK this works for fitting models, but it has a big drawback in that if
you get rid of the variable 'form' you cannot predict from it.  The
fitted model object comes in two bits and that's not a good idea.

You can repair things in a fairly ugly way, namely 

out$call$formula <- form

and the trap is unset once more.  This really points to the need for a
generic function, "formula<-", to make this a more natural and safer
operation itself.  It would not be needed all that often, though...
(which
This is a bit picky, but I would use the column label to make clear
which one I wanted:

SigVars <- summary(out)$coefficients[, "P(>|z|)", drop = FALSE]
rownames(SigVars)[SigVars < 0.001]

The drop = FALSE ensures it stays as a matrix, keeping its row names,
as presumably you want to know which ones are significant by name.
.
Bill Venables.