A function to simulate spatial parametric proportional hazards model. The function works by simulating candidate survival times using MCMC in parallel for each individual based on each individual's covariates and the common parameter effects, beta.
simsurv(
X = cbind(age = runif(100, 5, 50), sex = rbinom(100, 1, 0.5), cancer = rbinom(100, 1,
0.2)),
beta = c(0.0296, 0.0261, 0.035),
omega = 1,
dist = exponentialHaz(),
coords = matrix(runif(2 * nrow(X)), nrow(X), 2),
cov.parameters = c(1, 0.1),
cov.model = ExponentialCovFct(),
mcmc.control = mcmcpars(nits = 1e+05, burn = 10000, thin = 90),
savechains = TRUE
)
in list element 'survtimes', a vector of simulated survival times (the last simulated value from the MCMC chains) in list element 'T' the MCMC chains
a matrix of covariate information
the parameter effects
vector of parameters for the baseline hazard model
the distribution choice: exp or weibull at present
matrix with 2 columns giving the coordinates at which to simulate data
a vector: the parameters for the covariance function
an object of class covmodel, see ?covmodel
mcmc control paramters, see ?mcmcpars
save all chains? runs faster if set to FALSE, but then you'll be unable to conduct convergence/mixing diagnostics
covmodel, survspat, tpowHaz, exponentialHaz, gompertzHaz, makehamHaz, weibullHaz