[R] How to incorporate interaction terms in MRM function of ecodist library?
Sarah Goslee
sarah.goslee at gmail.com
Mon Feb 27 21:28:18 CET 2012
Hi,
On Mon, Feb 27, 2012 at 2:28 PM, Hossm_R <hossamesapres at gmail.com> wrote:
> Hi,
>
> I'm interested in incorporating some interaction terms between my
> explanatory variables (distance matrices in this case) when I'm using the
> function MRM of the package ecodist. The function is doing a multiple
> regression on distance matrices.
MRM() will not process interaction terms.
You can use R's regular regression methods to get estimates of the
coefficients, but statistical significance from those methods is
unusable in this case.
I can get the function to work perfectly on
> my explanatory matrices by adding a (+) sign as known. However, when I try
> to use the (*) sign or (:) between two terms that I'd like to check the
> interaction for, I get same results as with just additive model. Is there
> something that I do wrong?
> Thanks,
>
> *For example: *
>
>> mrm.S10z_A<- MRM(Adis ~ S10z.st+Distance.st, nperm=100)
>> mrm.S10z_A
> $coef
> Adis pval
> Int 0.553605282 0.06
> S10z.st -0.002587542 0.86
> Distance.st 0.028866573 0.07
>
> $r.squared
> R2 pval
> 0.004180399 0.060000000
>
> $F.test
> F F.pval
> 4.634535 0.060000
>
>> mrm.S10z_A<- MRM(Adis ~ S10z.st*Distance.st, nperm=100)
>> mrm.S10z_A
> $coef
> Adis pval
> Int 0.553605282 0.05
> S10z.st -0.002587542 0.80
> Distance.st 0.028866573 0.07
>
> $r.squared
> R2 pval
> 0.004180399 0.050000000
>
> $F.test
> F F.pval
> 4.634535 0.050000
>
>> mrm.S10z_A<- MRM(Adis ~ S10z.st:Distance.st, nperm=100)
>> mrm.S10z_A
> $coef
> Adis pval
> Int 0.553605282 0.05
> S10z.st -0.002587542 0.81
> Distance.st 0.028866573 0.11
>
> $r.squared
> R2 pval
> 0.004180399 0.050000000
>
> $F.test
> F F.pval
> 4.634535 0.050000
>
>
--
Sarah Goslee
http://www.functionaldiversity.org
More information about the R-help
mailing list