Learn R Programming

CoDaImpact (version 0.1.0)

ToSimplex: Converting Linear Models to CoDa models

Description

The function converts the output of a "lm" to the "lmCoDa" class, which offers additional tools for the interpretation of a CoDa regression models. Most of the work is done by the transformationSummary() function, which has its own documentation page, but should be reserved for internal use.

Usage

ToSimplex(object)

Value

an object of class "lm" and "lmCoDa" if the formula include at least one log-transformation

Arguments

object

an object of class "lmCoDa"

Author

  • Lukas Dargel

  • Rodrigue Nasr

See Also

lm(), lmCoDa()

Examples

Run this code

# XY-compositional model
res <- lm(
  ilr(cbind(left, right, extreme_right)) ~
  ilr(cbind(Educ_BeforeHighschool, Educ_Highschool, Educ_Higher)),
  data =  head(election, 20))
res <- ToSimplex(res)

# X-compositional model
res <- lm(YIELD ~ PRECIPITATION + ilr(TEMPERATURES), data = head(rice_yields, 20))
res <- ToSimplex(res)

Run the code above in your browser using DataLab