Learn R Programming

sampcompR (version 0.2.6)

uni_compare_table: 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
)

Value

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

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.

Examples

Run this code

## Get Data for comparison

data("card")

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

## use the function to plot the data 
univar_data<-sampcompR::uni_compare(dfs = c("north","white"),
                                    benchmarks = c("card","card"),
                                    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)

Run the code above in your browser using DataLab