title: MCMC GMM with ECLS-K math data
data: file is Math GMM.dat;
variable: names are y1-y4;
classes =c(2);
analysis:
type = mixture;
estimator = BAYES; !This option uses the MCMC Gibbs sampler as a default
chains = 2; !Two chains is the default in Mplus Version 6
distribution = 10,000; !The first half of the iterations is always used as burn-in
point = mean; !Estimating the median is the default for Mplus
model priors: !This option allows for priors to be changed from default values
a ~ N(28,10); !Normal prior on mixture class 1 intercept
b ~ N(13,10); !Normal prior on mixture class 1 slope
c ~ N(17,10); !Normal prior on mixture class 2 intercept
d ~ N(9,10); !Normal prior on mixture class 2 slope
e ~ D(80,510); !Dirichlet prior on mixture class proportions
model:
%overall%
y1-y4*.5;
i s j y1@0 y2@1 y3@2 y4@3;
i*1; s*.2;
[c#1*-1](e); !Setting up Dirichlet prior on mixture class proportions with arbitrary identifier (e)
y1 y2 y3 y4 (1);
%c#1%
[i*28](a); !Setting up Normal prior on mixture class 1 intercept with arbitrary identifier (a)
[s*13](b); !Setting up Normal prior on mixture class 1 slope with arbitrary identifier (b)
i with s;
i; s;
%c#2%
[i*17](c); !Setting up Normal prior on mixture class 2 intercept with arbitrary identifier (c)
[s*9](d); !Setting up Normal prior on mixture class 2 intercept with arbitrary identifier (d)
i with s;
i; s;
plot:
type = plot2; !Requesting all MCMC plots: convergence, posterior densities, and autocorrelations
output: stand;
cinterval;