Learn R Programming

sampcompR (version 0.2.6)

biv_per_variable: Returns a table based on the information of a biv_compare_object that indicates the proportion of biased variables. It can be outputted as HTML or LaTex Table, for example with the help of the stargazer function.

Description

Returns a table based on the information of a biv_compare_object that indicates the proportion of biased variables. It can be outputted as HTML or LaTex Table, for example with the help of the stargazer function.

Usage

biv_per_variable(
  biv_compare_object,
  ndigits = 1,
  varlabels = NULL,
  label_df = NULL
)

Value

A matrix, that indicates the proportion of bias for every individual variable. This is given separately for every comparison, as well as averaged over comparisons.

Arguments

biv_compare_object

A object returned by the biv_compare function.

ndigits

Number of digits that is shown in the table.

varlabels

A character vector containing labels for the variables.

label_df

A character vector containing labels for the data frames.

Examples

Run this code

data("card")

north <- card[card$south==0,]
white <- card[card$black==0,]

## use the function to plot the data 
bivar_data<-sampcompR::biv_compare(dfs = c("north","white"),
                                   benchmarks = c("card","card"),
                                   variables= c("age","educ","fatheduc","motheduc","wage","IQ"),
                                   data=TRUE)

table<-sampcompR::biv_per_variable(bivar_data)
noquote(table)

Run the code above in your browser using DataLab