Skip to contents

This function is designed for use within weighting() and assess().'

Usage

.make.covariate.table(
  data,
  sample_indicator,
  covariates,
  sample_weights = NULL,
  estimation_method = "lr",
  disjoint_data = TRUE
)

Arguments

data

Dataframe comprised of "stacked" sample and target population data

sample_indicator

Binary variable denoting sample membership (1 = in sample, 0 = out of sample)

covariates

Vector of covariates in dataframe that predict sample membership

sample_weights

Name of column in dataframe holding weights for calculating weighted sample means of covariates in dataframe. If NULL, sample means are unweighted.

estimation_method

Method to estimate the probability of sample membership. Default is logistic regression ("lr"). Other methods supported are Random Forests ("rf") and Lasso ("lasso").

disjoint_data

Logical. Defaults to TRUE. If TRUE, then sample and population data are considered disjoint. This affects calculation of the weights.