Learn R Programming

psrwe (version 3.2)

psrwe_powerp_watt: Get posterior samples based on PS-power prior approach (WATT)

Description

Draw posterior samples of the parameters of interest for the PS-power prior approach with weights of ATT (WATT)

Usage

psrwe_powerp_watt(
  dta_psbor,
  v_outcome = "Y",
  outcome_type = c("continuous", "binary"),
  mcmc_method = c("rstan", "analytic", "wattcon"),
  tau0_method = c("Wang2019", "weighted"),
  ipw_method = c("Heng.Li", "Xi.Ada.Wang"),
  ...,
  seed = NULL
)

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

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.

mcmc_method

MCMC sampling via either rstan, analytic, or wattcon.

tau0_method

Method for estimating SD0 via either Wang2019 or weighted for continuous outcomes only.

ipw_method

Method for IPW via either Heng.Li or Xi.Ada.Wang.

...

extra parameters for calling function rwe_stan.

seed

Random seed.

Examples

Run this code

# \donttest{
data(ex_dta)
dta_ps <- psrwe_est(ex_dta,
       v_covs = paste("V", 1:7, sep = ""),
       v_grp = "Group",
       cur_grp_level = "current",
       nstrata = 1)
ps_borrow <- psrwe_borrow(total_borrow = 30, dta_ps)
rst <- psrwe_powerp_watt(ps_borrow, v_outcome = "Y_Bin", seed = 123)# }

Run the code above in your browser using DataLab