Package 'PSpower'

Title: Sample Size Calculation for Propensity Score Analysis
Description: Sample size calculations in causal inference with observational data are increasingly desired. This package is a tool to calculate sample size under prespecified power with minimal summary quantities needed.
Authors: Bo Liu [aut, cre], Xiaoxiao Zhou [ctb], Fan Li [ctb]
Maintainer: Bo Liu <[email protected]>
License: GPL-3
Version: 0.1.0
Built: 2025-02-15 05:40:27 UTC
Source: https://github.com/laubok/pspower

Help Index


Plots PSpower object

Description

Plots PSpower object

Usage

## S3 method for class 'PSpower'
plot(x, power = seq(0.6, 0.99, length.out = 100), ...)

Arguments

x

PSpower object

power

a range of powers to plot the power curve

...

ignored

Examples

obj <- PSpower(1, 0.05, 0.956, 0.5, 0.99, -1.74, -2.74, 19.86, 20.12, 0.14, 0.14)
plot(obj)

Prints PSpower object

Description

Prints PSpower object

Usage

## S3 method for class 'PSpower'
print(x, ...)

Arguments

x

PSpower object

...

ignored


Calculate sample size needed to achieve a prespecified power

Description

Calculate sample size needed to achieve a prespecified power

Usage

PSpower(
  tau,
  alpha,
  beta,
  r,
  phi,
  E1,
  E0,
  S1,
  S0,
  R1,
  R0,
  test = "two-sided",
  estimand = "ATE"
)

Arguments

tau

the estimated treatment effect $E[Y(1) - Y(0)]$

alpha

the significance level

beta

the power to achieve

r

the proportion of treated units

phi

the overlap coefficients

E1, E0, S1, S0, R1, R0

the summary quantities

test

whether one-sided or two-sided test is considered

estimand

the estimand (ATE, ATT, ATC or ATO), or a customized tilting function

Value

an object with the calculated sample size

Examples

PSpower(1, 0.05, 0.956, 0.5, 0.99, -1.74, -2.74, 19.86, 20.12, 0.14, 0.14)