install.packages("fUnitRoots") library(fUnitRoots) # Simulando uma serie temporal n = 200 alpha=0 rho=0.99 e = rnorm(n,0,2) y0 = 0 y = rep(0,n) y[1] = alpha + rho*y0+e[1] for (t in 2:n) y[t] = alpha + rho*y[t-1]+e[t] ts.plot(y) adfTest(y)