Description Usage Arguments Details Value References Examples
The writePCModel
function writes a NIMBLE model that incorporates the
process convolution approach.
1 2 3 4 5 |
PCDataObj |
An object of class |
typeOfZero |
A character string specifying the type of zero that will be assumed. The two options are "censored" (default) and "true". If there are no zeros for the outcome of interest then this argument is superfluous. |
covariates |
A concatenated character string specifying the covariates that will be included in the model. When there are no zeros in the data, or when zeros are assumed to be censored, there is only a single set of covariates. When the zeros are assumed to be true zeros, there are two model parts, a binary and a marginalized. The covariates specified in this argument will be used in the marginalized part of the model. |
covariatesForBinary |
A concatenated character string specifying
covariates that will be included in the binary part of the marginalized
two part model. This argument will only be used if there are zeros in
the data and |
coefPrior |
A character string specifying the prior that should be assumed for model coefficients. The options are "sdunif" (default), "dnorm", and "Cauchy". See details for more information. |
multiSampsPerSubj |
A TRUE/FALSE variable indicating whether or not there are mutliple samples per subject. |
errorVarianceLevel |
A character string specifying the level at which
the error variance should be estimated. The options are "sample" (default),
"subject", and "overall". As an example, if
|
latentVarianceLevel |
A character string specifying the level at which the latent variance should be estimated. The options are "sample" (default), "subject", and "overall". |
For the model coefficients, three possible priors are allowed.
sdunif For all model coefficients, including the intercept(s), the prior is given by
β \sim \mbox{N}(0, σ^{2}_{β}); σ_{β} \sim \mbox{U}(0,10).
dnorm For all model coefficients, including the intercept(s), the prior is given by
β \sim \mbox{N}(0, 0.00001).
Cauchy The Cauchy priors are specified according to the recommendations of Gelman et al. (input citation). While Gelman used the Cauchy priors in the context of logistic regression, imaging mass spectrometry data is often lognormally distributed, and on the log scale parameter spaces may need to be constrained in a similar way. For intercepts, the prior is
β_{0} \sim \mbox{Cauchy}(0, \mbox{scale}=10).
For other model coefficients the prior is
β \sim \mbox{Cauchy}(0, \mbox{scale}=2.5).
A list containing the model and other information
supplied to the createPCData
function.
model
A model object created using the
link[nimble]{nimbleCode}
function.
covariates
A concatenated character string of the covariate names.
covariatesForBinary
A concatenated character string of the covariate names for the binary part of the marginalized two-part model.
coefPrior
A character string specifying the assumed prior for the model coefficients.
multiSampsPerSubj
A TRUE/FALSE variable indicating whether there are multiple samples per subject.
errorVarianceLevel
A character string specifying the level (overall, subject, or sample) at which the error variance will be estimated.
latentVarianceLevel
A character string specifying the level (overall, subject, or sample) at which the latent variance will be estimated.
typeOfZero
A character string specifying the assumption made about the type of zeros in the data.
de Valpine, P., D. Turek, C.J. Paciorek, C. Anderson-Bergman, D. Temple Lang, and R. Bodik. 2017. Programming with models: writing statistical algorithms for general model structures with NIMBLE. Journal of Computational and Graphical Statistics. 26: 403-413.
1 2 3 4 5 6 7 8 9 10 11 12 13 | data("TAMdata")
# The dataset is trimmed only for the speed of the example
TAMdata <- TAMdata[TAMdata$subject < 3, ]
TAMdata <- rScale(TAMdata, subjectVar = 'subject', sampleVar = 'ROI',
xCoord = 'x', yCoord = 'y')
rangs <- estRange(TAMdata, outcome = 'X1282.auc', spatialVar = 'TAM',
semivEst = 'modulus', logTransform = TRUE)
structs <- chooseStructures(rangs)
PCdat <- createPCData(structs, trimData = FALSE,
covariates = c("secondary", "TAM", "secTAM"),
covariateTypes = c("binary", "binary", "binary"),
covariateLevels = c("sample", "raster", "raster"))
PCmod <- writePCModel(PCdat, multiSampsPerSubj = TRUE, typeOfZero = "censored")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.