imeansC: Controlled Mean Comparison Table

Description Usage Arguments Value Examples

View source: R/imeansC.r

Description

Produces a controlled mean comparison table. Rows defined by values of independent variable and columns defines by values of the control variable.

Usage

1
imeansC(function1 = NULL, function2 = NULL, data, digits = 2)

Arguments

function1

A function identifying the dependent variable in the form ~ depvar

function2

A function specifying the independent and control variables in the form ~ indepvar + controlvar

data

A design dataset (like gssD, nesD, statesD, or worldD)

digits

Number of digits to report after decimal place, optional (default = 2).

Value

A controlled mean comparison table (an "ftable" class object)

Examples

1
2
3
4
5
   library(poliscidata)
   
   imeansC(function1 = ~ft_dem, function2 = ~gender + married, data=nesD)
   
   imeansC(~ft_dem, ~gender + married, nesD)

Example output

                       married    No   Yes
gender                                    
Male   survey::svymean         53.07 46.14
Female survey::svymean         62.08 48.03
                       married    No   Yes
gender                                    
Male   survey::svymean         53.07 46.14
Female survey::svymean         62.08 48.03

poliscidata documentation built on July 8, 2020, 6:23 p.m.