Title: | Patient-Reported Outcome Data Analysis with Stan |
---|---|
Description: | Algorithms and subroutines for patient-reported outcome data analysis. |
Authors: | Bin Wang [aut, cre] |
Maintainer: | Bin Wang <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.9.1.0 |
Built: | 2024-10-26 06:44:28 UTC |
Source: | CRAN |
Algorithms to implenment the Bayesian methods to denoise the measurement errors in patient-reported outcome data with repeated measures. Also, two algorithms are included to discount the subgroup means or proportions for clinical studies with multiple subgroups.
A Bayesian hierachical model to denoise PRO data using repeated measures.
bate(x0,x1,group,z,x.range,...) ResponderAnalysis(x,mcid,type="absolute",conf.level=0.95,show=TRUE)
bate(x0,x1,group,z,x.range,...) ResponderAnalysis(x,mcid,type="absolute",conf.level=0.95,show=TRUE)
x0 , x1
|
Numeric vector/matrix of observations at T0 (baseline) and T1 (end point) of a study. |
z |
covariates |
group |
group assignments. Current version support one or two groups only |
x.range |
range of data 'x0' and 'x1' |
x |
An R object generated by |
mcid |
A threshold to define 'responder' |
type |
The type of responder analysis: absolute or relative changes |
conf.level |
Confidence level of the credible interval |
show |
control whether results should be displayed |
... |
Parameters ("adapt_delta","stepsize","max_treedepth") to improve model fitting/convergence. |
'xfit': fitted results using stan.
'mu.t0': baseline mean.
'sig.t0': baseline SD.
'sig.me': SD of measurement errors.
'mu.active': mean effect size of active treatment.
'sig.active': sd of effect size of active treatment.
'mu.sham': mean effect size of sham treatment.
'sig.sham': sd of effect size of sham treatment.
data(n100x3) out1 <- bate(x0=ex100x3$w0,x1=ex100x3$w1,group=ex100x3$group) out1 ResponderAnalysis(out1,mcid=1,type="abs") out2 <- bate(x0=ex100x3$w0,x1=ex100x3$w1,group=ex100x3$group, control = list(adapt_delta = 0.8, stepsize = 5, max_treedepth = 10) ) out2 ResponderAnalysis(out2,mcid=1,type="abs") out <- out2 ResponderAnalysis(out,mcid=0.5,type="abs") ResponderAnalysis(out,mcid=1,type="abs") ResponderAnalysis(out,mcid=1.5,type="abs") ResponderAnalysis(out,mcid=0.3,type="relative") ResponderAnalysis(out,mcid=0.2,type="relative") ResponderAnalysis(out,mcid=0.1,type="relative")
data(n100x3) out1 <- bate(x0=ex100x3$w0,x1=ex100x3$w1,group=ex100x3$group) out1 ResponderAnalysis(out1,mcid=1,type="abs") out2 <- bate(x0=ex100x3$w0,x1=ex100x3$w1,group=ex100x3$group, control = list(adapt_delta = 0.8, stepsize = 5, max_treedepth = 10) ) out2 ResponderAnalysis(out2,mcid=1,type="abs") out <- out2 ResponderAnalysis(out,mcid=0.5,type="abs") ResponderAnalysis(out,mcid=1,type="abs") ResponderAnalysis(out,mcid=1.5,type="abs") ResponderAnalysis(out,mcid=0.3,type="relative") ResponderAnalysis(out,mcid=0.2,type="relative") ResponderAnalysis(out,mcid=0.1,type="relative")
A simulated data set of patient-reported outcomes with repeated measures.
A data frame with observations at beaseline and at a follow-up time.
w0 |
matrix | measures at baseline |
w1 |
matrix | measures at follow-up time |
group |
character | group assignment |
To compute the mean values of subgroups based on a Bayesian hierarchical model.
MeanHM(x,sigma)
MeanHM(x,sigma)
x |
Numeric vector of observations for the subgroups. |
sigma |
hyper-parameter. to be estimated or can be given. |
'theta': population mean.
'sigma': population standard deviation.
x1 <- rnorm(100,2,1) x2 <- rnorm(100,3,1.5) x3 <- rnorm(100,4,1.9) x <- cbind(x1,x2,x3) MeanHM(x,sigma=0.5)
x1 <- rnorm(100,2,1) x2 <- rnorm(100,3,1.5) x3 <- rnorm(100,4,1.9) x <- cbind(x1,x2,x3) MeanHM(x,sigma=0.5)
To compute the proportions of the subgroups assuming the subgroups
follow the same binomial distribution with parameter p
.
The approach on partial pooling by Bob Carpenter has been used –
"Hierarchical Partial Pooling for Repeated Binary Trials"
https://mc-stan.org/users/documentation/case-studies/pool-binary-trials.html
PropHM(x, n, kappa)
PropHM(x, n, kappa)
x |
Numeric vector of events. |
n |
Numberic vector of group sample sizes. |
kappa |
|
'data': data with estimates.
'alpha': parameter of the beta distribution.
'beta': parameter of the beta distribution.
out <- PropHM(x=c(5,10,2),n=c(20,50,30))
out <- PropHM(x=c(5,10,2),n=c(20,50,30))
A Bayesian hierachical model to analysis data from 2x2 (AB/BA) crossover trials.
xover(group,y1,y2,y0,...)
xover(group,y1,y2,y0,...)
y0 , y1 , y2
|
vectors of data from baseline, period 1, and period 2, respectively. |
group |
group or treatment sequence. |
... |
other parameters, i.e. 'control' for model fitting. |
'stat': summary statistics.
'best': estimates using Bayesian analysis.
xover(y0=rnorm(20,34,1.5),y1=rnorm(20,30,2), y2=rnorm(20,25,1.5),group=round(runif(20)<0.5))
xover(y0=rnorm(20,34,1.5),y1=rnorm(20,30,2), y2=rnorm(20,25,1.5),group=round(runif(20)<0.5))