Closed dougwyu closed 1 year ago
Thanks for pointing out this issue, Douglas. The model you are trying to fit should throw an error, but for some reason it does not, I will look into what causes that. Either how, num.lv.c
can only be used in combination with lv.formula
, if formula
is also given. The lv.formula
interface is for predictors -inside- the ordination, and the formula
interface for predictors -outside- of the ordination. So, the model should be one of the two following:
gllvm(y = community_tab, X = covariates, lv.formula = ~ x*y, num.lv.c = 2, family = binomial(), studyDesign = Site, row.eff = ~(1|Site), control.start=list(n.init = 1, jitter.var = 0)))
or
gllvm(y = community_tab, X = covariates, formula = ~ x*y, num.lv = 2, family = binomial(), studyDesign = Site, row.eff = ~(1|Site), control.start=list(n.init = 1, jitter.var = 0)))
I hope that gets you going for the moment, but let me know if it does not.
Thanks Bert,
Just to be clear,
gllvm(y = community_tab, X = covariates, formula = ~ x*y, num.lv.c = 2, family = binomial(), studyDesign = Site, row.eff = ~(1|Site), control.start=list(n.init = 1, jitter.var = 0)))
throws the labterm error, as you say it should.
But clearly, i have misunderstood something conceptual. I wanted to use xy as a fixed effect, and use the latent variables to model the residuals (i.e. after using xy to remove spatial autocorrelation). (I'm just exploring)
I haven't understood what you mean by inside and outside the ordination. i'll keep on this. thanks,
Yes, that's what I am saying. In that case, you are after the second model above, i.e.:
gllvm(y = community_tab, X = covariates, formula = ~ x*y, num.lv = 2, family = binomial(), studyDesign = Site, row.eff = ~(1|Site), control.start=list(n.init = 1, jitter.var = 0)))
with num.lv
instead of num.lv.c
. The difference is whether (num.lv.c) the latent variables are modelled as a function of the predictors, or (num.lv) do not include information that can be accounted for by the predictors. It sounds like you are after the latter.
Hi,
I'm interested in trying to correct for spatial autocorrelation, and I have come up with this syntax, but i get a
labterm not found
error.I don't get this error if i use
lv.formula = x*y
instead offormula = x*y
, but that doesn't seem correct to me(x and y are geographic coordinates; Site = individual lakes, and we have multiple samples per lake)
Thanks in advance
gllvm(y = community_tab, X = covariates, formula = ~ x*y, num.lv.c = 2, family = binomial(), studyDesign = Site, row.eff = ~(1|Site), control.start=list(n.init = 1, jitter.var = 0)))
Error in gllvm(y = community_tab, X = covariates, formula = ~x * y, num.lv.c = 2, : object 'labterm' not found