TITLE: this is an example of a cross-classified time series analysis
with a univariate first-order autoregressive AR(1) model for a
continuous dependent variable with a covariate, linear trend, and random slope
DATA: FILE = ex9.39.dat;
VARIABLE: NAMES = w xm y x time subject;
USEVARIABLES = w xm y x timew timet;
WITHIN = x timew;
BETWEEN = (subject) w xm (time) timet;
CLUSTER = subject time;
LAGGED = y(1);
DEFINE: timew = time;
timet = time;
CENTER x (GROUPMEAN subject);
ANALYSIS: TYPE = CROSSCLASSIFIED RANDOM;
ESTIMATOR = BAYES;
PROCESSORS = 2;
BITERATIONS = (5000);
MODEL: %WITHIN%
y ON y&1;
s | y ON timew;
sx | y ON x;
%BETWEEN subject%
y s sx ON w xm;
y s sx WITH y s sx;
%BETWEEN time%
sx ON timet;
y WITH sx;
s@0;
OUTPUT: TECH1 TECH8;
PLOT: TYPE = PLOT3;