0

I have data organised by the following columns: ID, Date, Time, Reading

Each ID has a series of readings (measurements) per date. E.g. ID 149 on 1/1/2020 has readings at times 1,2,3,4... ID 149 on 2/1/2020 (or possibly 1/2/2020 if you're in the US) has readings at times 1,2,3,4... ID 150 on 1/1/2020 has readings at times 1,2,3,4... and so on

I want to run a linear regression of Reading ~ Time for each ID x Date combo, and extract the slope parameters from the regressions (maybe in a new data frame that keeps the ID and Date columns to be able to identify which regression each slope parameter came from). I'm very new to R, and wondering what the simplest method to try would be.

l_dan
  • 1
  • 5
    Please add a minimal reproducible example. [See here](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610#5963610) for an explanation if you are not sure what that means. You can help others to help you! – dario Feb 08 '20 at 12:12
  • 1
    Hi @I_dan, it's something do-able in R. Do you have your data in a data.frame format? If so, can you do dput(head(,20)) so we can see the format of your data, and suggest something that will work. – StupidWolf Feb 08 '20 at 12:25
  • We also expect you to make an earnest attempt at solution to ask specific question with your implementation. – Parfait Feb 08 '20 at 14:00

0 Answers0