lmCoDa {CoDaImpact}R Documentation

Estimating CoDa regression models

Description

This is a thin wrapper around lm() followed by ToSimplex(), which allows to create a lmCoDa object in one step.

Usage

lmCoDa(formula, data, ...)

Arguments

formula

as in lm()

data

as in lm()

...

arguments passed on to lm()

Value

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

Author(s)

Lukas Dargel

See Also

lm(), ToSimplex(), compositions::ilr(), compositions::alr()

Examples


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

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


[Package CoDaImpact version 0.1.0 Index]