R/Define.R
EstimateBioticRegression.Rd
This function estimates a regression model with parameters, where the model can be one of a set of pre-defined models.
EstimateBioticRegression(
InputDataType = c("IndividualsData", "SuperIndividualsData"),
RegressionModel = c("SimpleLinear", "Power"),
DependentVariable = character(),
DependentResolutionVariable = character(),
IndependentVariable = character(),
IndependentResolutionVariable = character(),
GroupingVariables = character(),
IndividualsData,
SuperIndividualsData
)
The type of biotic data to estimate the regression parameters based on, one of "IndividualsData" and "SuperIndividualsData". See Details.
Character: A string naming the model to use for the regression. See Details for options.
The name of the dependent variable (response variable).
(Optional) The name of the variable that gives the resolution of the DependentVariable
. If the DependentResolutionVariable
is given, half of the resolution is added to the DependentVariable
, and the regression model is fitted at those values. E.g., if DependentVariable
= "IndividualTotalLength" and DependentResolutionVariable
= "LengthResolution", the regression model is fitted at IndividualTotalLength + LengthResolution/2.
The name of the independent variable (explanatory variable).
(Optional) The name of the variable that gives the resolution of the IndependentVariable
. See also DependentResolutionVariable
.
An optional vector of strings defining variables seving as grouping variables in the RegressionTable. Setting this adds the its elements as columns in the RegressionTable in the GUI.
The IndividualsData
data.
The SuperIndividualsData
data.
An object of StoX data type Regression
.
The RegressionModel
"Power" performs a log-log transformed simple linear regression of the model Y ~ a X^b exp(epsilon), where the error term epsilon is assumed to follow the normal distibution with mean 0 (see fishR).
When using IndividualTotalLength as DependentVariable
it can happen that IndividualTotalLength = 0 in SuperIndividualsData
due to lower length resolution in the QuantityData
than in the IndividualsData
going in to the SuperIndividuals
function. In such cases the only option is to use InputDataType = "IndividualsData".
DefineRegression
for defining regression parameters directly of from a file.