compare.models: Compare gravity models

View source: R/compare.models.R

compare.modelsR Documentation

Compare gravity models

Description

Prints diagnostic statistics for comparing gravity models

Usage

compare.models(...)

Arguments

...

gravity model objects

Details

Results include model name, AIX, BIC, log likelihood, RMSE and number of parameters

Value

data.frame of competing model statistics

Author(s)

Jeffrey S. Evans <jeffrey_evans@tnc.org> and Melanie A. Murphy <melanie.murphy@uwyo.edu>

References

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

Examples

 
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)


jeffreyevans/GeNetIt documentation built on June 28, 2023, 5:14 a.m.