An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-ecology/attachments/20101217/871b7d47/attachment.pl>
Capscale: Centroids ignored with Condition() in formula
4 messages · Wilson, Michael E, Jari Oksanen
Michael, Sorry for top posting, but with this structure of email it seems to be the only sensible way of continuing. I cannot see any problem, but I only see a situation, and quite a normal situation. You have a model of type capscale(Y ~ A + Condition(A %in% B)). Here A appears twice: its effectsare removed first in Condition() and then you try analyse its residul effects, but no effect of A remains because they were already removed. In this case, no constrained component is calculated and you won't get explicit information on skipping this stage. Situation is different if some constrained variation is left: in capscale(Y ~ A + x + Condition(A %in% B)) you will get a constrained component showing effects of x on residual and information that A was aliased. So no effect of A, but info that it cannot be calculated. All that we could do for the first case is to return an empty constrained component with information why it is empty. The same situation continues with partially aliased models. For instance, in vegan standard example capscale(dune ~ Management + Condition(Manure)), the effects of Management level NM (Natural Management) cannot be displayed because you have partialled out Manure, and Manure level = 0 (no manure) only occurs with Management = NM. So you alias away ManagementNM. This seems to be the case with your later message update below. If you remove something by partialling out, then you remove it. If you removed it, you cannot analyse its effects. That is how these models work and how they were designed to work. Cheers, Jari Oksanen
On 17/12/10 03:27 AM, "Wilson, Michael E" <mwilso14 at utk.edu> wrote:
Update: I think I tracked down the problem, but don't know how to fix it. Using Condition() works fine with any of my other variables. But, now I see that in this model bees ~ FlowerType + condition(Transect) While there are multiple observations on an given Transect, each transect has only one of numerous possible flower types. And (I think this is the problem) some FlowerTypes only occur in one Transect. While other FlowerTypes are represented in multiple Transects. So for the FlowerTypes that only occur in one Transect, the repeated measures on those is the residual and must be messing up the analysis. Is that right? If so, any suggestions on how to resolve the problem? Thanks Michael Wilson ------------------------------ ----------------------------- copied my first message below ------------------------------- Hi, I'm having a problem with Capscale in Vegan. When adding a Condition() statement in my formula, the Constraint in the formula seems to be ignored. I don't know if this is a problem with my formula, a bug, or if I don't understand something else. Here is my R statement bees.cap <- capscale(bees ~ FlowerType + Condition(Transect %in% FlowerType), envir, distance = "morisita", add=TRUE) In my data, there are multiple observations at sites (Transect). Each site has one possible class factor (FlowerType). capscale works fine removing the Condition, and produces Scores for $Centroids. No Scores are produced for $Centroids when Condition is used. Strangely (to me anyway) the following three formulas give the same results. bees ~ Condition(Transect) bees ~ Transect + Condition(Transect %in% FlowerType) bees ~ FlowerType + Condition(Transect) bees ~ FlowerType + Condition(Transect:FlowerType) The plot it produces the above produces is beautiful and agrees with what I observed in the field. A plot without the Condition does agree with my sense of what I observed in the field, but the plot has a bad horeshoe, does not account for observations at the same Transect, and is harder to look at. Does anyone have solutions/explanations? Thank you so much. Michael Wilson [[alternative HTML version deleted]]
_______________________________________________ R-sig-ecology mailing list R-sig-ecology at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Thanks Jari, I've still much to learn. I'm working on my master's thesis. Within a context of mixed models, I thought that a model where Y ~ A + Random(B within A) would only remove random variance explained by different levels of B in each level of A, leaving A to be analyzed as fixed without the variance created by different levels of B within it. I guess that is either wrong, not completely correct, or in ordination it functions differently. After your reply, I tried conditioning on locations (different farms) of the transects, and that seems to work well. Thanks much Your tutorial is very helpful as well. Michael Wilson. University of Tennessee
From: Jari Oksanen [jari.oksanen at oulu.fi]
Sent: Friday, December 17, 2010 12:37 AM
To: Wilson, Michael E; r-sig-ecology at r-project.org
Subject: Re: [R-sig-eco] Capscale: Centroids ignored with Condition() in formula
Sent: Friday, December 17, 2010 12:37 AM
To: Wilson, Michael E; r-sig-ecology at r-project.org
Subject: Re: [R-sig-eco] Capscale: Centroids ignored with Condition() in formula
Michael, Sorry for top posting, but with this structure of email it seems to be the only sensible way of continuing. I cannot see any problem, but I only see a situation, and quite a normal situation. You have a model of type capscale(Y ~ A + Condition(A %in% B)). Here A appears twice: its effectsare removed first in Condition() and then you try analyse its residul effects, but no effect of A remains because they were already removed. In this case, no constrained component is calculated and you won't get explicit information on skipping this stage. Situation is different if some constrained variation is left: in capscale(Y ~ A + x + Condition(A %in% B)) you will get a constrained component showing effects of x on residual and information that A was aliased. So no effect of A, but info that it cannot be calculated. All that we could do for the first case is to return an empty constrained component with information why it is empty. The same situation continues with partially aliased models. For instance, in vegan standard example capscale(dune ~ Management + Condition(Manure)), the effects of Management level NM (Natural Management) cannot be displayed because you have partialled out Manure, and Manure level = 0 (no manure) only occurs with Management = NM. So you alias away ManagementNM. This seems to be the case with your later message update below. If you remove something by partialling out, then you remove it. If you removed it, you cannot analyse its effects. That is how these models work and how they were designed to work. Cheers, Jari Oksanen On 17/12/10 03:27 AM, "Wilson, Michael E" <mwilso14 at utk.edu> wrote: > Update: > I think I tracked down the problem, but don't know how to fix it. > Using Condition() works fine with any of my other variables. > > But, now I see that in this model > bees ~ FlowerType + condition(Transect) > > While there are multiple observations on an given Transect, each transect has > only one of numerous possible flower types. > > And (I think this is the problem) some FlowerTypes only occur in one Transect. > While other FlowerTypes are represented in multiple Transects. So for the > FlowerTypes that only occur in one Transect, the repeated measures on those is > the residual and must be messing up the analysis. Is that right? > > If so, any suggestions on how to resolve the problem? > > Thanks > Michael Wilson > > ------------------------------ > ----------------------------- > copied my first message below > ------------------------------- > > > Hi, I'm having a problem with Capscale in Vegan. > > When adding a Condition() statement in my formula, the Constraint in the > formula seems to be ignored. I don't know if this is a problem with my > formula, a bug, or if I don't understand something else. > > Here is my R statement > > bees.cap <- capscale(bees ~ FlowerType + Condition(Transect %in% FlowerType), > envir, distance = "morisita", add=TRUE) > > In my data, there are multiple observations at sites (Transect). Each site has > one possible class factor (FlowerType). capscale works fine removing the > Condition, and produces Scores for $Centroids. No Scores are produced for > $Centroids when Condition is used. Strangely (to me anyway) the following > three formulas give the same results. > > bees ~ Condition(Transect) > bees ~ Transect + Condition(Transect %in% FlowerType) > bees ~ FlowerType + Condition(Transect) > bees ~ FlowerType + Condition(Transect:FlowerType) > > The plot it produces the above produces is beautiful and agrees with what I > observed in the field. > > A plot without the Condition does agree with my sense of what I observed in > the field, but the plot has a bad horeshoe, does not account for observations > at the same Transect, and is harder to look at. > > Does anyone have solutions/explanations? > > Thank you so much. > Michael Wilson > > > > > [[alternative HTML version deleted]] > > _______________________________________________ > R-sig-ecology mailing list > R-sig-ecology at r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
On 17/12/10 17:30 PM, "Wilson, Michael E" <mwilso14 at utk.edu> wrote:
Thanks Jari, I've still much to learn. I'm working on my master's thesis. Within a context of mixed models, I thought that a model where Y ~ A + Random(B within A) would only remove random variance explained by different levels of B in each level of A, leaving A to be analyzed as fixed without the variance created by different levels of B within it. I guess that is either wrong, not completely correct, or in ordination it functions differently.
Michael, You're correct: Y ~ A + Random(B within A) would work like you expect, but such a model doesn't exist for capscale (or rda or cca). These ordination models only have fixed effects, and Condition is *not* Random. If you want to have anything like random effects then it is up to designing a permutation test that would mimic random clustering. Restricted clustering can achieve something resembling random effects models in significance tests. Currently the only thing we have is the 'strata' argument in permutations, but Gavin Simpson is working with more powerful permutation routines. Cheers, Jari
After your reply, I tried conditioning on locations (different farms) of the transects, and that seems to work well. Thanks much Your tutorial is very helpful as well. Michael Wilson. University of Tennessee
________________________________________ From: Jari Oksanen [jari.oksanen at oulu.fi] Sent: Friday, December 17, 2010 12:37 AM To: Wilson, Michael E; r-sig-ecology at r-project.org Subject: Re: [R-sig-eco] Capscale: Centroids ignored with Condition() in formula Michael, Sorry for top posting, but with this structure of email it seems to be the only sensible way of continuing. I cannot see any problem, but I only see a situation, and quite a normal situation. You have a model of type capscale(Y ~ A + Condition(A %in% B)). Here A appears twice: its effectsare removed first in Condition() and then you try analyse its residul effects, but no effect of A remains because they were already removed. In this case, no constrained component is calculated and you won't get explicit information on skipping this stage. Situation is different if some constrained variation is left: in capscale(Y ~ A + x + Condition(A %in% B)) you will get a constrained component showing effects of x on residual and information that A was aliased. So no effect of A, but info that it cannot be calculated. All that we could do for the first case is to return an empty constrained component with information why it is empty. The same situation continues with partially aliased models. For instance, in vegan standard example capscale(dune ~ Management + Condition(Manure)), the effects of Management level NM (Natural Management) cannot be displayed because you have partialled out Manure, and Manure level = 0 (no manure) only occurs with Management = NM. So you alias away ManagementNM. This seems to be the case with your later message update below. If you remove something by partialling out, then you remove it. If you removed it, you cannot analyse its effects. That is how these models work and how they were designed to work. Cheers, Jari Oksanen On 17/12/10 03:27 AM, "Wilson, Michael E" <mwilso14 at utk.edu> wrote: Update: I think I tracked down the problem, but don't know how to fix it. Using Condition() works fine with any of my other variables. But, now I see that in this model bees ~ FlowerType + condition(Transect) While there are multiple observations on an given Transect, each transect has only one of numerous possible flower types. And (I think this is the problem) some FlowerTypes only occur in one Transect. While other FlowerTypes are represented in multiple Transects. So for the FlowerTypes that only occur in one Transect, the repeated measures on those is the residual and must be messing up the analysis. Is that right? If so, any suggestions on how to resolve the problem? Thanks Michael Wilson ------------------------------ ----------------------------- copied my first message below ------------------------------- Hi, I'm having a problem with Capscale in Vegan. When adding a Condition() statement in my formula, the Constraint in the formula seems to be ignored. I don't know if this is a problem with my formula, a bug, or if I don't understand something else. Here is my R statement bees.cap <- capscale(bees ~ FlowerType + Condition(Transect %in% FlowerType), envir, distance = "morisita", add=TRUE) In my data, there are multiple observations at sites (Transect). Each site has one possible class factor (FlowerType). capscale works fine removing the Condition, and produces Scores for $Centroids. No Scores are produced for $Centroids when Condition is used. Strangely (to me anyway) the following three formulas give the same results. bees ~ Condition(Transect) bees ~ Transect + Condition(Transect %in% FlowerType) bees ~ FlowerType + Condition(Transect) bees ~ FlowerType + Condition(Transect:FlowerType) The plot it produces the above produces is beautiful and agrees with what I observed in the field. A plot without the Condition does agree with my sense of what I observed in the field, but the plot has a bad horeshoe, does not account for observations at the same Transect, and is harder to look at. Does anyone have solutions/explanations? Thank you so much. Michael Wilson [[alternative HTML version deleted]] _______________________________________________ R-sig-ecology mailing list R-sig-ecology at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology