1

I want to apply linear regression for time vs cq in R. The problem is that for some intervals of time I have obtained no cq values. The data is given below:

time cq 0hr 17.1 15.54 13.49 15.71 12.98 9 16hr 8.33 No Cq No Cq 7.54 No Cq 20.86 24hr 8.85 28.51 No Cq 19.07 9.27 11.31 30hr 14.23 10.51 13.9 16.9 10.72 8.74 42hr No Cq No Cq No Cq No Cq No Cq No Cq 48hr 25.61 25.13 21.28 22.49 21.92 22.95
I know how to apply linear model on a plot in R but I want to ask what should be done for No Cq, should I put NA at their place ?

  • 1
    You can do linear interpolation if you want, can you do `dput(yourdata)` and I can show you how to do it. – Derek Corcoran Dec 19 '16 at 18:21
  • 1
    What if make two vectors one for cq and second for time interval , so the vectors would be like this ` y = (17.1,15.54,13.49,15.71,12.98,9,NA) ,x = (0,0,0,0,0,0)...` – Ammar Sabir Cheema Dec 19 '16 at 18:30
  • 1
    and plot these two vectors and put NA for missing values and then apply a linear model to my plot ? Will it lead to wrong plot ? – Ammar Sabir Cheema Dec 19 '16 at 18:32
  • 1
    It should not be a problem, check [this](http://stackoverflow.com/questions/8448019/r-lm-na-action). If that does not answer your question let me know – Derek Corcoran Dec 19 '16 at 20:21

0 Answers0