Rick Dunkelberger
2011-May-24 14:04 UTC
[R] R - Time Series Regression with a p-value check for each additional added point.
Hi All, Here is my sample data set.. y x 7/4/2009 -0.2368 -1.2727 7/11/2009 -0.5039 -5.2805 7/18/2009 -0.6655 -6.9641 7/25/2009 -0.3936 -3.6937 8/1/2009 -0.3463 -5.6457 8/8/2009 -0.3000 -1.7368 8/15/2009 0.2378 6.4600 8/22/2009 -0.2962 -3.1113 8/29/2009 -0.4346 -4.2039 9/5/2009 -0.6971 -7.8216 9/12/2009 -0.1217 5.1446 9/19/2009 -0.3107 2.0862 9/26/2009 -0.1797 -3.6055 10/3/2009 0.2299 -0.7373 *10/10/2009 0.4098 -10.1939* When graphed on a scatter plot the bold faced data point significantly reduces the robustness of my regression model. Question, is there a way in R to run a p-value check on each added data point. So lets say given the range of 7/4/2009- 10/03/2009 my p-value was .01; but then after adding 10/10/2009 to the data set my p-value increased to 0.4. At this point a conditional statement could be made saying IF(p-value increase > z) then stop regression at prior date. Thanks for your help, Rick [[alternative HTML version deleted]]