View source: R/compare.models.R
compare.models | R Documentation |
Prints diagnostic statistics for comparing gravity models
compare.models(...)
... |
gravity model objects |
Results include model name, AIX, BIC, log likelihood, RMSE and number of parameters
data.frame of competing model statistics
Jeffrey S. Evans <jeffrey_evans@tnc.org> and Melanie A. Murphy <melanie.murphy@uwyo.edu>
Murphy M.A., R. Dezzani, D.S. Pilliod & A.S. Storfer (2010) Landscape genetics of high mountain frog metapopulations. Molecular Ecology 19(17):3634-3649
library(nlme)
data(ralu.model)
x = c("DEPTH_F", "HLI_F", "CTI_F", "cti", "ffp")
( null <- gravity(y = "DPS", x = c("DISTANCE"), d = "DISTANCE",
group = "FROM_SITE", data = ralu.model, fit.method = "ML") )
( gm_h1 <- gravity(y = "DPS", x = x, d = "DISTANCE", group = "FROM_SITE",
data = ralu.model, ln = FALSE, fit.method="ML") )
( gm_h2 <- gravity(y = "DPS", x = x[1:3], d = "DISTANCE", group = "FROM_SITE",
data = ralu.model, ln = FALSE, fit.method="ML") )
( gm_h3 <- gravity(y = "DPS", x = x[c(4:5)], d = "DISTANCE", group = "FROM_SITE",
data = ralu.model, ln = FALSE, fit.method="ML") )
#( gm_h4 <- gravity(y = "DPS", x = x[c(4:5)], d = "DISTANCE", group = "FROM_SITE",
# data = ralu.model, ln = FALSE, fit.method="REML") )
compare.models(null, gm_h1, gm_h2, gm_h3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.