TITLE: this is an example of a two-level time series analysis
with a univariate first-order autoregressive AR(1) model
for a continuous dependent variable with a random intercept,
random AR(1) and AR(2) slope, and random residual variance
DATA: FILE = ex9.30.dat;
VARIABLE: NAMES = z y w time subject;
BETWEEN = z w;
CLUSTER = subject;
LAGGED = y(2);
TINTERVAL = time (1);
ANALYSIS: TYPE = TWOLEVEL RANDOM;
ESTIMATOR = BAYES;
PROCESSORS = 2;
BITERATIONS = (2000);
MODEL: %WITHIN%
s1 | y ON y&1;
s2 | y ON y&2;
logv | y;
%BETWEEN%
y ON w;
s1-s2 ON w;
logv ON w;
y s1 s2 logv WITH y s1 s2 logv;
z ON y s1 s2 logv;
OUTPUT: TECH1 TECH8 FSCOMPARISON;
PLOT: TYPE = PLOT3;
FACTORS = ALL;