psrwe_powerp: Get posterior samples based on PS-power prior approach

View source: R/psrwe_powerprior.R

psrwe_powerpR Documentation

Get posterior samples based on PS-power prior approach

Description

Draw posterior samples of the parameters of interest for the PS-power prior approach

Usage

psrwe_powerp(
  dta_psbor,
  v_outcome = "Y",
  outcome_type = c("continuous", "binary"),
  prior_type = c("fixed", "random"),
  prioronly = FALSE,
  ...,
  seed = NULL
)

Arguments

dta_psbor

A class PSRWE_BOR object generated by psrwe_borrow.

v_outcome

Column name corresponding to the outcome.

outcome_type

Type of outcomes: continuous or binary.

prior_type

Whether treat power parameter as fixed (fixed) or fully Bayesian (random).

prioronly

Whether only obtain power prior by excluding the current study data).

...

extra parameters for calling function rwe_stan.

seed

Random seed.

Value

A class PSRWE_RST list with the following objects

Observed

Observed mean and SD of the outcome by group, arm and stratum

Control

A list of estimated mean and SD of the outcome by stratum in the control arm

Treatment

A list of estimated mean and SD of the outcome by stratum in the treatment arm for RCT

Effect

A list of estimated mean and SD of the treatment effect by stratum for RCT

Borrow

Borrowing information from dta_psbor

stan_rst

Result from STAN sampling

Examples



data(ex_dta)
dta_ps <- psrwe_est(ex_dta,
       v_covs = paste("V", 1:7, sep = ""),
       v_grp = "Group",
       cur_grp_level = "current")
ps_borrow <- psrwe_borrow(total_borrow = 30, dta_ps)
rst <- psrwe_powerp(ps_borrow, v_outcome = "Y_Con", seed = 123)


psrwe documentation built on Aug. 21, 2026, 9:14 a.m.