So I was playing around with R, trying to figure out how to do basic time series stuff. Using the Box-Jenkins Series G ("airline passengers") data, I wanted to plot ACF and PACF. So here's my code:
library(foreign) bjg <- read.dta("http://www.stata-press.com/data/r9/air2.dta") airline.ts <- ts(bjg[, 1], start=c(1949,1), freq=12) layout(1:2) acf(airline.ts,ci.type="ma",lag.max=40) pacf(airline.ts,lag.max=40)
But then compare the same graphs from Stata, using the same data set.
While the ACFs look alike, the PACFs are clearly different between R and Stata. How can that be? Where's my mistake?
P.S.: Here's the Stata code:
webuse air2 tsset t ac air pac air