absolute_corr_fun: Check Covariate Balance Using Absolute Approach

Description Usage Arguments Value Examples

View source: R/absolute_corr_fun.R

Description

Checks covariate balance based on absolute correlations for given data sets.

Usage

1

Arguments

w

A vector of observed continuous exposure variable.

c

A data table of observed covariates variable.

Value

The function returns a list including:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
set.seed(291)
n <- 100
mydata <- generate_syn_data(sample_size=100)
year <- sample(x=c("2001","2002","2003","2004","2005"),size = n, replace = TRUE)
region <- sample(x=c("North", "South", "East", "West"),size = n, replace = TRUE)
mydata$year <- as.factor(year)
mydata$region <- as.factor(region)
mydata$cf5 <- as.factor(mydata$cf5)
data.table::setDT(mydata)
cor_val <- absolute_corr_fun(mydata[,2], mydata[, 3:length(mydata)])
print(cor_val$mean_absolute_corr)

CausalGPS documentation built on Feb. 7, 2022, 5:12 p.m.