Sorry about asking such a basic question.
Assuming I have data like this
x Trial1 Trial2 Trial3
1 1.0 2.0 3.0
2 1.1 2.1 3.1
3 1.2 2.2 3.2
How exaclty to I regress my predictor variable x onto my data. I was thinking naively that I could just take the average of the data trials and get something like
x y
1 1.1
2 2.1
3 3.1
for which I could simply use model <-lm(x ~ y)
. But I think I would introduce a bias by using the average. I was thinking instead to to create ordered pairs like (1,1.1), (1,2.0),...(3,2.2),(3,3.2). And use that for the regression but I'm not quite sure how to do this in a clean way in R. I was going to use data slicing and cbind a bunch of times, but I'm sure there is something better.
An example of what I'm getting at
The crux of my question is: how to do a regression model when you have data from mutiple runs of the same experiment. For example if I was looking at the temperature along a really thin metal wire (so its essentially 1-d), and then I mark off lenghts on this wire called x=0, x=1, x=2, ... x=total length. Then I take 10 temperature measuresments for each value of x. How do I create a regression model, which gives Temperarute as a function of length, i.e. T(x), given that I have 10 T values for each value of x?