coef.qrjoint {qrjoint} | R Documentation |
Regression Coefficient Extraction from qrjoint Model Fit
Description
Post process MCMC output from qrjoint
to create summaries of intercept and slope function estimates
Usage
## S3 method for class 'qrjoint'
coef(object, burn.perc = 0.5, nmc = 200, plot = FALSE, show.intercept = TRUE,
reduce = TRUE, ...)
Arguments
object |
a fitted model of the class |
burn.perc |
a positive fraction indicating what fraction of the saved draws are to be discarded as burn-in |
nmc |
integer giving the number of samples, post burn-in, to be used in Monte Carlo averaging |
plot |
logical indicating if plots are to be made |
show.intercept |
whether to plot the intercept curve when |
reduce |
logical indicating if the tail-expanded grid of tau values is to be reduced to the regular increment grid |
... |
limited plotting parameters that are passed onto the call of |
Value
Extracts posterior draws of intercept and slope functions from saved draws of model parameters. A plot may be obtained if plot = TRUE
. A list is returned invisibly with three fields.
beta.samp |
a three-dimensional array of posterior samples of |
beta.est |
a three-dimensional array containing posterior summaries (2.5th, 50th, and 97.5th percentiles) of |
parametric |
a matrix with 3 columns giving the estimate (posterior median) and the lower and upper end points of the 95% posterior credible interval for |
See Also
qrjoint
and summary.qrjoint
for model fitting under qrjoint. Also see getBands
for plotting credible bands for coefficients.
Examples
## Plasma data analysis
# recoding variables
data(plasma)
plasma$Sex <- as.factor(plasma$Sex)
plasma$SmokStat <- as.factor(plasma$SmokStat)
plasma$VitUse <- 3 - plasma$VitUse
plasma$VitUse <- as.factor(plasma$VitUse)
# model fitting with 50 posterior samples from 100 iterations (thin = 2)
fit.qrj <- qrjoint(BetaPlasma ~ Age + Sex + SmokStat + Quetelet + VitUse + Calories +
Fat + Fiber + Alcohol + Cholesterol + BetaDiet, plasma, nsamp = 40, thin = 2)
## Not run:
betas <- coef(fit.qrj) ## no plots
betas <- coef(fit.qrj, plot = TRUE) ## estimates are plotted
## End(Not run)