expected_feature_diff: Expected number of not optimally balanced features as defined...

Description Usage Arguments Value Note Examples

View source: R/expected_feature_diff.R

Description

Calculate expected number of features showing balance difference greater than a threshold

Usage

1
expected_feature_diff(n.feature, n.arm1, n.arm2, threshold)

Arguments

n.feature

(numeric) total number of features

n.arm1

(numeric) number of patients in comparison arm.

n.arm2

(numeric) number of patients in control arm

threshold

(numeric) positive number(s) for threshold to compare to.

Value

return a numeric vector for expected number of unbalanced features

Note

The output number indicates when running a randomized trial with n.arm1 and n.arm2 samples in two arms and n.feature features are of interest, the expected number of features showing balance difference greater than threshold. p = Prob(|Y|>threshold) is calculated from t distribution. With n.feature features in total, expected number of features with abs value > threshold can be calculated from Binomial(n.feature, p)

Examples

1
2
expected_feature_diff(n.feature = 10, n.arm1 = 240, n.arm2 = 300, threshold = 0.2)
expected_feature_diff(n.feature = 10, n.arm1 = 240, n.arm2 = 300, threshold = c(0.1, 0.25))

PropensitySub documentation built on July 29, 2021, 9:07 a.m.