# How to know if data are compositional?

I have an environmental data set (LA-ICP-MS), where 46 elements are reported in ppms. I do not know whether my data is a subcompositional (compositional) or not. However, I know that an observation from classical compositional data will sum up to a constant, it is not the case for my dataset. Next thing I want to do is to apply PCA on my data, but I still do not know whether data is compositional or not.

1. If I treat concentrations of elements in my data as absolute values and assume that data is not compositional, I can apply log1p() function in R and then run a PCA.

PCACor = prcomp(x = df.log, retx = TRUE, center = TRUE, scale. = TRUE)
biplot(PCACor)

2. If I assume that I have a "closed" data, I would need to apply a centered logratio transformation clr() from the package "compositions" and then run a PCA,

PCACor = prcomp(x = df.clr, retx = TRUE, center = TRUE, scale. = TRUE)
biplot(PCACor)


With log1p() transformation I get a strange biplot (on the left), where all loadings are pointing to 2 directions (effect of a "closed data"?). With clr() (on the right) I get a proper separation of the loadings on the biplot. In addition, when I refer to literature: Filzomer et al, 2009, Principal component analysis for compositional data with outliers, there is clearly written and shown the effect of PCA on compositional data has:

And it is exactly the same pattern what I see in my data depending on the applied transformation. Images below reflect biplot of PCA on "opened" data and images above show PCA on "closed" dataset.

My questions are then next, how do I know whether my data is compositional or not if observations do not sum up to a constant? Can I assume that data is compositional just by looking at the results of PCA biplot on log-transformed data?

• Please define "closed" and "compositional". Usually, by the latter people mean data with constant sum within a row (observation). – ttnphns Sep 26 '16 at 7:32
• The effect of "closure" is present when data is presented as proportions. I have got analyses from the lab and all elements were measured in ppm and that is all I know for today, I am not exactly sure if the effect is present within my data. If I try summing variables from one observation and I do not get a "zero". So my question is rather next: 1. How do I check whether I have "closure effect" 2. And, can the effect of compositional data can be seen from my PCA result? By that I mean a strange PCA result with just two directions of loadings. – marianess Sep 26 '16 at 8:57
• If you sum the values of a single observation and do not get one (or 100%) as the answer, then either they are not proportions that make up a whole or else they are reported with some amount of measurement error. Unless the lab is giving you negative concentrations you certainly won't get a sum of zero! What, then, are you trying to ask about a "closure effect"? – whuber Sep 26 '16 at 14:28
• Concentrations are commonly treated in a log scale, regardless of whether or not the data is "compositional" (e.g. pH). I am not familiar with the "CLR" transform, but some quick googling suggests it is simply these two steps: 1) take the log of the data matrix, 2) "center" by subtracting the row means (vs. the more typical column means). I do not think your results necessarily mean your data is "compositional". Can you show a histogram of row-sums, perhaps? – GeoMatt22 Nov 3 '16 at 5:55
• Thank you GeoMatt22 for responding! Can you tell me what do you mean by "histogram of row-sums"? A cumulative density plot? I am very interested in solving this problem! – marianess Nov 3 '16 at 9:56