getCoefTab: getCoefTab

View source: R/getCoefTab.R

getCoefTabR Documentation

getCoefTab

Description

getCoefTab extract the effect of diversity on number of functions greater than a threshold

Usage

getCoefTab(
  eqn,
  fun = stats::glm,
  data,
  groupVar = "thresholds",
  coefVar = NULL,
  ...
)

Arguments

eqn

The model to be fit at each threshold.

fun

The fitting function. Defaults to glm.

data

A data frame containing the variables in the model to be fit.

groupVar

Grouping variable. Defaults to "thresholds" to fit the model at different thresholds, but, other types of grouping are possible.

coefVar

The name of the variable from the model whose coefficient we'll be extracting.

...

Other arguments to be supplied to the fitting function

Details

getCoefTab Takes a statistical model and plot level data with the number of functions greater than a threshold at multiple different thresholds and returns the coefficient for the effect of diversity at each threshold

Value

Returns a data frame of thresholds, coefficients, and their statistical properties.

Author(s)

Jarrett Byrnes.

Examples

## Not run: 
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)

# 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)

germanyThresh <- getFuncsMaxed(germany, vars,
  threshmin = 0.05,
  threshmax = 0.99, prepend = c("plot", "Diversity"), maxN = 7
)

germanyLinearSlopes <- getCoefTab(funcMaxed ~ Diversity,
  data = germanyThresh, coefVar = "Diversity", family = quasipoisson(link = "identity")
)


## End(Not run)

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