trim_ps {beastt} | R Documentation |
Trim a prop_scr
object
Description
Trim a prop_scr
object
Usage
trim_ps(x, low = NULL, high = NULL, quantile = FALSE)
Arguments
x |
A |
low |
Low cut-off such that all participants with propensity scores less
than this value (or quantile if |
high |
High cut-off such that all participants with propensity scores
greater than this value (or quantile if |
quantile |
True/False value to determine if the cut-off values are based directly on the propensity scores (false) or their quantiles (true). By default this is false. |
Details
This function uses R's default method of quantile calculation (type 7)
Value
a prop_scr
object with a trimmed propensity score distribution
Examples
library(dplyr)
ps_obj <- calc_prop_scr(internal_df = filter(int_binary_df, trt == 0),
external_df = ex_binary_df,
id_col = subjid,
model = ~ cov1 + cov2 + cov3 + cov4)
trim_ps(ps_obj, low = 0.3, high = 0.7)
[Package beastt version 0.0.3 Index]