uni_compare_table {sampcompR}R Documentation

Create an Output-Table of a uni_compare_object

Description

Returns a table based on the information of an uni_compare_object which can be outputted as HTML or LaTex Table, for example with the help of the stargazer function.

Usage

uni_compare_table(
  uni_compare_object,
  conf_adjustment = FALSE,
  df_names = NULL,
  varlabels = NULL,
  ci_line = TRUE,
  ndigits = 3
)

Arguments

uni_compare_object

A object returned by uni_compare.

conf_adjustment

A logical parameter determining if adjusted confidence intervals should be returned.

df_names

A character vector to relabel the data frames of comparison.

varlabels

A character vector to relabel the variables in the table.

ci_line

If TRUE, confidence intervals will be displayed in a separate line, otherwise, they are shown in the same line instead.

ndigits

The number of digits to round the numbers in table.

Value

A table containing information on the univariate comparison based on the uni_compare function.

Examples


## Get Data for comparison
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 
univar_data<-sampcompR::uni_compare(dfs = c("north","white"),
                                    benchmarks = c("south","black"),
                                    variables= c("age","educ","fatheduc","motheduc","wage","IQ"),
                                    funct = "abs_rel_mean",
                                    nboots=0,
                                    summetric="rmse2",
                                    data=TRUE)

table<-sampcompR::uni_compare_table(univar_data)
noquote(table)


[Package sampcompR version 0.2.1 Index]