stratifyByPs uses the provided propensity scores to stratify persons. Additional
stratification variables for stratifications can also be used.
stratifyByPs(population, numberOfStrata = 5, stratificationColumns = c(), baseSelection = "all")
A data frame with the three columns described below
How many strata? The boundaries of the strata are automatically defined to contain equal numbers of target persons.
Names of one or more columns in the
What is the base selection of subjects where the strata bounds are to be determined? Strata are defined as equally-sized strata inside this selection. Possible values are "all", "target", and "comparator".
Returns a date frame with the same columns as the input data plus one extra column: stratumId.
The data frame should have the following three columns:
|(numeric)||A unique identifier for each row (e.g. the person ID)|
|(integer)||Column indicating whether the person is in the target (1) or comparator|