I would like to compare two absorption spectra ( or interferograms) and conclude whether between these two there are statistically significant differences at particular wavelength intervals. At the moment, I have data of two experiments that look like this:
# A tibble: 6 x 5
t x1 y1 x2 y2
<dbl> <dbl> <dbl> <dbl> <dbl>
1 3999. 0.0124 0.0132 0.0122 0.0113
2 3998. 0.0125 0.0130 0.0122 0.0116
3 3997. 0.0122 0.0131 0.0122 0.0113
4 3996. 0.0121 0.0136 0.0122 0.0114
5 3995. 0.0124 0.0139 0.0122 0.0122
6 3994. 0.0125 0.0141 0.0122 0.0129
The first column represents the wavenumber, the x columns represent the absorbance of sample and the y columns represent the absorbance of irradiated sample ( before and after). I was wondering whether I could compare these data ( x and y) as time series and if so, what could be the method to quantify the differences, if any, between the samples before and after irradiation. Maybe it's already been done and there is somewhere some information as to how to compare the spectra if the wavenumber is interpreted as time ( x axis). I did the t test in R and in both experiments the null hypothesis could not be rejected, although for the second experiment (x2, y2) the p value was much lower than for the first. If I average the x and y, and then plot both data, I see that there are visible differences at certain wavelength intervals. In R, I used IRISSeismic package and function crossSpectrum, that gave me such an output:
freq spec1 spec2 coh phase Pxx Pyy
1 0.0002666667 2.121935e+01 2.152532e+01 1 0.010220252 1.856693e+01+0i 1.883465e+01+0i
2 0.0005333333 7.011069e+00 6.869078e+00 1 0.008984730 6.134686e+00+0i 6.010443e+00+0i
3 0.0008000000 8.385363e+00 8.197039e+00 1 0.011999039 7.337193e+00+0i 7.172409e+00+0i
4 0.0010666667 7.483070e+00 7.272319e+00 1 0.015419031 6.547686e+00+0i 6.363279e+00+0i
5 0.0013333333 4.086251e+00 3.899095e+00 1 0.017551350 3.575469e+00+0i 3.411708e+00+0i
6 0.0016000000 1.537709e+00 1.405562e+00 1 0.008722742 1.345496e+00+0i 1.229867e+00+0i
For all data points the coh index is given as 1. But obviously that doesn't help me to determine, whether the difference is substantial between two data sets. I tried to average data points between groups (x1, y1 and x2, y2) at each wave number and plotted the graph, it looks like the difference might be significant at certain wavenumber interval. Maybe I could try to express one line ( averaged data points after irradiation of the sample) as a function of the other? But how?
Here is a project with similar experiments: https://www.scielo.br/scielo.php?script=sci_arttext&pid=S0103-50532015001202571 , for statistical analysis they use ANOVA and Tukey's test, but how do I do it for the vectored data?
I cannot find online anything. Here is something of the sort I am looking for: https://www.youtube.com/watch?v=gjKSfILE9nM He compares two spectra in Matlab, but he is using self made toolkit which I can not obtain. How can I do something like this in R? I've read something about modelling the data, but here, I don't have any variables just data of two spectra.