simsurv: simsurv function

Description Usage Arguments Value See Also

Description

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.

Usage

1
2
3
4
5
6
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 = covmodel(model = "exponential",
  pars = NULL), mcmc.control = mcmcpars(nits = 1e+05, burn = 10000, thin =
  90), savechains = TRUE)

Arguments

X

a matrix of covariate information

beta

the parameter effects

omega

vector of parameters for the baseline hazard model

dist

the distribution choice: exp or weibull at present

coords

matrix with 2 columns giving the coordinates at which to simulate data

cov.parameters

a vector: the parameters for the covariance function

cov.model

an object of class covmodel, see ?covmodel

mcmc.control

mcmc control paramters, see ?mcmcpars

savechains

save all chains? runs faster if set to FALSE, but then you'll be unable to conduct convergence/mixing diagnostics

Value

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

See Also

covmodel, survspat, tpowHaz, exponentialHaz, gompertzHaz, makehamHaz, weibullHaz


bentaylor1/spatsurv documentation built on May 12, 2019, 3:02 p.m.