dist_weight | R Documentation |
dist_weight
fits a specified model containing local and landscape variables.
dist_weight( mod0, landscape.vars, landscape.formula, data = NULL, weight.fn = "Gaussian", plot.fits = TRUE, lower = NULL, upper = NULL, init.range = NULL, n.partition = 10, opt.range = NULL, optim.method = "L-BFGS-B" )
mod0 |
a "local" model object, without landscape variables. |
landscape.vars |
list of names landscape matrices (one for each landscape variable). |
landscape.formula |
formula containing the landscape predictors. |
data |
a data frame with local predictors and response variables, where each row as a site sorted in the same order as the original site data frame. |
weight.fn |
the type of weighting function to use; "Gaussian" (default) or "exponential". |
plot.fits |
specify whether to produce plots (default = TRUE). |
lower |
lower bound on the variables for the |
upper |
upper bound on the variables for the |
init.range |
starting point distance for fitting the range parameter. |
n.partition |
number of partitions to divide the log-likelihood profile, in order to avoid identifying false maxima. |
opt.range |
specified value range parameter value. If specified, |
optim.method |
specify method for optimization (default = |
dist_weight
fits the model using the function optim
(method L-BFGS-B)
to find the values of the model parameters that maximize the log-likelihood of the
model fit to the data. It can be run with many types of regression models in R:
lm
and glm
in base R, lmer
and glmer
in lme4
,
and lme
and gls
in nlme.
It adopts the model syntax of the
specified regression model,making it easy to use models of any type.Although
dist_weight
producesp-values for the regression coefficients (given by the
underlying lm
,glm
, lmer
, glmer
, lme
, or
gls
functions,these p-values are conditional on the estimate of the range
parameter, and consequently they will likely have inflated type I error rates. The
dist_weight_boot
function uses a bootstrap likelihood ratio test to generate
a single p-value for the landscape predictor variable(s) in the model. By
bootstrapping, it accounts for the co-dependence of regression coefficient and
range parameter. Therefore, p-values reported for landscape predictor(s) should come from
dist_weight_boot
rather than dist_weight
.
dist_weight
returns an object of class scalescape
. This is a list
containing the following:
opt.range
the estimate of the range value
logLik
the maximum likelihood value
AIC
AIC value for model fit
BIC
BIC value for model fit
npar
the number of model parameters
data
the original (local) data frame used to fit the model
coef
the coefficient of the landscape variable(s)
mod
the landscape model, with distance-weighted landscape effect
mod0
the local model, without landscape effects
landscape.formula
the formula specified to fit the landscape model
data.with.landscape
a data frame that contains the original local variable and distance-weighted landscape variable(s)
landscape.vars
the list of landscape matrices for each landscape variable
weight.fn
the specified weighting function
max.Dist
the specified maximum distance
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.