Learn R Programming

sampcompR (version 0.2.6)

multi_per_variable: Returns a table based on the information of a multi_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 multi_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

multi_per_variable(
  multi_compare_objects,
  type = "coefs",
  label_df = NULL,
  lables_coefs = NULL,
  lables_models = NULL,
  ndigits = 1
)

Value

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

Arguments

multi_compare_objects

A object returned by the multi_compare function. Object can either be inserted as single object or as a character string containing the names of multiple objects.

type

The type of table, can either be "coefs", "models", or "complete". When coefs is chosen, the average bias of the coefficients is outputted, when models is chosen, the average bias for the models is outputted, and when complete is chosen, both are outputted.

label_df

A character vector containing labels for the data frames.

lables_coefs

A character vector containing labels for the coefficients.

lables_models

A character vector containing labels for the models.

ndigits

Number of digits that is shown in the table.

Examples

Run this code

data("card")

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

## use the function to plot the data
multi_data1 <- sampcompR::multi_compare(df = north, 
                                        bench = card,
                                        independent = c("age","fatheduc","motheduc","IQ"),
                                        dependent = c("educ","wage"),
                                        family = "ols") 

multi_data2 <- sampcompR::multi_compare(df = white, 
                                        bench = card,
                                        independent = c("age","fatheduc","motheduc","IQ"),
                                        dependent = c("educ","wage"),
                                        family = "ols") 

table<-sampcompR::multi_per_variable(multi_compare_objects = c("multi_data1","multi_data2"))
noquote(table)

Run the code above in your browser using DataLab