I'm having trouble calculating the y_pred in the least square regression. The idea is something like:
mydata <- read.csv("G:\\sample.csv",header=T)
x<-rep(mydata$wavelength,each=119)
y<-c(mydata$v1,....mydata$v119)
lm(y~x)
A sample data can be download at: https://drive.google.com/file/d/0B86_a8ltyoL3Y3BhU2xFVVo5dnM/view?usp=sharing
In the file, variable "Wavelength" is x, where for each x, there are multiple y measured at different times, as indicated by variables V1 to V119.
I'm not sure the y(multiple)~x(one) regression... Can someone help out to calculate y_pred in this case?
Big thanks!