Hossm_R
2012-Feb-27 19:28 UTC
[R] How to incorporate interaction terms in MRM function of ecodist library?
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. 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 -- View this message in context: http://r.789695.n4.nabble.com/How-to-incorporate-interaction-terms-in-MRM-function-of-ecodist-library-tp4425767p4425767.html Sent from the R help mailing list archive at Nabble.com.
Sarah Goslee
2012-Feb-27 20:28 UTC
[R] How to incorporate interaction terms in MRM function of ecodist library?
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