# Thread: Linear regression using compositional data as independent variables

1. ## Linear regression using compositional data as independent variables

I have a set of ratios that the sum results in 100% (compositional data in other words). These 7 variables need to be implemented in a linear regression model (I am using heckman but its the same) as independent variables. I can't add them all seem it violates the logic of regression in terms of on coefficient changes while the others remain constant.

What are my options?
- Can I use just 6 out of the 7 and that would be okay?
- I know that Aitschison has contributed alot of work on the matter. It seems that one choice is to use centered log ratio transformation for the compositional data but I have no idea how this can be implemented. I am using R and the compositions package has a clr function but it produces a variable type that I've never seen before.

Any help would be greatly appreciated.

2. ## Re: Linear regression using compositional data as independent variables

In attempt to answer the second option. I tried to use clr in linear regression and it seems to be working fine. Note: This is just for testing. I know that Site is not a numerical variable in this dataset. Can anyone verify for me that this a proper and valid usage. I know that logs cannot be interpreted the same since the variables have been transformed. I want only to show that they have an effect on my model.

library(compositions)
cdata <- Hydrochem[,8:19]
ddata = clr(cdata)
summary(lm(Site~K+Mg+Ca+Sr+Ba+NH4+Cl+NO3+PO4+SO4+HCO3+TOC, data=Hydrochem))
summary(lm(Site~ddata, data=Hydrochem))

3. ## Re: Linear regression using compositional data as independent variables

Hi micdhack,

I might be too late.
NOT ddata = clr(cdata) but
ddata = ilr(cdata) or
ddata = alr(cdata).
In the clr transfomration the rows sum to zero. In the ilr and alr they don't.
Then go again.

 Tweet

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts