posterior_prp {PRP}R Documentation

Posterior Predictive Replication p-value Calculation

Description

Posterior Predictive Replication p-value Calculation

Usage

posterior_prp(
  beta,
  se,
  L = 1000,
  r_vec = c(0, 8e-04, 0.006, 0.024),
  test = Q,
  print_test_dist = FALSE
)

Arguments

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.

Value

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.

Examples

data("mortality")
res = posterior_prp(beta = mortality$beta, se = mortality$se, test=Q)
names(res)
print(res$pvalue)


[Package PRP version 0.1.1 Index]