I would like to do multiple linear regression between more variables (a and b and c) for each day, but in reality I will have 5 or 6 data points for each day. Than I want to create new columns of the regression coefficients (intercept and slopes).
The data are something like this
Date a b c
1.1.2004 4,8 12,9 5633,0
2.1.2004 1,8 11,5 6166,0
3.1.2004 3,9 15,2 5830,0
4.1.2004 6,8 14,3 2744,0
5.1.2004 5,9 14,2 3422,0
I tried apply
apply(data,1, function(x,y) lm(a~c, data=data))
but I am getting the same coefficients for each day and I still do not know how should I create the two columns with ceofficients.