DefineRegression: Define a regression model and parameters

DefineRegressionR Documentation

Define a regression model and parameters

Description

This function defines a regression model with parameters, where the model can be one of a set of pre-defined models (see the argument RegressionModel). The parameters can either be defined in a table or read from a resource file.

Usage

DefineRegression(
  processData,
  UseProcessData = FALSE,
  DefinitionMethod = c("ResourceFile", "Table"),
  GroupingVariables = character(),
  RegressionModel = c("SimpleLinear", "Power"),
  RegressionTable = data.table::data.table(),
  FileName = character()
)

Arguments

processData

The current data produced by a previous instance of the function.

UseProcessData

Logical: If TRUE use the existing function output in the process.

DefinitionMethod

Character: A string naming the method to use, one of "Table" to define a table directly (in the GUI), and ResourceFile to read a file.

GroupingVariables

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.

RegressionModel

Character: A string naming the model to use for the regression. See Details for options.

RegressionTable

A table with one row defining the name of the dependent variable (column name DependentVariable), the name of the independent variable (column name IndependentVariable), and the Intersect and Slope if RegressionModel = "SimpleLinear" and Factor and Exponent if RegressionModel = "Power".

FileName

The path to a CSV file containing the columns DependentVariable), IndependentVariable and the RegressionTable.

Details

The currently implemented models are listed below:

  • SimpleLinear

    DependentVariable = Intercept + Slope * IndependentVariable

  • Power

    DependentVariable = Factor * IndependentVariable^{Exponent}

Value

An object of StoX data type Regression.

See Also

EstimateBioticRegression for estimating regression parameters from a StoxBioticData, IndividualsData or SuperIndividualsData object, and ImputeSuperIndividuals for applying the regression to SuperIndividualsData.


StoXProject/RstoxBase documentation built on July 14, 2024, 9:39 a.m.