# XY-compositional model
res <- lmCoDa(
ilr(cbind(left, right, extreme_right)) ~
ilr(cbind(Educ_BeforeHighschool, Educ_Highschool, Educ_Higher)),
data = head(election, 20))
# Focus on changes in the education composition
educ_comp <- "cbind(Educ_BeforeHighschool, Educ_Highschool, Educ_Higher)"
# ... changes towards a summit towards a summit (higher share of people with lower education)
VariationTable(res, educ_comp, Xdir = "Educ_BeforeHighschool")
# ... same changes using a compositional vector as direction
VariationTable(res, educ_comp, Xdir = c(.5,.25,.25))
# ... changes in a more general direction and for a different observation
VariationTable(res, educ_comp, Xdir = c(.35,.45,.10), obs = 2)
Run the code above in your browser using DataLab