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)
Run the code above in your browser using DataLab