cond.ranefs: Obtain conditional distribution of the random effects

View source: R/condb.R

cond.ranefsR Documentation

Obtain conditional distribution of the random effects

Description

Obtain the conditional distribution of the random effects of a joint model fit. This is achieved by a Metropolis scheme. Approximate normality across random effects is expected, and could be useful in diagnosing potential issues surrounding model fits.

Usage

cond.ranefs(fit, burnin = 500L, N = 3500L, tune = 2)

Arguments

fit

a joint model fit by the joint function.

burnin

Number of burn-in iterations to discard, defaults to 500.

N

Number of MC iterations to carry out post burn-in, defaults to 3500.

tune

Tuning parameter, problem-specific, defaults to 2.

Value

A list of class cond.b.joint containing:

walks

A list of length n containing the history of b_i post burn-in.

acceptance

A numeric vector containing the acceptance rate for each sampled subject.

M

The ModelInfo list from joint. Used by S3 methods for class cond.b.joint.

bhats

Posterior estimates at MLEs for the random effects. Same as ranef(joint).

Sigmahats

The covariances of bhats.

D

The MLE estimate for the variance-covariance matrix of random effects from fit.

q

Dimension of random effects.

K

Number of responses.

qnames

The names of the random effects as determined by call to joint.

burnin

The amount of burn-in used.

N

Number of MC iterations.

tune

tuning parameter used

nobs

The number of observations for each subject for each response.

elapsed.time

Time taken for cond.ranefs to complete.

See Also

ranef.joint plot.cond.b.joint

Examples


dat <- simData()$data
long.formulas <- list(Y.1 ~ time + cont + bin + (1 + time|id), 
                      Y.2 ~ time + cont + bin + (1 + time|id))
surv.formula <- Surv(survtime, status) ~ bin
fit <- joint(long.formulas, surv.formula, dat, list("gaussian","gaussian"))
cond.b <- cond.ranefs(fit, burnin = 50L, N = 1000, tune = 2)
cond.b
plot(cond.b) # Overall 
plot(cond.b, id = 1) # Plot the first subject (see plot.cond.b.joint).


gmvjoint documentation built on Oct. 6, 2024, 1:07 a.m.