cumlogitRE.predict {glmmAK}R Documentation

Prediction for logit and cumulative logit model with random effects

Description

This function compute predictive probabilities of the response categories for specified combinations of covariates. It is based on the MCMC output obtained using cumlogitRE.

Usage

cumlogitRE.predict(nobs, v, x, vb, xb, cluster,
   intcpt.random=FALSE, hierar.center=FALSE,     
   drandom=c("normal", "gspline"),
   C=1, logit.order=c("decreasing", "increasing"),
   betaF, betaR, varR, is.varR=TRUE,
   prior.gspline,
   probs, values=FALSE,
   dir=getwd(), wfile, indfile, header=TRUE, logw, is.indfile,
   skip=0, nwrite)                               

Arguments

nobs number of covariate combinations for which we want to perform a prediction
v covariate combinations for which we want to perform a prediction.
It should have the same structure as in cumlogitRE used to obtain the MCMC output
x covariate combinations for which we want to perform a prediction.
It should have the same structure as in cumlogitRE used to obtain the MCMC output
vb covariate combinations for which we want to perform a prediction.
It should have the same structure as in cumlogitRE used to obtain the MCMC output
xb covariate combinations for which we want to perform a prediction.
It should have the same structure as in cumlogitRE used to obtain the MCMC output
cluster vector defining pertinence of the single observations to clusters. It is useful when we want to predict longitudinal profiles.
See also the same argument in cumlogitRE.
intcpt.random see the same argument in cumlogitRE
hierar.center see the same argument in cumlogitRE
drandom see the same argument in cumlogitRE
C see the same argument in cumlogitRE
logit.order see the same argument in cumlogitRE
betaF sampled values of the fixed effects. This should be a (sub)sample from the MCMC output stored in the file ‘betaF.sim
betaR sampled values of the mean of random effects. This should be a (sub)sample from the MCMC output stored in the file ‘betaR.sim
It is only needed if hierar.center is TRUE.
varR sampled values of either (co)variance matrices or precision (matrices) for random effects if there are any. This should be a (sub)sample of either the first or second half of the columns stored in the file ‘varR.sim
is.varR logical indicating whether varR gives (co)variance (is.varR TRUE) or precisions (inverse variances) (is.varR FALSE)
prior.gspline if drandom is gspline this is a list specifying the G-splines. It should have the same structure as the same argument in cumlogitRE used to obtain the MCMC output. However, it is satisfactory if the items K, delta and sigma are given.
probs probabilities for which the (pointwise) sample quantiles of the predictive probabilities should be computed.
If not given only average (and values) of the predictive probabilities are computed
values if TRUE also values of the predictive probabilities at each (MCMC) iteration are returned.
If FALSE only sample mean (and quantiles) of the predictive probabilities are returned
dir character giving the directory where the file with (sampled) G-spline (log-)weights is stored.
Needed only if drandom is gspline.
wfile character giving the name of the file with (sampled) G-spline (log-)weights.
Needed only if drandom is gspline. In most cases, for univariate G-spline this argument will be equal to “logweight.sim” and for bivariate G-spline equal to “weight.sim”.
indfile character giving the name of the file where we stored indeces of these G-spline components for which the weights are stored in the file given by wfile. The corresponding file should have the same structure as ‘knotInd.sim’ created by cumlogitRE.
Needed only if is.indfile is TRUE. In most cases, for univariate G-spline it does not have to be specified and for bivariate G-spline it will be equal to “knotInd.sim”.
header logical indicating whether the files wfile, indfile contain a header.
Needed only if drandom is gspline.
logw logical indicating whether the file wfile contains logarithms of the weights.
Needed only if drandom is gspline. In most cases, for univariate G-spline it will be TRUE and for bivariate G-spline it will be FALSE.
is.indfile logical.
If TRUE then wfile contains only the non-zero weights and the G-spline is reconstructed using indfile.
If FALSE then wfile must contain on each row weights of all components and indfile is ignored.
Needed only if drandom is gspline and random effects are bivariate.
skip number of data rows that should be skipped at the beginning of the files wfile, indfile.
nwrite frequency with which is the user informed about the progress of computation (every nwriteth iteration count of iterations change)

Value

A list with the following components (description below applies for the case with prob=0.5)

Mean a matrix with C+1 columns giving in each row posterior predictive mean of category probabilities P(Y=0),...,P(Y=C) for a given covariate combination.
50% a matrix with C+1 columns giving in each row posterior predictive quantile (here 50% quantile) of category probabilities for a given covariate combination.
There is one component of this type in the resulting list for each value of probs.
values a matrix with (C+1)*n columns, where n denotes the number of covariate combinations for which we perform the prediction, and number of rows equal to the length of the MCMC. The first C+1 columns give sampled category probabilities for the first covariate combination, the second C+1 columns give sampled category probabilities for the second covariate combination etc.
It is returned only if values is TRUE.

Author(s)

Arnošt Komárek arnost.komarek[AT]mff.cuni.cz

References

Komárek, A. and Lesaffre, E. (2008). Generalized linear mixed model with a penalized Gaussian mixture as a random-effects distribution. Computational Statistics and Data Analysis, 52, 3441–3458.

See Also

cumlogitRE, cumlogit, glm, polr.


[Package glmmAK version 1.2 Index]