biv_bias_per_variable {sampcompR} | R Documentation |
Returns a table based on the information of a biv_compare_object
that
indicates the Average Absolute Bias (AARB) in Pearson's r or the Average Absolute
Relative Bias (AARB) in Pearson's r for every data frame 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 Average Absolute Bias (AARB) in Pearson's r or the Average Absolute
Relative Bias (AARB) in Pearson's r for every data frame It can be outputted as HTML or
LaTex Table, for example with the help of the stargazer
function.
Usage
biv_bias_per_variable(
biv_compare_object,
type = "rel_diff",
final_col = "difference",
ndigits = 3,
varlabels = NULL,
label_df = NULL
)
Arguments
biv_compare_object |
A object returned by the
|
type |
A character string, which is |
final_col |
A character string, indicating if the last column of the table
should display an average bias per variable of over all data frames ( |
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. |
Value
A matrix, that shows the Average Absolute Bias (AAB) or the Average Absolute Relative Bias (AARB) for every individual variable. This is given separately for every comparison data frame, as well as averaged over comparisons, or as the difference between the first and the last comparison.
Examples
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)
table1<-sampcompR::biv_bias_per_variable(bivar_data,type="rel_diff",
final_col="average",ndigits=2)
noquote(table1)
table2<-sampcompR::biv_bias_per_variable(bivar_data,type = "diff",
final_col="difference",ndigits=2)
noquote(table2)