Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


ecoCopula (version 1.0.2)

fitted.stackedsdm: Fitted values from a stackedsdm object

Description

Fitted values from a stackedsdm object

Usage

# S3 method for stackedsdm
fitted(object, ...)

Arguments

object

An object of class stackedsdm

...

Not used

Value

A matrix of fitted values.

Author(s)

Francis K.C. Hui <francis.hui@anu.edu.au>.

Details

Extracts the fitted values from stackedsdm object.

Examples

Run this code
# NOT RUN {
library(mvabund)
data(spider)
X <- spider$x
abund <- spider$abund

# Example 1: Simple example
myfamily <- "negative.binomial"
# Example 1: Funkier example where Species are assumed to have different distributions
# Fit models including all covariates are linear terms, but exclude for bare sand
fit0 <- stackedsdm(abund, formula_X = ~. -bare.sand, data = X, family = myfamily, ncores=2)
fitted(fit0)

# Example 2: Funkier example where Species are assumed to have different distributions
abund[,1:3] <- (abund[,1:3]>0)*1 # First three columns for presence absence
myfamily <- c(rep(c("binomial"), 3),
              rep(c("negative.binomial"), (ncol(abund)-3)))
fit0 <- stackedsdm(abund, formula_X = ~ bare.sand, data = X, family = myfamily, ncores=2)
fitted(fit0)
# }

Run the code above in your browser using DataLab