## How the total household expenditures in EU Member
## States depend on relative contributions of
## single household expenditures:
data(expendituresEU)
y <- as.numeric(apply(expendituresEU,1,sum))
lmCoDaX(y, expendituresEU, method="classical")
## How the relative 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 == 'POL')
ssc <- cenLR(gemas_GER[, c("sand", "silt", "clay")])$x.clr
y <- ssc$sand
X <- dplyr::select(gemas_GER, c(MeanTemp, soilclass, Al:Zr))
X$soilclass <- factor(X$soilclass)
lmCoDaX(y, X, external = c('MeanTemp', 'soilclass'),
method='classical', pivot_norm = 'orthonormal')
lmCoDaX(y, X, external = c('MeanTemp', 'soilclass'),
method='robust', pivot_norm = 'orthonormal')
Run the code above in your browser using DataLab