Learn R Programming

BMisc (version 1.4.9)

compare_binary: Compare Variables across Groups

Description

compare_binary takes in a variable e.g. union and runs bivariate regression of x on treatment (for summary statistics)

Usage

compare_binary(
  x,
  on,
  dta,
  w = rep(1, nrow(dta)),
  report = c("diff", "levels", "both")
)

Value

matrix of results

Arguments

x

variables to run regression on

on

binary variable

dta

the data to use

w

weights

report

which type of report to make; diff is the difference between the two variables by group

Examples

Run this code
dta <- data.frame(x = rnorm(100), treat = rep(c(0, 1), 50))
compare_binary("x", "treat", dta, report = "diff")

Run the code above in your browser using DataLab