Description Usage Arguments Details Value Author(s) References See Also Examples
This function generates a posterior density sample for a semiparametric ordinal linear mixed model, using a Mixture of Multivariate Polya Trees prior for the distribution of the random effects.
1 2 |
fixed |
a two-sided linear formula object describing the
fixed-effects part of the model, with the response on the
left of a |
random |
a one-sided formula of the form |
prior |
a list giving the prior information. The list include the following
parameter: |
mcmc |
a list giving the MCMC parameters. The list must include
the following integers: |
state |
a list giving the current value of the parameters. This list is used if the current analysis is the continuation of a previous analysis. |
status |
a logical variable indicating whether this run is new ( |
data |
data frame. |
na.action |
a function that indicates what should happen when the data
contain |
This generic function fits an ordinal linear mixed-effects model with a probit link and a Mixture of Multivariate Polya Trees prior (see, Lavine 1992; 1994, for details about univariate PT) for the distribution of the random effects as described in Jara, Hanson and Lessaffre (2009):
Yij = k, if gammak-1 ≤q Wij < gammak, k=1,…,K
Wij | betaF, betaR , bi ~ N(Xij betaF + Zij betaR + Zij bi, 1), i=1,…,N, j=1,…,ni
thetai | G ~ G
G | alpha,mu,Sigma,O ~ PT^M(Pi^{mu,Sigma,O},A)
where, thetai = betaR + bi, beta = betaF, and O is an orthogonal matrix defining the decomposition of the centering covariance matrix. As in Hanson (2006), the PT prior is centered around a N_d(mu,Sigma) distribution. However, we consider the class of partitions Pi^{mu,Sigma, O}. The partitions starts with base sets that are Cartesian products of intervals obtained as quantiles from the standard normal distribution. A multivariate location-scale transformation, theta=mu+Sigma^{1/2} z, is applied to each base set yielding the final sets. Here Sigma^{1/2}=T'O' where T is the unique upper triangular Cholesky matrix of Sigma. The family A={alphae: e \in E*}, where E*=U_{m=0}^{M} E_d^m, with E_d and E_m the d-fold product of E=\{0,1\} and the the m-fold product of E_d, respectively. The family A was specified as alpha{e1 … em}=α m^2.
To complete the model specification, independent hyperpriors are assumed,
alpha | a0, b0 ~ Gamma(a0,b0)
beta | beta0, Sbeta0 ~ N(beta0,Sbeta0)
mu | mub, Sb ~ N(mub,Sb)
Sigma | nu0, T ~ IW(nu0,T)
O ~ Haar(q)
A uniform prior is used for the cutoff points. Note that the inverted-Wishart prior is parametrized such that E(Sigma)= T^{-1}/(nu0-q-1).
The precision or total mass parameter, α, of the DP
prior
can be considered as random, having a gamma
distribution, Gamma(a0,b0),
or fixed at some particular value.
The computational implementation of the model is based on the marginalization of
the PT
as descried in Jara, Hanson and Lessaffre (2009).
An object of class PTolmm
representing the linear
mixed-effects model fit. Generic functions such as print
, plot
,
and summary
have methods to show the results of the fit.
The results include betaR
, betaF
, mu
, the elements of
Sigma
, alpha
, and ortho
.
The function PTrandom
can be used to extract the posterior mean of the
random effects.
The list state
in the output object contains the current value of the parameters
necessary to restart the analysis. If you want to specify different starting values
to run multiple chains set status=TRUE
and create the list state based on
this starting values. In this case the list state
must include the following objects:
alpha |
giving the value of the precision parameter |
b |
a matrix of dimension (nsubjects)*(nrandom effects) giving the value of the random effects for each subject. |
cutoff |
a real vector defining the cutoff points. Note that the first cutoff must be fixed at 0 in this function. |
beta |
giving the value of the fixed effects. |
mu |
giving the mean of the normal baseline distributions. |
sigma |
giving the variance matrix of the normal baseline distributions. |
ortho |
giving the orthogonal matrix |
Alejandro Jara <atjara@uc.cl>
Tim Hanson <hansont@stat.sc.edu>
Hanson, T. (2006) Inference for Mixtures of Finite Polya Trees. Journal of the American Statistical Association, 101: 1548-1565.
Jara, A., Hanson, T., Lesaffre, E. (2009) Robustifying Generalized Linear Mixed Models using a New Class of Mixtures of Multivariate Polya Trees. Journal of Computational and Graphical Statistics, 18(4): 838-860.
Lavine, M. (1992) Some aspects of Polya tree distributions for statistical modelling. The Annals of Statistics, 20: 1222-11235.
Lavine, M. (1994) More aspects of Polya tree distributions for statistical modelling. The Annals of Statistics, 22: 1161-1176.
PTrandom
,
PTlmm
, PTglmm
,
DPMglmm
, DPMlmm
, DPMolmm
,
DPlmm
, DPglmm
, DPolmm
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | ## Not run:
# Schizophrenia Data
data(psychiatric)
attach(psychiatric)
# Prior information
prior <- list(M=4,
frstlprob=FALSE,
alpha=1,
nu0=4.01,
tinv=diag(1,1),
mub=rep(0,1),
Sb=diag(100,1),
beta0=rep(0,3),
Sbeta0=diag(1000,3))
# MCMC parameters
mcmc <- list(nburn=10000,
nsave=10000,
nskip=20,
ndisplay=100,
samplef=1)
# Initial state
state <- NULL
# Fitting the model
fit1 <- PTolmm(fixed=imps79o~sweek+tx+sweek*tx,random=~1|id,prior=prior,
mcmc=mcmc,state=state,status=TRUE)
fit1
# Summary with HPD and Credibility intervals
summary(fit1)
summary(fit1,hpd=FALSE)
# Plot model parameters
plot(fit1)
# Plot an specific model parameter
plot(fit1,ask=FALSE,nfigr=1,nfigc=2,param="sigma-(Intercept)")
# Extract random effects
PTrandom(fit1)
# Extract predictive information of random effects
aa<-PTrandom(fit1,predictive=TRUE)
aa
# Predictive marginal and joint distributions
plot(aa)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.