I have a data frame DF of over 600 people's short term trade data in time order. Below is the super simplified structure of the data.
id invest payout
 1 10 -1
 1 33 33
 1 20 -5
 2 200 33
 2 33 -20
 3 5 -5
 3 5 -5
id is each person's id. Each person have invested many times in the sampling period, in temporal order.
What I want to check is the correlation between invest and payout.
I tried to use
for (i in 1:(dim (DF)-1))
if (DF[i,1]=DF[i+1,1]) id.lm <- lm(invest ~ payput, data=DF) }
But I don't know how to superimpose graphs onto each other.
Thanks a lot!
[[alternative HTML version deleted]]
Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Archive generated by hypermail 2.2.0, at Sun 17 Apr 2011 - 21:30:30 GMT.
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.
list of date sections of archive