data(macro)
y=macro[,"INF"]
const=rep(1,nrow(y))
trend=seq(nrow(y))/nrow(y)
D=cbind(const,trend) #seasonal dummies can be specified here
KPSS=kpss(y,x=D,lags = c("short", "long", "nil")[2],
use=c("nw","ba")) # If argument use isn't NULL, the argument "lags" will be ignored.
KPSS$teststat
KPSS$cval
KPSS$lag
kpss(y,x=D,lags = c("short", "long", "nil")[2],use=15)
kpss(y,x=D,
lags = c("short", "long", "nil")[2],
use=NULL) #if "use=NULL", argument "lags" will be chosen as input.
Run the code above in your browser using DataLab