LRCoDa | R Documentation |
Delivers appropriate inference for regression of y on compositional and non-compositional combined input X.
LRCoDa( y, X, external = NULL, method = "robust", pivot_norm = "orthonormal", max_refinement_steps = 200 )
y |
The response which should be non-compositional |
X |
The compositional and/or non-compositional predictors as a matrix, data.frame or numeric vector |
external |
Specify the columns name of the external variables. The name has to be introduced as follows: external = c("variable_name"). Multiple selection is supported for the external variable. Factor variables are automatically detected. |
method |
If “robust”, the fast MM-type linear regression is applied, while with method “classical”, the conventional least squares regression is applied. |
pivot_norm |
if FALSE then the normalizing constant is not used, if TRUE sqrt((D-i)/(D-i+1)) is used (default). The user can also specify a self-defined constant |
max_refinement_steps |
(for the fast-S algorithm): maximal number of refinement steps for the “fully” iterated best candidates. |
Compositional explanatory variables should not be directly used in a linear regression model because any inference statistic can become misleading. While various approaches for this problem were proposed, here an approach based on the pivot coordinates is used. Further these compositional explanatory variables can be supplemented with external non-compositional data and factor variables.
An object of class ‘lmrob’ or ‘lm’ and two summary objects.
Roman Wiedemeier
lm
, lmrob
and pivotCoord
## How the content of sand of the agricultural ## and grazing land soils in Germany depend on ## relative contributions of the main chemical trace elements, ## their different soil types and the Annual mean temperature: data("gemas") gemas$COUNTRY <- as.factor(gemas$COUNTRY) gemas_GER <- dplyr::filter(gemas, gemas$COUNTRY == 'GER') y <- gemas_GER$sand X <- dplyr::select(gemas_GER, c(MeanTemp, soilclass, Al:Zr)) LRCoDa(y, X, external = c('MeanTemp', 'soilclass'), method='classical', pivot_norm = 'orthonormal') LRCoDa(y, X, external = c('MeanTemp', 'soilclass'), method='robust', pivot_norm = 'orthonormal')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.