Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

anova.mppm: likelihood ratio test does not work for random effects models for replicated patterns. #136

Closed
marcelinodelacruz opened this issue Aug 5, 2020 · 4 comments
Assignees
Labels
bug methodology Involves questions of statistical methodology and related computing

Comments

@marcelinodelacruz
Copy link

marcelinodelacruz commented Aug 5, 2020

Including a random term in the models of the example of anova.mppm() makes the likelihood ratio test to fail, e.g.:

H <- hyperframe(X=waterstriders)
#' test for loglinear trend in x coordinate
mod0 <- mppm(X~1, data=H, Poisson(), random = ~1|id)
modx <- mppm(X~x, data=H, Poisson(), random = ~1|id)
anova(mod0, modx, test="Chi")

Error in anova.lme(structure(list(modelStruct = structure(list(reStruct = structure(list( :
objects must inherit from classes "gls", "gnls", "lm", "lmList", "lme", "nlme", "nlsList", or "nls"
Error in anova.mppm(mod0, modx, test = "Chi") : anova failed

@baddstats
Copy link
Contributor

This has arisen because recent versions of nlme have imposed stricter restrictions on the arguments of anova.lme. We are trying to find a work-around.

@baddstats baddstats self-assigned this Aug 11, 2020
@baddstats baddstats added the bug label Aug 11, 2020
@baddstats
Copy link
Contributor

As a temporary solution, if you set spatstat.options(developer=TRUE), your example code will work, in the development version spatstat 1.64-1.027.

@baddstats baddstats added the methodology Involves questions of statistical methodology and related computing label Sep 1, 2020
@marcelinodelacruz
Copy link
Author

Thank you so much Adrian for dealing with this. Your temporary solution works fine also with other data and examples.

@baddstats
Copy link
Contributor

This solution has been adopted permanently in spatstat 1.64-1.052 and later.

So you do not need to typespatstat.options(developer=TRUE) any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug methodology Involves questions of statistical methodology and related computing
Projects
None yet
Development

No branches or pull requests

2 participants