msco.res | R Documentation |
msco
illustration (presented in Lagat et al., 2021c)This function allows the replication of the results on msco
R package illustration paper presented
in Lagat et al. (2021c). Executing msco.res()
therefore gives these outputs that are saved
as .RDS
files in msco
. If the codes that produced these (saved) outcomes are desired, the
codes below are made available.
msco.res()
Returns all the results presented in Lagat et al. (2021c). To replicate
Figs. 1, 2 and Table 2, execute the following code:
RNGkind(sample.kind = "Rejection") set.seed(14) ex.data <- read.csv(system.file("extdata", "251.csv", package = "msco")) j.en <- msco::Jo.eng(ex.data, algo = "sim2", metric = "raw", nReps = 999, dig = 3, s.dplot = FALSE, All.plots = TRUE, Jo.coeff = TRUE, my.AIC = TRUE, my.rsq = TRUE, Exp_Reg = TRUE, P.law_Reg = TRUE, Exp_p.l_Reg = TRUE, Obs.data = FALSE, Sim.data = FALSE, Jo_val.sim = FALSE, lab = FALSE, leg = FALSE, C.I_Jo_val.sim = FALSE, Jo_val.obs = TRUE, Metric = TRUE, Algorithm = TRUE, S.order = TRUE, nmod_stats = TRUE, Pt_Arch_Vals = TRUE, Atype = TRUE, p.n.plot = TRUE, trans = FALSE, m.n.plot = FALSE) j.en$jo.coeff ## Table 1 j.en$AIC; j.en$r2 ## Table 2 j.en$nmod_stats ## Table 3 grDevices::dev.new() j.en$all.plots
Fig. 4, execute the following code:
RNGkind(sample.kind = "Rejection") set.seed(14) grDevices::dev.new() msco:::nullmod_archs2()
Fig. 5, execute the following code:
my.path <- system.file("extdata/gsmdat", package = "msco") setwd(my.path) s.data <- get(load("s.data.csv")) #Species-by-site matrix t.data <- get(load("t.data.csv")) #Species-by-trait matrix p.d.mat <- get(load("p.d.mat.csv")) #Species-by-species phylogenetic distance matrix RNGkind(sample.kind = "Rejection") set.seed(1) gb.res <- msco::gbsm_m.orders(s.data, t.data, p.d.mat, metric = "Simpson_eqn", gbsm.model, orders = c(3:5, 8, 10, 15, 20), d.f = 4, degree = 3, n = 1000, k = 5, p = 0.8, type = "k-fold", scat.plots = FALSE, response.curves = TRUE, j.occs.distrbn = FALSE, mp.plots = FALSE, max.vif = 10, max.vif2 = 3, start.range=c(-0.1,0) ) gb.res$Original.VIFs$`order 3` gb.res$Intermediate.VIFs$`order 3` ## Resulting covariate VIFs after removing ## covariates with VIF > max.vif gb.res$Final.VIFs$`order 3` ## Resulting covariate VIFs after removing ## covariates with VIF > max.vif2
The function msco.res is not for general use. We included it in this package to help
the readers of Lagat et al. (2021c) paper, who may want to get a deeper understanding of how the results
presented in this paper were arrived at. It also allows deeper scrutiny of Lagat et al. (2021c)'s
findings, and broader understanding of the main functionalities of msco
R package.
Lagat, V. K., Latombe, G. and Hui, C. (2021a). A multi-species co-occurrence
index to avoid type II errors in null model testing. DOI: <To be added>
.
Lagat, V. K., Latombe, G. and Hui, C. (2021b). Dissecting the effects of random
encounter versus functional trait mismatching on multi-species co-occurrence and
interference with generalised B-spline modelling. DOI: <To be added>
.
Lagat, V. K., Latombe, G. and Hui, C. (2021c). msco
: an R software package
for null model testing of multi-species interactions and interference with
covariates. DOI: <To be added>
.
## Not run:
ms.res <- msco::msco.res()
ms.res$nmod_stats ## Table 2
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.