glm.env.fn: Calculate deviance of plateau envelope via GLM

Description Usage Arguments Value

View source: R/glm.env.fn.R

Description

glm.env.fn fits the plateau envelope as part of a GLM. It is called by the function fit.glm.env and is not intended for use interactively. At present, only binary (logistic) response models for presence/absence data are implemented.

Usage

1
2
3
glm.env.fn(pars, data, y, x.clim, x.nonclim = NULL,
  x.nonclim.formula = NULL, x.factor = NULL, constrain.beta = FALSE,
  slope.limit = 7)

Arguments

pars

The vector of envelope parameters, length 2p+p+2+p(p-1)/2.

data

The data frame (with n rows) containing all the variables for analysis.

y

A string denoting the binary response variable (taking values 0 or 1 for absence and presence respectively); must correspond to a column name in the data frame specied at data.

x.clim

A vector (length p) of strings denoting which columns in the supplied data frame correspond to the climate covariates; must correspond to column names in the data frame specied at data.

x.nonclim

A vector (length p2) of strings denoting which columns in the supplied data frame correspond to the non-climate covariates; must correspond to column names in the data frame specied at data.

x.nonclim.formula

The pre-specified formula if non-climate variables OR factor variables are included.

x.factor

A vector (length p3) of strings denoting which columns in the supplied data frame correspond to the non-climate factors; must correspond to column names in the data frame specied at data.

constrain.beta

Should a ridge penalty be imposed on the betas (slopes)? Takes the form either of: a matrix of dimension p by 2 (specifying TRUE for a ridge penalty for a given beta, or FALSE otherwise); or of a single value FALSE to imply no ridge penalties at all.

slope.limit

Scalar putting an upper bound on the envelope slopes; limit is approximately exp(slope.limit).

Value

The (scalar) deviance for fitted GLM using specified envelope (possibly including a ridge penalty if set).


MarkJBrewer/plateau documentation built on May 7, 2019, 3:35 p.m.