biv_per_variable {sampcompR}R Documentation

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
)

Arguments

biv_compare_object

A object returned by the biv_compare function.

ndigits

Number of digits shown in the table.

varlabels

A character vector containing labels for the variables.

label_df

A character vector containing labels for the data frames.

Value

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

Examples


require(wooldridge)
card<-wooldridge::card

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

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

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


[Package sampcompR version 0.2.1 Index]