msm: Fit a Multispecies Model

Description Usage Arguments Examples

View source: R/msm.r

Description

Fit a Multispecies Model

Usage

1
2
msm(y, sites, x, species, traits, data, site_re = FALSE, type = c("mstm",
  "jsdm"), method = c("glmer", "jags", "stan"), ...)

Arguments

y

Character. Column name of response variable, species occurrences.

sites

Character. Column name of site variable.

x

Character. Column names of site level predictor variables.

species

Character. Column name of species variable.

traits

Character. Column names of species trait variables. Ignore

data

A data.frame containing the variables for the model.

site_re

Logical. Should a site level random effect be included.

type

The type of model to fit either 'mstm', multispecies trait model, or 'jsdm', joint species distribution model.

method

The method used to fit the model.

...

Further arguments to pass on to model fitting functions.

Examples

1
2
3
4
5
msm_glmer <- msm('present', 'plot', 'logit_rock', 'species', 'ln_sla', eucs)
msm_glmer_probit <- msm('present', 'plot', 'logit_rock', 'species', 'ln_sla',
  eucs, family = binomial(link = 'probit'))
msm_jags <- msm('present', 'plot', 'logit_rock', 'species', data = eucs, type = 'jsdm',
  method = 'jags')

wkmor1/msmod documentation built on May 4, 2019, 7:34 a.m.