stdEffects: stdEffects

View source: R/stdEffects.R

stdEffectsR Documentation

stdEffects

Description

stdEffects obtains the standardized effect of each species on each function

Usage

stdEffects(cmat, adf, vars, species)

Arguments

cmat

Matrix of coefficients of species effects on functions from getRedundancy with output="coef".

adf

Data frame with plot level data for species and functions.

vars

Names of columns with data for functions in adf.

species

Names of columns with data for species in adf.

Details

stdEffects takes a matrix of coefficients for relationships between species and functions, the data frame used to generate those coefficients and the names of species and function, and then it calculates standardized coefficients using std coef = b *sx/sy

Value

Returns a matrix of standardized coefficients.

Author(s)

Jarrett Byrnes.

Examples

data(all_biodepth)
allVars <- qw(biomassY3, root3, N.g.m2, light3, N.Soil, wood3, cotton3)

germany <- subset(all_biodepth, all_biodepth$location == "Germany")

vars <- whichVars(germany, allVars)
species <- relevantSp(germany, 26:ncol(germany))

# re-normalize N.Soil so that everything is on the same
# sign-scale (e.g. the maximum level of a function is
# the "best" function)
germany$N.Soil <- -1 * germany$N.Soil + max(germany$N.Soil, na.rm = TRUE)

res.list <- lapply(vars, function(x) sAICfun(x, species, germany))
names(res.list) <- vars

coefs <- getRedundancy(vars, species, germany, output = "coef")
stdCoefs <- stdEffects(coefs, germany, vars, species)

#########
# A function that uses the coefficient matrix and information from the
# data to calculate standardized effects of species using the method
# std coef = b *sx/sy
#########

jebyrnes/multifunc documentation built on May 25, 2022, 9:43 p.m.