I have two groups of spectra, that could be viewed as a vectors with each wn corresponding to the vector's component. I'd like to quantify the difference between these two groups, and I tried to use linear model to express one group of vectored values as a function of the other vector values. So, I used lm function in R, but I don't know if I applied it correctly and how to make sense of it.
Here is the function:
summary(lm(spectra_group1 ~ spectra_group2))
For each vector within a group1 it gives a corresponding output:
I guess, it treats each spectrum as a $y_i$, in this instance, but in each spectrum there are over 3000 variables. So, I don't understand how it can reduce all these variables to just one $y_i$. Furthermore, in this example, there are several spectrum ( III, IX, XI - XIII) that have p-values significantly low. That would indicate, that they are correlated to the group1$spectrum_x. I would be glad, if someone could assist with ideas how to develop a method to quantify the differences between groups, possibly with some linear model. Thank you in advance.