[R] Model Selection with Phylogenetic Independent Contrasts
Ben Bolker
bbolker at gmail.com
Thu Sep 15 18:04:23 CEST 2011
rjswift <rosejswift <at> gmail.com> writes:
>
> I'm trying to select a model under PCA using independent contrasts. Since
> PICs need to be forced through the origin I've been using lmorigin for the
> original regression, but it doesn't appear that stepAIC recognizes it. I
> keep receiving an error message - "Error in na.fail.default(list(Phenology =
> c(NA_integer_, NA_integer_, :
> missing values in object"
>
> I'm having trouble navigating around this error message, and any suggestions
> would be appreciated.
>
Do you mean "select a model under PIC"?
I think you'll be better off posting this to the r-sig-phylo at r-project.org
mailing list.
lmorigin() [which is in the ape package] is a special-purpose function;
the tricky part about fitting regressions through the origin is not
fitting them (adding a -1 or a +0 to a model formula does that easily)]
but making inferences about the resulting model.
Depending on how you want to proceed, you can:
1. examine the permutation p-values produced by lmorigin() and
do your stepwise procedure by hand;
2. fit through the origin using lm(y~...-1,...) and use stepAIC
as usual
However, I'm not sure which of this will be *correct* -- you're likely
to get wiser comments on r-sig-phylo. In any case, beware stepwise
fitting approaches!
More information about the R-help
mailing list