I'm following http://www.stat.pitt.edu/stoffer/tsa3/R_toot.htm to ramp up on both time series and R. About 40% of the way down, the tutorial uses lag1.plot from astsa and lag.plot from stats. The positioning of the dots look different between the two. Nothing jumps out at me from the help pages that explains why they would be different. Can anyone confirm this difference, and hopefully suggest explanations?
Roy Mendelssohn - NOAA Federal
2015-Apr-18 02:56 UTC
[R] "lag1.plot {astsa}" vs. "lag.plot {stats}"
Not certain which plot you are looking at, but my guess is the answer is contained somewhere here: http://www.stat.pitt.edu/stoffer/tsa3/Rissues.htm in particular perhaps issues 4-5. -Roy M.> On Apr 17, 2015, at 7:30 PM, Paul Domaskis <paul.domaskis at gmail.com> wrote: > > I'm following http://www.stat.pitt.edu/stoffer/tsa3/R_toot.htm to ramp > up on both time series and R. About 40% of the way down, the tutorial > uses lag1.plot from astsa and lag.plot from stats. The positioning of > the dots look different between the two. Nothing jumps out at me from > the help pages that explains why they would be different. Can anyone > confirm this difference, and hopefully suggest explanations? > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.********************** "The contents of this message do not reflect any position of the U.S. Government or NOAA." ********************** Roy Mendelssohn Supervisory Operations Research Analyst NOAA/NMFS Environmental Research Division Southwest Fisheries Science Center ***Note new address and phone*** 110 Shaffer Road Santa Cruz, CA 95060 Phone: (831)-420-3666 Fax: (831) 420-3980 e-mail: Roy.Mendelssohn at noaa.gov www: http://www.pfeg.noaa.gov/ "Old age and treachery will overcome youth and skill." "From those who have been given much, much will be expected" "the arc of the moral universe is long, but it bends toward justice" -MLK Jr.
On Apr 17, 2015, at 7:30 PM, Paul Domaskis <paul.domaskis <at> gmail.com> wrote:> I'm following http://www.stat.pitt.edu/stoffer/tsa3/R_toot.htm to > ramp up on both time series and R. About 40% of the way down, the > tutorial uses lag1.plot from astsa and lag.plot from stats. The > positioning of the dots look different between the two. Nothing > jumps out at me from the help pages that explains why they would be > different. Can anyone confirm this difference, and hopefully > suggest explanations?Roy Mendelssohn - NOAA Federal <roy.mendelssohn <at> noaa.gov> writes:> Not certain which plot you are looking at, but my guess is the > answer is contained somewhere here: > http://www.stat.pitt.edu/stoffer/tsa3/Rissues.htm in particular > perhaps issues 4-5.Yup, that's it. What the stats package refers to as lag is time-advancement. I assume that this odd definition is due to the fact that we read from left to right, so a time plot that shifts right looks like it's racing ahead, even though it is sliding backward along the time axis. Heck, it's even infused in the way we refer to advancing in time, which *often* refers to time progression, i.e. moving rightward along the time access. Anyway, the point where this wrinkle occurs in the aforementioned tutorial is lag.plot(dljj, 9, do.lines=FALSE) lag1.plot(dljj, 9) # if you have astsa loaded (not shown) The following code shows the correction to the use of lag.plot so that it matches lag1.plot: # From tutorial lag.plot(dljj, 9, do.lines=FALSE) # Correction deve.new() lag.plot(dljj, set.lags=-1:-9, do.lines=FALSE) # astsa's implementation matches above Correctoion dev.new() lag1.plot(dljj, 9)