Title: | Bayesian Ordinal Regression for High-Dimensional Data |
---|---|
Description: | Provides a function for fitting various penalized Bayesian cumulative link ordinal response models when the number of parameters exceeds the sample size. These models have been described in Zhang and Archer (2021) <doi:10.1186/s12859-021-04432-w>. |
Authors: | Kellie J. Archer [aut, cre] , Anna Seffernick [ctb], Shuai Sun [ctb], Yiran Zhang [aut] |
Maintainer: | Kellie J. Archer <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.1 |
Built: | 2024-11-25 07:03:15 UTC |
Source: | CRAN |
This data.frame is a subset that includes 41 transcripts and four phenotypic variables for 242 subjects with squamous cell cervical cancer.
cesc
cesc
This data.frame
includes the following variables:
a numeric vector storing age at cervical cancer diagnosis.
a numeric vector storing the number of cigarettes smoked per day.
a character vector representing race of the subject.
an ordered factor representing stage of cervical cancer.
a numeric vector representing expression of ENSG00000076344.
a numeric vector representing expression of ENSG00000077274.
a numeric vector representing expression of ENSG00000101888.
a numeric vector representing expression of ENSG00000115548.
a numeric vector representing expression of ENSG00000122884.
a numeric vector representing expression of ENSG00000125430.
a numeric vector representing expression of ENSG00000131370.
a numeric vector representing expression of ENSG00000135443.
a numeric vector representing expression of ENSG00000136457.
a numeric vector representing expression of ENSG00000138398.
a numeric vector representing expression of ENSG00000150636.
a numeric vector representing expression of ENSG00000161277.
a numeric vector representing expression of ENSG00000163510.
a numeric vector representing expression of ENSG00000164485.
a numeric vector representing expression of ENSG00000164651.
a numeric vector representing expression of ENSG00000166091.
a numeric vector representing expression of ENSG00000166342.
a numeric vector representing expression of ENSG00000171121.
a numeric vector representing expression of ENSG00000177173.
a numeric vector representing expression of ENSG00000180229.
a numeric vector representing expression of ENSG00000188817.
a numeric vector representing expression of ENSG00000197360.
a numeric vector representing expression of ENSG00000203601.
a numeric vector representing expression of ENSG00000225449.
a numeric vector representing expression of ENSG00000230201.
a numeric vector representing expression of ENSG00000233996.
a numeric vector representing expression of ENSG00000236138.
a numeric vector representing expression of ENSG00000236819.
a numeric vector representing expression of ENSG00000250602.
a numeric vector representing expression of ENSG00000253923.
a numeric vector representing expression of ENSG00000256980.
a numeric vector representing expression of ENSG00000259083.
a numeric vector representing expression of ENSG00000259134.
a numeric vector representing expression of ENSG00000260484.
a numeric vector representing expression of ENSG00000263612.
a numeric vector representing expression of ENSG00000264049.
a numeric vector representing expression of ENSG00000264954.
a numeric vector representing expression of ENSG00000265579.
a numeric vector representing expression of ENSG00000271711.
a numeric vector representing expression of ENSG00000272071.
a numeric vector representing expression of ENSG00000276517.
TCGAbiolinks TCGA-CESC
data("cesc") head(cesc)
data("cesc") head(cesc)
Extract Model Coefficients
## S3 method for class 'ordinalbayes' coef(object, method = mean, ...)
## S3 method for class 'ordinalbayes' coef(object, method = mean, ...)
object |
an |
method |
The default is |
... |
other arguements. |
alpha |
Summary estimates for the thresholds |
zeta |
Summary estimates for the unpenalized covariates. Only available if unpenalized covariates were included in the fitted model. |
beta |
Summary estimates for the penalized covariates |
gamma |
Summary estimates for the variable inclusion indicators. Not available when |
ordinalbayes
, print.ordinalbayes
, summary.ordinalbayes
, predict.ordinalbayes
data("cesc") fit<-ordinalbayes(Stage~1, data=cesc, x=cesc[,5:45], model="regressvi", gamma.ind="fixed", pi.fixed=0.99, adaptSteps=1000, burnInSteps=1000, nChains=2, numSavedSteps=2000, thinSteps=2, seed=26) coef(fit)
data("cesc") fit<-ordinalbayes(Stage~1, data=cesc, x=cesc[,5:45], model="regressvi", gamma.ind="fixed", pi.fixed=0.99, adaptSteps=1000, burnInSteps=1000, nChains=2, numSavedSteps=2000, thinSteps=2, seed=26) coef(fit)
This subset includes 2,009 transcripts and four phenotypic variables for 242 subjects with squamous cell cervical cancer.
finalSet
finalSet
The format is of formal class 'DESeqTransform' (package "DESeq2") with the following extractor functions:
includes rld transformed transcript expression data
includes phenotypic data: age_at_index
, cigarettes_per_day
, race
, and Stage
TCGAbiolinks TCGA-CESC
Ordinal Bayesian Regression Models for High-Dimensional Data
ordinalbayes( formula, data, x = NULL, subset, center = TRUE, scale = TRUE, a = 0.1, b = 0.1, model = "regressvi", gamma.ind = "fixed", pi.fixed = 0.05, c.gamma = NULL, d.gamma = NULL, alpha.var = 10, sigma2.0 = NULL, sigma2.1 = NULL, coerce.var = 10, lambda0 = NULL, nChains = 3, adaptSteps = 5000, burnInSteps = 5000, numSavedSteps = 9999, thinSteps = 3, parallel = TRUE, seed = NULL, quiet = FALSE )
ordinalbayes( formula, data, x = NULL, subset, center = TRUE, scale = TRUE, a = 0.1, b = 0.1, model = "regressvi", gamma.ind = "fixed", pi.fixed = 0.05, c.gamma = NULL, d.gamma = NULL, alpha.var = 10, sigma2.0 = NULL, sigma2.1 = NULL, coerce.var = 10, lambda0 = NULL, nChains = 3, adaptSteps = 5000, burnInSteps = 5000, numSavedSteps = 9999, thinSteps = 3, parallel = TRUE, seed = NULL, quiet = FALSE )
formula |
an object of class " |
data |
an optional data.frame, list or environment (or object coercible by |
x |
an optional matrix of predictors that are to be penalized in the model fitting process. |
subset |
an optional vector specifying a subset of observations to be used in the fitting process. |
center |
logical, if TRUE the penalized predictors are centered. |
scale |
logical, if TRUE the penalized predictors are scaled. |
a |
hyperprior for the penalty parameter lambda which is Gamma with parameters |
b |
hyperprior for the penalty parameter lambda which is Gamma with parameters |
model |
Specify which penalized ordinal model to fit as "regressvi", "lasso", "dess", or "normalss". |
gamma.ind |
indicates whether prior for the variable inclusion indicators is "fixed" or "random" (for models "regressvi", "dess", or "normalss"). |
pi.fixed |
constant prior for the variable inclusion indicators is when |
c.gamma |
hyperprior for the variable inclusion indicators is when |
d.gamma |
hyperprior for the variable inclusion indicators is when |
alpha.var |
variance for alpha_k thresholds in the MCMC chain (default 10). |
sigma2.0 |
variance for the spike when |
sigma2.1 |
variance for the slab when |
coerce.var |
variance associated with any unpenalized predictors in the MCMC chain (default 10). |
lambda0 |
parameter value for the spike when |
nChains |
number of parallel chains to run (default 3) |
adaptSteps |
number of iterations for adaptation (default 5,000). |
burnInSteps |
number of iterations of the Markov chain to run (default 5,000). |
numSavedSteps |
number of saved steps per chain (default 9,999). |
thinSteps |
thinning interval for monitors (default 3). |
parallel |
logical, run the MCMC on multiple processors (default TRUE). |
seed |
integer, seed to ensure reproducibility. |
quiet |
logical, when TRUE, suppress output of JAGS (or rjags) when updating models |
results
An object of class runjags
call
Model call
model
Name of the ordinal model that was fit
a
Value the user specified for a
b
Value the user specified for b
featureNames
Names of the penalized predictors
center
Value the user specified for center
scale
Value the user specified for scale
y
Observed ordinal response
x
Matrix of penalized predictors used in model fitting
w
Matrix of unpenalized predictors used in model fitting
gamma.ind
Value the user specified for gamma.ind
pi.fixed
Value the user specified for pi.fixed
if gamma.ind="fixed"
c.gamma
Value the user specified for c.gamma
if gamma.ind="random"
d.gamma
Value the user specified for d.gamma
if gamma.ind="random"
sigma2.0
Value the user specified for sigma2.0
if model="normalss"
sigma2.1
Value the user specified for sigma2.1
if model="normalss"
lambda0
value the user specified for lambda0
if model="dess"
print.ordinalbayes
, summary.ordinalbayes
, coef.ordinalbayes
# The number of adaptSteps, burnInSteps, and numSavedSteps was reduced for package testing data("cesc") data(reducedSet) fit<-ordinalbayes(Stage~1, data=cesc, x=cesc[,5:45], model="regressvi", gamma.ind="fixed", pi.fixed=0.99, adaptSteps=1000, burnInSteps=1000, nChains=2, numSavedSteps=2000, thinSteps=2, seed=26)
# The number of adaptSteps, burnInSteps, and numSavedSteps was reduced for package testing data("cesc") data(reducedSet) fit<-ordinalbayes(Stage~1, data=cesc, x=cesc[,5:45], model="regressvi", gamma.ind="fixed", pi.fixed=0.99, adaptSteps=1000, burnInSteps=1000, nChains=2, numSavedSteps=2000, thinSteps=2, seed=26)
Trace Plot and/or Density Plot of MCMC Output.
## S3 method for class 'ordinalbayes' plot(x, trace = TRUE, density = FALSE, ...)
## S3 method for class 'ordinalbayes' plot(x, trace = TRUE, density = FALSE, ...)
x |
an |
trace |
a logical value. If TRUE, trace plots are produced for each variable in the chain. |
density |
a logical value. If TRUE, density plots are produced for each variable in the chain. |
... |
other arguments. |
No returned value, called for side effects
data("cesc") fit<-ordinalbayes(Stage~1, data=cesc, x=cesc[,5:45], model="regressvi",gamma.ind="fixed", pi.fixed=0.99, adaptSteps=1000, burnInSteps=1000, nChains=2, numSavedSteps=2000, thinSteps=2, seed=26) plot(fit)
data("cesc") fit<-ordinalbayes(Stage~1, data=cesc, x=cesc[,5:45], model="regressvi",gamma.ind="fixed", pi.fixed=0.99, adaptSteps=1000, burnInSteps=1000, nChains=2, numSavedSteps=2000, thinSteps=2, seed=26) plot(fit)
Predicted Probabilities and Class for an Ordinal Bayes Fit.
## S3 method for class 'ordinalbayes' predict( object, neww = NULL, newdata, newx = NULL, model.select = "average", ... )
## S3 method for class 'ordinalbayes' predict( object, neww = NULL, newdata, newx = NULL, model.select = "average", ... )
object |
an |
neww |
an optional formula that includes the unpenalized variables to use for predicting the response. If omitted, the training data are used. |
newdata |
an optional data.frame that minimally includes the unpenalized variables to use for predicting the response. If omitted, the training data are used. |
newx |
an optional matrix of penalized variables to use for predicting the response. If omitted, the training data are used. |
model.select |
when |
... |
other arguments. |
predicted |
a matrix of predicted probabilities from the fitted model. |
class |
a vector containing the predicted class taken as that class having the largest predicted probability. |
ordinalbayes
, coef.ordinalbayes
, summary.ordinalbayes
, print.ordinalbayes
data("cesc") fit<-ordinalbayes(Stage~1, data=cesc, x=cesc[,5:45],, model="regressvi", gamma.ind="fixed", pi.fixed=0.99, adaptSteps=1000, burnInSteps=1000, nChains=2, numSavedSteps=2000, thinSteps=2, seed=26) phat<-predict(fit) table(phat$class, cesc$Stage)
data("cesc") fit<-ordinalbayes(Stage~1, data=cesc, x=cesc[,5:45],, model="regressvi", gamma.ind="fixed", pi.fixed=0.99, adaptSteps=1000, burnInSteps=1000, nChains=2, numSavedSteps=2000, thinSteps=2, seed=26) phat<-predict(fit) table(phat$class, cesc$Stage)
Print MCMC Summary Statistics
## S3 method for class 'ordinalbayes' print(x, ...)
## S3 method for class 'ordinalbayes' print(x, ...)
x |
A fitted ordinalbayes object. |
... |
other arguments. |
Matrix with the summaries from the x$results
object which of class 'runjags'.
Columns include Lower95, Median, Upper95, Mean, SD, Mode, MCerr, MC%ofSD, SSeff, AC.20, and psrf
ordinalbayes
, summary.ordinalbayes
, coef.ordinalbayes
, predict.ordinalbayes
data("cesc") fit<-ordinalbayes(Stage~1, data=cesc, x=cesc[,5:45], model="regressvi", gamma.ind="fixed", pi.fixed=0.99, adaptSteps=1000, burnInSteps=1000, nChains=2, numSavedSteps=2000, thinSteps=2) print(fit)
data("cesc") fit<-ordinalbayes(Stage~1, data=cesc, x=cesc[,5:45], model="regressvi", gamma.ind="fixed", pi.fixed=0.99, adaptSteps=1000, burnInSteps=1000, nChains=2, numSavedSteps=2000, thinSteps=2) print(fit)
This subset includes 41 transcripts and four phenotypic variables for 242 subjects with squamous cell cervical cancer.
reducedSet
reducedSet
The format is of formal class 'DESeqTransform' (package "DESeq2") with the following extractor functions:
includes rld transformed transcript expression data
includes phenotypic data: age_at_index
, cigarettes_per_day
, race
, and Stage
TCGAbiolinks TCGA-CESC
Summarize an Ordinal Bayes Object.
## S3 method for class 'ordinalbayes' summary(object, epsilon = 0.1, ...)
## S3 method for class 'ordinalbayes' summary(object, epsilon = 0.1, ...)
object |
A fitted |
epsilon |
a small positive value that is close to 0 for testing an interval null hypothesis for the beta parameters. |
... |
other arguments. |
alphamatrix |
The MCMC output for the threshold parameters. |
betamatrix |
The MCMC output for the penalized parameters. |
zetamatrix |
The MCMC output for the unpenalized parameters (if included). |
gammamatrix |
The MCMC output for the variable inclusion parameters (not available for lasso). |
gammamean |
The posterior mean of the variable inclusion indicators (not available for lasso)for the variable inclusion indicators (not available for lasso). |
gamma.BayesFactor |
Bayes factor for the variable inclusion indicators (not available for lasso). |
Beta.BayesFactor |
Bayes factor for the penalized parameters where the interval null is tested using epsilon. |
lambdamatrix |
The MCMC output for the penalty parameter (not available for normalss). |
ordinalbayes
, print.ordinalbayes
, coef.ordinalbayes
, predict.ordinalbayes
data("cesc") fit<-ordinalbayes(Stage~1, data=cesc, x=cesc[,5:45], model="regressvi", gamma.ind="fixed", pi.fixed=0.99, adaptSteps=1000, burnInSteps=1000, nChains=2, numSavedSteps=2000, thinSteps=2, seed=26) summary.fit<-summary(fit) names(summary.fit) names(which(summary.fit$Beta.BayesFactor>5)) names(which(summary.fit$gamma.BayesFactor>5))
data("cesc") fit<-ordinalbayes(Stage~1, data=cesc, x=cesc[,5:45], model="regressvi", gamma.ind="fixed", pi.fixed=0.99, adaptSteps=1000, burnInSteps=1000, nChains=2, numSavedSteps=2000, thinSteps=2, seed=26) summary.fit<-summary(fit) names(summary.fit) names(which(summary.fit$Beta.BayesFactor>5)) names(which(summary.fit$gamma.BayesFactor>5))