Title: | Bayesian Prior and Posterior Predictive Replication Assessment |
---|---|
Description: | Utilize the Bayesian prior and posterior predictive checking approach to provide a statistical assessment of replication success and failure. The package is based on the methods proposed in Zhao,Y., Wen X.(2021) <arXiv:2105.03993>. |
Authors: | Yi Zhao [aut, cre], Xiaoquan Wen [aut] |
Maintainer: | Yi Zhao <[email protected]> |
License: | GPL-2 |
Version: | 0.1.1 |
Built: | 2025-02-14 05:41:50 UTC |
Source: | https://github.com/cran/PRP |
This is a dataset containing several effect estimates and their standard errors for the impact of cardivascular disease on the mortality of COVID-19 in the literature.
data("mortality")
data("mortality")
An object of class data.frame
with 6 rows and 3 columns.
data("mortality")
data("mortality")
Posterior Predictive Replication p-value Calculation
posterior_prp( beta, se, L = 1000, r_vec = c(0, 8e-04, 0.006, 0.024), test = Q, print_test_dist = FALSE )
posterior_prp( beta, se, L = 1000, r_vec = c(0, 8e-04, 0.006, 0.024), test = Q, print_test_dist = FALSE )
beta |
A vector, containing the estimates in the original study and the replication study. |
se |
A vector, containing the standard errors of the estimates in the original study and the replication study. |
L |
A value, determining the times of repeating simulation. |
r_vec |
A vector, defining the prior reproducible model. Each r value corresponds to a probability of sign consistency. |
test |
A function designed to calculate the test quantity, the default one is the Cochran's Q test statistics. |
print_test_dist |
A boolean, determining whether the simulated test statistics value difference will be plot as a histogram or not. Default is False. |
A list with the following components:
grid |
Detailed grid values for the hyperparameters. |
test_statistics |
The test statistics used in calculating the replication p-value. |
n_sim |
The L value. |
test_stats_dif |
The difference between the simulated test statistics quantity and the original value. |
pvalue |
The resulting posterior predictive replicaiton p-value. |
data("mortality") res = posterior_prp(beta = mortality$beta, se = mortality$se, test=Q) names(res) print(res$pvalue)
data("mortality") res = posterior_prp(beta = mortality$beta, se = mortality$se, test=Q) names(res) print(res$pvalue)
Assessing the prior predictive distribution and calculating the replication p-value based on it.
prior_prp( beta, se, r_vec = c(0, 8e-04, 0.006, 0.024), test = "two_sided", report_PI = FALSE )
prior_prp( beta, se, r_vec = c(0, 8e-04, 0.006, 0.024), test = "two_sided", report_PI = FALSE )
beta |
A 2-D vector, containing the estimates in the original study and the replication study. |
se |
A 2-D vector, containing the standard errors of the estimates in the original study and the replication study. |
r_vec |
A vector, defining the prior reproducible model. Each r value corresponds to a probability of sign consistency. |
test |
A string, determining which test statistics to utilize. If not specified, the default two-sided one will be used. |
report_PI |
A boolean, denoting whether the 95% predictive interval for the estimates be reported or not. This option is only valid for two-sided test statistics. The default is FALSE. |
A list with the following components:
grid |
The detailed grid values for the hyperparameters. |
test_statistics |
The test statistics used in calculating the replication p-value. |
pvalue |
The resulting prior predictive replicaiton p-value. |
predictive_interval |
The 95% predictive interval if required. |
data("RPP_filtered") attach(RPP_filtered) rpp_pval<-sapply(1:nrow(RPP_filtered),function(x) prior_prp(beta=c(beta_orig[x], beta_rep[x]),se=c(se_orig[x], se_rep[x]))$pvalue)
data("RPP_filtered") attach(RPP_filtered) rpp_pval<-sapply(1:nrow(RPP_filtered),function(x) prior_prp(beta=c(beta_orig[x], beta_rep[x]),se=c(se_orig[x], se_rep[x]))$pvalue)
This function transforms the probability of simulated beta_j having the same sign with the underlying true effect barbeta to the corresponding heterogeneity r parameter value.
prob_to_r(p)
prob_to_r(p)
p |
A value, the required probability of sign consistency. |
The corresponding heterogeneity parameter value.
This contains the RP:P data from the Open Science Collaboration project after filtering.
data("RPP_filtered")
data("RPP_filtered")
An object of class data.frame
with 73 rows and 5 columns.
data("RPP_filtered")
data("RPP_filtered")
This is a dataset containing several effect estimates and their standard errors for the impact of cardiovascular disease on the severe case rate of COVID-19 in the literature.
data("severity")
data("severity")
An object of class data.frame
with 6 rows and 3 columns.
data("severity")
data("severity")