Extensive test code for tableone package

References

Load packages

## Load devtools
library(devtools)
## Load testthat for unit testing
library(testthat)
## Load from the local repo
load_all("~/statistics/package_development/tableone/")
## Load data
library(survival)
data(pbc)
head(pbc)
##   id time status trt   age sex ascites hepato spiders edema bili chol albumin copper alk.phos    ast trig platelet
## 1  1  400      2   1 58.77   f       1      1       1   1.0 14.5  261    2.60    156     1718 137.95  172      190
## 2  2 4500      0   1 56.45   f       0      1       1   0.0  1.1  302    4.14     54     7395 113.52   88      221
## 3  3 1012      2   1 70.07   m       0      0       0   0.5  1.4  176    3.48    210      516  96.10   55      151
## 4  4 1925      2   1 54.74   f       0      1       1   0.5  1.8  244    2.54     64     6122  60.63   92      183
## 5  5 1504      1   2 38.11   f       0      1       1   0.0  3.4  279    3.53    143      671 113.15   72      136
## 6  6 2503      2   2 66.26   f       0      1       0   0.0  0.8  248    3.98     50      944  93.00   63       NA
##   protime stage
## 1    12.2     4
## 2    10.6     3
## 3    12.0     4
## 4    10.3     4
## 5    10.9     3
## 6    11.0     3

Continuous variables

###  Define variables
vars <- c("time","age","bili","chol","albumin","copper","alk.phos","ast","trig","platelet","protime")
## Strata
strata <- "status"
strataTwoVars <- c("status","sex")
strataThreeVars <- c("sex","ascites","hepato")
## Data and variables
dataFrame <- pbc
nonNormalVars <- c("bili","chol","copper","alk.phos","trig","protime")
## Create edema strata that are of sizes 1, 2, and 3
smallDataFrame <- pbc[c(2, 3,4, 1,10,14),]
smallStrata <- "edema"


### Behaviors on correct data format (non-stratified, single variable)
## Creation
contTable <- CreateContTable(vars = "age", data = dataFrame)
## print method
contTable
##                  
##                   Overall      
##   n               418          
##   age (mean (sd)) 50.74 (10.45)
## summary method
summary(contTable)
## strata: Overall
##       n miss mean sd median p25 p75 min max  skew  kurt
## age 418    0   51 10     51  43  58  26  78 0.087 -0.62
## Five digits
summary(contTable, digits = 5)
## strata: Overall
##       n miss   mean     sd median    p25    p75    min    max    skew     kurt
## age 418    0 50.742 10.447 51.001 42.832 58.241 26.278 78.439 0.08685 -0.61673
## print method by default
print(contTable)
##                  
##                   Overall      
##   n               418          
##   age (mean (sd)) 50.74 (10.45)
## Five digits
print(contTable, digits = 5)
##                  
##                   Overall            
##   n               418                
##   age (mean (sd)) 50.74155 (10.44721)
## All nonnormal
print(contTable, nonnormal = TRUE)
##                     
##                      Overall             
##   n                  418                 
##   age (median [IQR]) 51.00 [42.83, 58.24]
## quote
print(contTable, quote = TRUE)
##                    ""
##  ""                 "Overall"      
##   "n"               "418"          
##   "age (mean (sd))" "50.74 (10.45)"
## Partially nonnormal
print(contTable, nonnormal = nonNormalVars)
##                  
##                   Overall      
##   n               418          
##   age (mean (sd)) 50.74 (10.45)
## Partially nonnormal median [range]
print(contTable, nonnormal = nonNormalVars, minMax = TRUE)
##                  
##                   Overall      
##   n               418          
##   age (mean (sd)) 50.74 (10.45)
## test
print(contTable, test = FALSE)
##                  
##                   Overall      
##   n               418          
##   age (mean (sd)) 50.74 (10.45)
## pDigits
print(contTable, pDigits = 5)
##                  
##                   Overall      
##   n               418          
##   age (mean (sd)) 50.74 (10.45)
## No explanation
print(contTable, explain = FALSE)
##      
##       Overall      
##   n   418          
##   age 50.74 (10.45)


### Behaviors on correct data format (non-stratified)
## Creation
contTable <- CreateContTable(vars = vars, data = dataFrame)
## print method
contTable
##                       
##                        Overall          
##   n                    418              
##   time (mean (sd))     1917.78 (1104.67)
##   age (mean (sd))        50.74 (10.45)  
##   bili (mean (sd))        3.22 (4.41)   
##   chol (mean (sd))      369.51 (231.94) 
##   albumin (mean (sd))     3.50 (0.42)   
##   copper (mean (sd))     97.65 (85.61)  
##   alk.phos (mean (sd)) 1982.66 (2140.39)
##   ast (mean (sd))       122.56 (56.70)  
##   trig (mean (sd))      124.70 (65.15)  
##   platelet (mean (sd))  257.02 (98.33)  
##   protime (mean (sd))    10.73 (1.02)
## summary method
summary(contTable)
## strata: Overall
##            n miss   mean      sd median    p25    p75   min     max   skew  kurt
## time     418    0 1917.8 1104.67 1730.0 1092.8 2613.5  41.0  4795.0  0.473 -0.48
## age      418    0   50.7   10.45   51.0   42.8   58.2  26.3    78.4  0.087 -0.62
## bili     418    0    3.2    4.41    1.4    0.8    3.4   0.3    28.0  2.718  8.07
## chol     418  134  369.5  231.94  309.5  249.5  400.0 120.0  1775.0  3.409 14.34
## albumin  418    0    3.5    0.42    3.5    3.2    3.8   2.0     4.6 -0.468  0.57
## copper   418  108   97.6   85.61   73.0   41.2  123.0   4.0   588.0  2.304  7.62
## alk.phos 418  106 1982.7 2140.39 1259.0  871.5 1980.0 289.0 13862.4  2.993  9.66
## ast      418  106  122.6   56.70  114.7   80.6  151.9  26.4   457.2  1.449  4.31
## trig     418  136  124.7   65.15  108.0   84.2  151.0  33.0   598.0  2.524 11.80
## platelet 418   11  257.0   98.33  251.0  188.5  318.0  62.0   721.0  0.627  0.86
## protime  418    2   10.7    1.02   10.6   10.0   11.1   9.0    18.0  2.223 10.04
## Five digits
summary(contTable, digits = 5)
## strata: Overall
##            n miss      mean         sd   median       p25      p75     min       max     skew     kurt
## time     418    0 1917.7823 1104.67299 1730.000 1092.7500 2613.500  41.000  4795.000  0.47260 -0.48214
## age      418    0   50.7416   10.44721   51.001   42.8323   58.241  26.278    78.439  0.08685 -0.61673
## bili     418    0    3.2208    4.40751    1.400    0.8000    3.400   0.300    28.000  2.71761  8.06534
## chol     418  134  369.5106  231.94455  309.500  249.5000  400.000 120.000  1775.000  3.40853 14.33787
## albumin  418    0    3.4974    0.42497    3.530    3.2425    3.770   1.960     4.640 -0.46753  0.56674
## copper   418  108   97.6484   85.61392   73.000   41.2500  123.000   4.000   588.000  2.30364  7.62402
## alk.phos 418  106 1982.6558 2140.38882 1259.000  871.5000 1980.000 289.000 13862.400  2.99283  9.66255
## ast      418  106  122.5563   56.69952  114.700   80.6000  151.900  26.350   457.250  1.44920  4.31198
## trig     418  136  124.7021   65.14864  108.000   84.2500  151.000  33.000   598.000  2.52390 11.80275
## platelet 418   11  257.0246   98.32558  251.000  188.5000  318.000  62.000   721.000  0.62710  0.86304
## protime  418    2   10.7317    1.02200   10.600   10.0000   11.100   9.000    18.000  2.22328 10.04077
## print method by default
print(contTable)
##                       
##                        Overall          
##   n                    418              
##   time (mean (sd))     1917.78 (1104.67)
##   age (mean (sd))        50.74 (10.45)  
##   bili (mean (sd))        3.22 (4.41)   
##   chol (mean (sd))      369.51 (231.94) 
##   albumin (mean (sd))     3.50 (0.42)   
##   copper (mean (sd))     97.65 (85.61)  
##   alk.phos (mean (sd)) 1982.66 (2140.39)
##   ast (mean (sd))       122.56 (56.70)  
##   trig (mean (sd))      124.70 (65.15)  
##   platelet (mean (sd))  257.02 (98.33)  
##   protime (mean (sd))    10.73 (1.02)
## Five digits
print(contTable, digits = 5)
##                       
##                        Overall                
##   n                    418                    
##   time (mean (sd))     1917.78230 (1104.67299)
##   age (mean (sd))        50.74155 (10.44721)  
##   bili (mean (sd))        3.22081 (4.40751)   
##   chol (mean (sd))      369.51056 (231.94455) 
##   albumin (mean (sd))     3.49744 (0.42497)   
##   copper (mean (sd))     97.64839 (85.61392)  
##   alk.phos (mean (sd)) 1982.65577 (2140.38882)
##   ast (mean (sd))       122.55635 (56.69952)  
##   trig (mean (sd))      124.70213 (65.14864)  
##   platelet (mean (sd))  257.02457 (98.32558)  
##   protime (mean (sd))    10.73173 (1.02200)
## All nonnormal
print(contTable, nonnormal = TRUE)
##                          
##                           Overall                   
##   n                       418                       
##   time (median [IQR])     1730.00 [1092.75, 2613.50]
##   age (median [IQR])        51.00 [42.83, 58.24]    
##   bili (median [IQR])        1.40 [0.80, 3.40]      
##   chol (median [IQR])      309.50 [249.50, 400.00]  
##   albumin (median [IQR])     3.53 [3.24, 3.77]      
##   copper (median [IQR])     73.00 [41.25, 123.00]   
##   alk.phos (median [IQR]) 1259.00 [871.50, 1980.00] 
##   ast (median [IQR])       114.70 [80.60, 151.90]   
##   trig (median [IQR])      108.00 [84.25, 151.00]   
##   platelet (median [IQR])  251.00 [188.50, 318.00]  
##   protime (median [IQR])    10.60 [10.00, 11.10]
## quote
print(contTable, quote = TRUE)
##                         ""
##  ""                      "Overall"          
##   "n"                    "418"              
##   "time (mean (sd))"     "1917.78 (1104.67)"
##   "age (mean (sd))"      "  50.74 (10.45)"  
##   "bili (mean (sd))"     "   3.22 (4.41)"   
##   "chol (mean (sd))"     " 369.51 (231.94)" 
##   "albumin (mean (sd))"  "   3.50 (0.42)"   
##   "copper (mean (sd))"   "  97.65 (85.61)"  
##   "alk.phos (mean (sd))" "1982.66 (2140.39)"
##   "ast (mean (sd))"      " 122.56 (56.70)"  
##   "trig (mean (sd))"     " 124.70 (65.15)"  
##   "platelet (mean (sd))" " 257.02 (98.33)"  
##   "protime (mean (sd))"  "  10.73 (1.02)"
## Partially nonnormal
print(contTable, nonnormal = nonNormalVars)
##                          
##                           Overall                  
##   n                       418                      
##   time (mean (sd))        1917.78 (1104.67)        
##   age (mean (sd))           50.74 (10.45)          
##   bili (median [IQR])        1.40 [0.80, 3.40]     
##   chol (median [IQR])      309.50 [249.50, 400.00] 
##   albumin (mean (sd))        3.50 (0.42)           
##   copper (median [IQR])     73.00 [41.25, 123.00]  
##   alk.phos (median [IQR]) 1259.00 [871.50, 1980.00]
##   ast (mean (sd))          122.56 (56.70)          
##   trig (median [IQR])      108.00 [84.25, 151.00]  
##   platelet (mean (sd))     257.02 (98.33)          
##   protime (median [IQR])    10.60 [10.00, 11.10]
## Partially nonnormal median [range]
print(contTable, nonnormal = nonNormalVars, minMax = TRUE)
##                            
##                             Overall                   
##   n                         418                       
##   time (mean (sd))          1917.78 (1104.67)         
##   age (mean (sd))             50.74 (10.45)           
##   bili (median [range])        1.40 [0.30, 28.00]     
##   chol (median [range])      309.50 [120.00, 1775.00] 
##   albumin (mean (sd))          3.50 (0.42)            
##   copper (median [range])     73.00 [4.00, 588.00]    
##   alk.phos (median [range]) 1259.00 [289.00, 13862.40]
##   ast (mean (sd))            122.56 (56.70)           
##   trig (median [range])      108.00 [33.00, 598.00]   
##   platelet (mean (sd))       257.02 (98.33)           
##   protime (median [range])    10.60 [9.00, 18.00]
## test
print(contTable, test = FALSE)
##                       
##                        Overall          
##   n                    418              
##   time (mean (sd))     1917.78 (1104.67)
##   age (mean (sd))        50.74 (10.45)  
##   bili (mean (sd))        3.22 (4.41)   
##   chol (mean (sd))      369.51 (231.94) 
##   albumin (mean (sd))     3.50 (0.42)   
##   copper (mean (sd))     97.65 (85.61)  
##   alk.phos (mean (sd)) 1982.66 (2140.39)
##   ast (mean (sd))       122.56 (56.70)  
##   trig (mean (sd))      124.70 (65.15)  
##   platelet (mean (sd))  257.02 (98.33)  
##   protime (mean (sd))    10.73 (1.02)
## pDigits
print(contTable, pDigits = 5)
##                       
##                        Overall          
##   n                    418              
##   time (mean (sd))     1917.78 (1104.67)
##   age (mean (sd))        50.74 (10.45)  
##   bili (mean (sd))        3.22 (4.41)   
##   chol (mean (sd))      369.51 (231.94) 
##   albumin (mean (sd))     3.50 (0.42)   
##   copper (mean (sd))     97.65 (85.61)  
##   alk.phos (mean (sd)) 1982.66 (2140.39)
##   ast (mean (sd))       122.56 (56.70)  
##   trig (mean (sd))      124.70 (65.15)  
##   platelet (mean (sd))  257.02 (98.33)  
##   protime (mean (sd))    10.73 (1.02)
## No explanation
print(contTable, explain = FALSE)
##           
##            Overall          
##   n        418              
##   time     1917.78 (1104.67)
##   age        50.74 (10.45)  
##   bili        3.22 (4.41)   
##   chol      369.51 (231.94) 
##   albumin     3.50 (0.42)   
##   copper     97.65 (85.61)  
##   alk.phos 1982.66 (2140.39)
##   ast       122.56 (56.70)  
##   trig      124.70 (65.15)  
##   platelet  257.02 (98.33)  
##   protime    10.73 (1.02)


### Behaviors on correct data format (stratified, 2-groups)
## Creation
contTable <- CreateContTable(vars = vars, strata = "sex", data = dataFrame)
## print method
contTable
##                       Stratified by sex
##                        m                 f                 p      test
##   n                    44                374                          
##   time (mean (sd))     1894.02 (1213.03) 1920.58 (1092.95)  0.880     
##   age (mean (sd))        55.71 (10.98)     50.16 (10.24)    0.001     
##   bili (mean (sd))        2.87 (2.32)       3.26 (4.59)     0.573     
##   chol (mean (sd))      362.46 (178.99)   370.50 (238.73)   0.848     
##   albumin (mean (sd))     3.54 (0.46)       3.49 (0.42)     0.536     
##   copper (mean (sd))    154.28 (100.67)    90.21 (80.74)   <0.001     
##   alk.phos (mean (sd)) 2172.95 (2418.45) 1957.83 (2105.05)  0.571     
##   ast (mean (sd))       121.99 (47.01)    122.63 (57.92)    0.949     
##   trig (mean (sd))      133.43 (52.17)    123.47 (66.78)    0.398     
##   platelet (mean (sd))  231.14 (85.23)    260.08 (99.42)    0.068     
##   protime (mean (sd))    10.94 (0.93)      10.71 (1.03)     0.151
## summary method
summary(contTable)
## sex: m
##           n miss   mean      sd median    p25    p75   min     max     skew  kurt
## time     44    0 1894.0 1213.03 1507.0 1060.8 2715.8 140.0  4459.0  0.82210 -0.38
## age      44    0   55.7   10.98   54.0   49.0   64.6  33.5    78.4  0.00017 -0.61
## bili     44    0    2.9    2.32    2.0    1.3    3.5   0.6     9.5  1.40185  1.07
## chol     44    9  362.5  178.99  317.0  245.0  426.5 151.0  1000.0  1.59223  3.42
## albumin  44    0    3.5    0.46    3.6    3.3    3.9   2.3     4.3 -0.92362  0.81
## copper   44    8  154.3  100.67  134.5   80.8  211.8  13.0   444.0  0.92109  0.76
## alk.phos 44    8 2172.9 2418.45 1116.0  852.0 2313.0 516.0 10396.8  2.44193  5.79
## ast      44    8  122.0   47.01  121.7   82.8  153.5  46.5   221.9  0.33766 -0.79
## trig     44    9  133.4   52.17  126.0   91.0  163.0  49.0   242.0  0.44729 -0.66
## platelet 44    1  231.1   85.23  217.0  165.5  298.5  70.0   394.0  0.01168 -0.97
## protime  44    0   10.9    0.93   10.9   10.3   11.2   9.7    14.1  1.37610  2.53
## --------------------------------------------------------------------------------------- 
## sex: f
##            n miss   mean      sd median    p25    p75   min     max   skew  kurt
## time     374    0 1920.6 1092.95 1773.0 1095.5 2606.2  41.0  4795.0  0.423 -0.49
## age      374    0   50.2   10.24   50.2   42.4   57.0  26.3    76.7  0.068 -0.66
## bili     374    0    3.3    4.59    1.3    0.7    3.4   0.3    28.0  2.649  7.40
## chol     374  125  370.5  238.73  309.0  252.0  395.0 120.0  1775.0  3.478 14.38
## albumin  374    0    3.5    0.42    3.5    3.2    3.8   2.0     4.6 -0.411  0.58
## copper   374  100   90.2   80.74   67.0   40.0  111.8   4.0   588.0  2.705 10.88
## alk.phos 374   98 1957.8 2105.05 1270.5  877.5 1963.8 289.0 13862.4  3.102 10.59
## ast      374   98  122.6   57.92  113.3   80.6  151.9  26.4   457.2  1.516  4.49
## trig     374  127  123.5   66.78  106.0   84.0  146.0  33.0   598.0  2.674 12.42
## platelet 374   10  260.1   99.42  252.5  190.0  319.0  62.0   721.0  0.654  0.89
## protime  374    2   10.7    1.03   10.6   10.0   11.1   9.0    18.0  2.328 10.85
## 
## p-values
##             pNormal pNonNormal
## time     0.88032351 0.57591934
## age      0.00080217 0.00265366
## bili     0.57291443 0.02892490
## chol     0.84802992 0.94479917
## albumin  0.53603916 0.27292778
## copper   0.00001921 0.00001876
## alk.phos 0.57143514 0.94518752
## ast      0.94936505 0.71776531
## trig     0.39810994 0.10007135
## platelet 0.06788007 0.11288380
## protime  0.15131569 0.04169974
## Five digits
summary(contTable, digits = 5)
## sex: m
##           n miss      mean         sd   median       p25      p75     min       max        skew     kurt
## time     44    0 1894.0227 1213.03436 1507.000 1060.7500 2715.750 140.000  4459.000  0.82209739 -0.37536
## age      44    0   55.7107   10.97780   54.001   48.9692   64.582  33.476    78.439  0.00016734 -0.60536
## bili     44    0    2.8659    2.31948    2.050    1.3000    3.500   0.600     9.500  1.40184985  1.07155
## chol     44    9  362.4571  178.99332  317.000  245.0000  426.500 151.000  1000.000  1.59223319  3.41710
## albumin  44    0    3.5350    0.45660    3.645    3.3275    3.870   2.270     4.300 -0.92362326  0.81075
## copper   44    8  154.2778  100.66539  134.500   80.7500  211.750  13.000   444.000  0.92109164  0.76207
## alk.phos 44    8 2172.9500 2418.44624 1116.000  852.0000 2313.000 516.000 10396.800  2.44192745  5.78848
## ast      44    8  121.9906   47.01310  121.675   82.7700  153.450  46.500   221.880  0.33765872 -0.78812
## trig     44    9  133.4286   52.16844  126.000   91.0000  163.000  49.000   242.000  0.44729489 -0.66362
## platelet 44    1  231.1395   85.22563  217.000  165.5000  298.500  70.000   394.000  0.01167704 -0.97192
## protime  44    0   10.9409    0.93145   10.900   10.2750   11.225   9.700    14.100  1.37610475  2.52950
## --------------------------------------------------------------------------------------- 
## sex: f
##            n miss      mean         sd   median      p25       p75     min       max      skew     kurt
## time     374    0 1920.5775 1092.95317 1773.000 1095.500 2606.2500  41.000  4795.000  0.423094 -0.49022
## age      374    0   50.1569   10.24065   50.193   42.379   56.9993  26.278    76.709  0.068061 -0.66008
## bili     374    0    3.2626    4.59139    1.300    0.700    3.4000   0.300    28.000  2.648590  7.39780
## chol     374  125  370.5020  238.72656  309.000  252.000  395.0000 120.000  1775.000  3.477832 14.38135
## albumin  374    0    3.4930    0.42153    3.520    3.240    3.7675   1.960     4.640 -0.410847  0.58386
## copper   374  100   90.2080   80.73838   67.000   40.000  111.7500   4.000   588.000  2.704782 10.87987
## alk.phos 374   98 1957.8348 2105.04905 1270.500  877.500 1963.7500 289.000 13862.400  3.102248 10.59178
## ast      374   98  122.6301   57.91665  113.335   80.600  151.9000  26.350   457.250  1.515794  4.48689
## trig     374  127  123.4656   66.78096  106.000   84.000  146.0000  33.000   598.000  2.673765 12.41800
## platelet 374   10  260.0824   99.41838  252.500  190.000  319.0000  62.000   721.000  0.654158  0.89382
## protime  374    2   10.7070    1.03053   10.600   10.000   11.1000   9.000    18.000  2.327509 10.84613
## 
## p-values
##             pNormal pNonNormal
## time     0.88032351 0.57591934
## age      0.00080217 0.00265366
## bili     0.57291443 0.02892490
## chol     0.84802992 0.94479917
## albumin  0.53603916 0.27292778
## copper   0.00001921 0.00001876
## alk.phos 0.57143514 0.94518752
## ast      0.94936505 0.71776531
## trig     0.39810994 0.10007135
## platelet 0.06788007 0.11288380
## protime  0.15131569 0.04169974
## print method by default
print(contTable)
##                       Stratified by sex
##                        m                 f                 p      test
##   n                    44                374                          
##   time (mean (sd))     1894.02 (1213.03) 1920.58 (1092.95)  0.880     
##   age (mean (sd))        55.71 (10.98)     50.16 (10.24)    0.001     
##   bili (mean (sd))        2.87 (2.32)       3.26 (4.59)     0.573     
##   chol (mean (sd))      362.46 (178.99)   370.50 (238.73)   0.848     
##   albumin (mean (sd))     3.54 (0.46)       3.49 (0.42)     0.536     
##   copper (mean (sd))    154.28 (100.67)    90.21 (80.74)   <0.001     
##   alk.phos (mean (sd)) 2172.95 (2418.45) 1957.83 (2105.05)  0.571     
##   ast (mean (sd))       121.99 (47.01)    122.63 (57.92)    0.949     
##   trig (mean (sd))      133.43 (52.17)    123.47 (66.78)    0.398     
##   platelet (mean (sd))  231.14 (85.23)    260.08 (99.42)    0.068     
##   protime (mean (sd))    10.94 (0.93)      10.71 (1.03)     0.151
## Five digits
print(contTable, digits = 5)
##                       Stratified by sex
##                        m                       f                       p      test
##   n                    44                      374                                
##   time (mean (sd))     1894.02273 (1213.03436) 1920.57754 (1092.95317)  0.880     
##   age (mean (sd))        55.71072 (10.97780)     50.15694 (10.24065)    0.001     
##   bili (mean (sd))        2.86591 (2.31948)       3.26257 (4.59139)     0.573     
##   chol (mean (sd))      362.45714 (178.99332)   370.50201 (238.72656)   0.848     
##   albumin (mean (sd))     3.53500 (0.45660)       3.49302 (0.42153)     0.536     
##   copper (mean (sd))    154.27778 (100.66539)    90.20803 (80.73838)   <0.001     
##   alk.phos (mean (sd)) 2172.95000 (2418.44624) 1957.83478 (2105.04905)  0.571     
##   ast (mean (sd))       121.99056 (47.01310)    122.63014 (57.91665)    0.949     
##   trig (mean (sd))      133.42857 (52.16844)    123.46559 (66.78096)    0.398     
##   platelet (mean (sd))  231.13953 (85.22563)    260.08242 (99.41838)    0.068     
##   protime (mean (sd))    10.94091 (0.93145)      10.70699 (1.03053)     0.151
## All nonnormal
print(contTable, nonnormal = TRUE)
##                          Stratified by sex
##                           m                          f                          p      test   
##   n                       44                         374                                      
##   time (median [IQR])     1507.00 [1060.75, 2715.75] 1773.00 [1095.50, 2606.25]  0.576 nonnorm
##   age (median [IQR])        54.00 [48.97, 64.58]       50.19 [42.38, 57.00]      0.003 nonnorm
##   bili (median [IQR])        2.05 [1.30, 3.50]          1.30 [0.70, 3.40]        0.029 nonnorm
##   chol (median [IQR])      317.00 [245.00, 426.50]    309.00 [252.00, 395.00]    0.945 nonnorm
##   albumin (median [IQR])     3.65 [3.33, 3.87]          3.52 [3.24, 3.77]        0.273 nonnorm
##   copper (median [IQR])    134.50 [80.75, 211.75]      67.00 [40.00, 111.75]    <0.001 nonnorm
##   alk.phos (median [IQR]) 1116.00 [852.00, 2313.00]  1270.50 [877.50, 1963.75]   0.945 nonnorm
##   ast (median [IQR])       121.68 [82.77, 153.45]     113.34 [80.60, 151.90]     0.718 nonnorm
##   trig (median [IQR])      126.00 [91.00, 163.00]     106.00 [84.00, 146.00]     0.100 nonnorm
##   platelet (median [IQR])  217.00 [165.50, 298.50]    252.50 [190.00, 319.00]    0.113 nonnorm
##   protime (median [IQR])    10.90 [10.28, 11.22]       10.60 [10.00, 11.10]      0.042 nonnorm
## quote
print(contTable, quote = TRUE)
##                         "Stratified by sex"
##  ""                      "m"                 "f"                 "p"      "test"
##   "n"                    "44"                "374"               ""       ""    
##   "time (mean (sd))"     "1894.02 (1213.03)" "1920.58 (1092.95)" " 0.880" ""    
##   "age (mean (sd))"      "  55.71 (10.98)"   "  50.16 (10.24)"   " 0.001" ""    
##   "bili (mean (sd))"     "   2.87 (2.32)"    "   3.26 (4.59)"    " 0.573" ""    
##   "chol (mean (sd))"     " 362.46 (178.99)"  " 370.50 (238.73)"  " 0.848" ""    
##   "albumin (mean (sd))"  "   3.54 (0.46)"    "   3.49 (0.42)"    " 0.536" ""    
##   "copper (mean (sd))"   " 154.28 (100.67)"  "  90.21 (80.74)"   "<0.001" ""    
##   "alk.phos (mean (sd))" "2172.95 (2418.45)" "1957.83 (2105.05)" " 0.571" ""    
##   "ast (mean (sd))"      " 121.99 (47.01)"   " 122.63 (57.92)"   " 0.949" ""    
##   "trig (mean (sd))"     " 133.43 (52.17)"   " 123.47 (66.78)"   " 0.398" ""    
##   "platelet (mean (sd))" " 231.14 (85.23)"   " 260.08 (99.42)"   " 0.068" ""    
##   "protime (mean (sd))"  "  10.94 (0.93)"    "  10.71 (1.03)"    " 0.151" ""
## Partially nonnormal
print(contTable, nonnormal = nonNormalVars)
##                          Stratified by sex
##                           m                         f                         p      test   
##   n                       44                        374                                     
##   time (mean (sd))        1894.02 (1213.03)         1920.58 (1092.95)          0.880        
##   age (mean (sd))           55.71 (10.98)             50.16 (10.24)            0.001        
##   bili (median [IQR])        2.05 [1.30, 3.50]         1.30 [0.70, 3.40]       0.029 nonnorm
##   chol (median [IQR])      317.00 [245.00, 426.50]   309.00 [252.00, 395.00]   0.945 nonnorm
##   albumin (mean (sd))        3.54 (0.46)               3.49 (0.42)             0.536        
##   copper (median [IQR])    134.50 [80.75, 211.75]     67.00 [40.00, 111.75]   <0.001 nonnorm
##   alk.phos (median [IQR]) 1116.00 [852.00, 2313.00] 1270.50 [877.50, 1963.75]  0.945 nonnorm
##   ast (mean (sd))          121.99 (47.01)            122.63 (57.92)            0.949        
##   trig (median [IQR])      126.00 [91.00, 163.00]    106.00 [84.00, 146.00]    0.100 nonnorm
##   platelet (mean (sd))     231.14 (85.23)            260.08 (99.42)            0.068        
##   protime (median [IQR])    10.90 [10.28, 11.22]      10.60 [10.00, 11.10]     0.042 nonnorm
## Partially nonnormal median [range]
print(contTable, nonnormal = nonNormalVars, minMax = TRUE)
##                            Stratified by sex
##                             m                          f                          p      test   
##   n                         44                         374                                      
##   time (mean (sd))          1894.02 (1213.03)          1920.58 (1092.95)           0.880        
##   age (mean (sd))             55.71 (10.98)              50.16 (10.24)             0.001        
##   bili (median [range])        2.05 [0.60, 9.50]          1.30 [0.30, 28.00]       0.029 nonnorm
##   chol (median [range])      317.00 [151.00, 1000.00]   309.00 [120.00, 1775.00]   0.945 nonnorm
##   albumin (mean (sd))          3.54 (0.46)                3.49 (0.42)              0.536        
##   copper (median [range])    134.50 [13.00, 444.00]      67.00 [4.00, 588.00]     <0.001 nonnorm
##   alk.phos (median [range]) 1116.00 [516.00, 10396.80] 1270.50 [289.00, 13862.40]  0.945 nonnorm
##   ast (mean (sd))            121.99 (47.01)             122.63 (57.92)             0.949        
##   trig (median [range])      126.00 [49.00, 242.00]     106.00 [33.00, 598.00]     0.100 nonnorm
##   platelet (mean (sd))       231.14 (85.23)             260.08 (99.42)             0.068        
##   protime (median [range])    10.90 [9.70, 14.10]        10.60 [9.00, 18.00]       0.042 nonnorm
## test
print(contTable, test = FALSE)
##                       Stratified by sex
##                        m                 f                
##   n                    44                374              
##   time (mean (sd))     1894.02 (1213.03) 1920.58 (1092.95)
##   age (mean (sd))        55.71 (10.98)     50.16 (10.24)  
##   bili (mean (sd))        2.87 (2.32)       3.26 (4.59)   
##   chol (mean (sd))      362.46 (178.99)   370.50 (238.73) 
##   albumin (mean (sd))     3.54 (0.46)       3.49 (0.42)   
##   copper (mean (sd))    154.28 (100.67)    90.21 (80.74)  
##   alk.phos (mean (sd)) 2172.95 (2418.45) 1957.83 (2105.05)
##   ast (mean (sd))       121.99 (47.01)    122.63 (57.92)  
##   trig (mean (sd))      133.43 (52.17)    123.47 (66.78)  
##   platelet (mean (sd))  231.14 (85.23)    260.08 (99.42)  
##   protime (mean (sd))    10.94 (0.93)      10.71 (1.03)
## pDigits
print(contTable, pDigits = 5)
##                       Stratified by sex
##                        m                 f                 p        test
##   n                    44                374                            
##   time (mean (sd))     1894.02 (1213.03) 1920.58 (1092.95)  0.88032     
##   age (mean (sd))        55.71 (10.98)     50.16 (10.24)    0.00080     
##   bili (mean (sd))        2.87 (2.32)       3.26 (4.59)     0.57291     
##   chol (mean (sd))      362.46 (178.99)   370.50 (238.73)   0.84803     
##   albumin (mean (sd))     3.54 (0.46)       3.49 (0.42)     0.53604     
##   copper (mean (sd))    154.28 (100.67)    90.21 (80.74)    0.00002     
##   alk.phos (mean (sd)) 2172.95 (2418.45) 1957.83 (2105.05)  0.57144     
##   ast (mean (sd))       121.99 (47.01)    122.63 (57.92)    0.94937     
##   trig (mean (sd))      133.43 (52.17)    123.47 (66.78)    0.39811     
##   platelet (mean (sd))  231.14 (85.23)    260.08 (99.42)    0.06788     
##   protime (mean (sd))    10.94 (0.93)      10.71 (1.03)     0.15132
## No explanation
print(contTable, explain = FALSE)
##           Stratified by sex
##            m                 f                 p      test
##   n        44                374                          
##   time     1894.02 (1213.03) 1920.58 (1092.95)  0.880     
##   age        55.71 (10.98)     50.16 (10.24)    0.001     
##   bili        2.87 (2.32)       3.26 (4.59)     0.573     
##   chol      362.46 (178.99)   370.50 (238.73)   0.848     
##   albumin     3.54 (0.46)       3.49 (0.42)     0.536     
##   copper    154.28 (100.67)    90.21 (80.74)   <0.001     
##   alk.phos 2172.95 (2418.45) 1957.83 (2105.05)  0.571     
##   ast       121.99 (47.01)    122.63 (57.92)    0.949     
##   trig      133.43 (52.17)    123.47 (66.78)    0.398     
##   platelet  231.14 (85.23)    260.08 (99.42)    0.068     
##   protime    10.94 (0.93)      10.71 (1.03)     0.151


### Behaviors on correct data format (stratified, 3-groups)
## Creation
contTable <- CreateContTable(vars = vars, strata = strata, data = dataFrame)
## print method
contTable
##                       Stratified by status
##                        0                 1                2                 p      test
##   n                    232               25               161                          
##   time (mean (sd))     2333.16 (994.66)  1546.20 (753.07) 1376.93 (1049.23) <0.001     
##   age (mean (sd))        49.51 (10.43)     41.69 (6.33)     53.92 (9.81)    <0.001     
##   bili (mean (sd))        1.58 (1.91)       3.56 (3.60)      5.54 (5.84)    <0.001     
##   chol (mean (sd))      326.54 (165.80)   439.50 (335.54)  415.75 (275.03)   0.003     
##   albumin (mean (sd))     3.59 (0.36)       3.49 (0.46)      3.36 (0.47)    <0.001     
##   copper (mean (sd))     66.61 (57.05)    124.00 (100.08)  135.41 (98.50)   <0.001     
##   alk.phos (mean (sd)) 1578.13 (1633.07) 1535.21 (837.75) 2594.35 (2677.11) <0.001     
##   ast (mean (sd))       107.29 (52.79)    130.12 (36.95)   141.93 (58.38)   <0.001     
##   trig (mean (sd))      111.79 (48.28)    133.94 (70.55)   140.49 (79.26)    0.001     
##   platelet (mean (sd))  261.16 (88.61)    309.60 (102.65)  242.49 (107.88)   0.004     
##   protime (mean (sd))    10.45 (0.92)      10.36 (0.54)     11.19 (1.05)    <0.001
## summary method
summary(contTable)
## status: 0
##            n miss   mean      sd median    p25    p75   min     max  skew  kurt
## time     232    0 2333.2  994.66 2186.5 1456.5 2979.5 691.0  4795.0  0.59 -0.59
## age      232    0   49.5   10.43   49.8   41.4   56.8  26.3    78.4  0.10 -0.58
## bili     232    0    1.6    1.91    0.9    0.6    1.6   0.3    13.6  3.49 14.50
## chol     232   80  326.5  165.80  292.0  245.2  360.0 120.0  1480.0  4.30 24.79
## albumin  232    0    3.6    0.36    3.6    3.4    3.8   2.4     4.6 -0.21  0.44
## copper   232   65   66.6   57.05   52.0   33.5   77.5   4.0   412.0  3.07 13.52
## alk.phos 232   64 1578.1 1633.07 1107.5  794.0 1641.0 289.0 11046.6  3.59 14.68
## ast      232   64  107.3   52.79   94.5   71.3  129.0  26.4   457.2  2.38 11.22
## trig     232   81  111.8   48.28  104.0   80.0  133.5  44.0   382.0  1.72  5.92
## platelet 232    5  261.2   88.61  256.0  203.5  313.0  79.0   539.0  0.41  0.21
## protime  232    1   10.5    0.92   10.4    9.9   10.8   9.0    18.0  4.21 29.69
## --------------------------------------------------------------------------------------- 
## status: 1
##           n miss   mean     sd median    p25    p75   min    max   skew  kurt
## time     25    0 1546.2 753.07 1435.0  901.0 2241.0 533.0 3092.0  0.596 -0.69
## age      25    0   41.7   6.33   41.0   36.5   47.2  33.0   56.0  0.470 -0.58
## bili     25    0    3.6   3.60    3.1    1.3    3.5   0.5   18.0  2.951 10.89
## chol     25    7  439.5 335.54  343.5  311.5  445.5 201.0 1712.0  3.553 13.79
## albumin  25    0    3.5   0.46    3.5    3.2    3.8   2.3    4.2 -0.531  0.31
## copper   25    6  124.0 100.08  102.0   69.0  129.5  32.0  444.0  2.250  5.62
## alk.phos 25    6 1535.2 837.75 1345.0 1028.5 1777.5 637.0 3681.0  1.470  1.84
## ast      25    6  130.1  36.95  127.0  113.9  151.1  54.2  205.0  0.088  0.31
## trig     25    7  133.9  70.55  124.0   85.8  145.8  33.0  322.0  1.249  1.76
## platelet 25    0  309.6 102.65  304.0  248.0  372.0  76.0  517.0 -0.112  0.20
## protime  25    0   10.4   0.54   10.3   10.0   10.7   9.6   11.4  0.516 -0.73
## --------------------------------------------------------------------------------------- 
## status: 2
##            n miss   mean      sd median    p25    p75   min     max   skew  kurt
## time     161    0 1376.9 1049.23 1083.0  597.0 2071.0  41.0  4191.0  0.833 -0.19
## age      161    0   53.9    9.81   53.5   46.6   61.3  30.9    76.7 -0.013 -0.56
## bili     161    0    5.5    5.84    3.2    1.4    7.1   0.3    28.0  1.684  2.36
## chol     161   47  415.8  275.03  339.0  257.5  454.0 127.0  1775.0  2.575  8.11
## albumin  161    0    3.4    0.47    3.4    3.1    3.6   2.0     4.5 -0.329  0.18
## copper   161   37  135.4   98.50  111.0   63.5  199.2  13.0   588.0  1.840  5.50
## alk.phos 161   36 2594.4 2677.11 1664.0 1029.0 2468.0 516.0 13862.4  2.300  5.08
## ast      161   36  141.9   58.38  134.8   99.3  176.7  28.4   338.0  0.808  0.98
## trig     161   48  140.5   79.26  122.0   91.0  171.0  49.0   598.0  2.505 10.29
## platelet 161    6  242.5  107.88  224.0  158.0  312.5  62.0   721.0  1.012  1.80
## protime  161    1   11.2    1.05   11.0   10.5   11.8   9.0    15.2  0.776  0.86
## 
## p-values
##            pNormal pNonNormal
## time     2.170e-18  1.070e-18
## age      4.513e-09  7.523e-09
## bili     4.006e-19  4.088e-26
## chol     3.118e-03  3.588e-03
## albumin  4.024e-07  2.875e-06
## copper   5.999e-12  2.935e-14
## alk.phos 1.655e-04  1.139e-05
## ast      7.554e-07  2.198e-08
## trig     1.401e-03  5.535e-03
## platelet 4.024e-03  8.025e-04
## protime  6.961e-13  1.987e-15
## Five digits
summary(contTable, digits = 5)
## status: 0
##            n miss      mean         sd   median      p25       p75     min       max     skew     kurt
## time     232    0 2333.1552  994.65895 2186.500 1456.500 2979.5000 691.000  4795.000  0.59056 -0.58655
## age      232    0   49.5103   10.42672   49.817   41.384   56.7577  26.278    78.439  0.10065 -0.57612
## bili     232    0    1.5759    1.91026    0.900    0.600    1.6000   0.300    13.600  3.49318 14.50073
## chol     232   80  326.5395  165.79729  292.000  245.250  360.0000 120.000  1480.000  4.29636 24.78537
## albumin  232    0    3.5935    0.36041    3.600    3.360    3.8225   2.380     4.640 -0.21336  0.43831
## copper   232   65   66.6108   57.05418   52.000   33.500   77.5000   4.000   412.000  3.06883 13.51984
## alk.phos 232   64 1578.1274 1633.07092 1107.500  794.000 1641.0000 289.000 11046.600  3.59059 14.68030
## ast      232   64  107.2860   52.79321   94.550   71.300  128.9875  26.350   457.250  2.38181 11.21994
## trig     232   81  111.7881   48.27775  104.000   80.000  133.5000  44.000   382.000  1.71753  5.91846
## platelet 232    5  261.1586   88.60787  256.000  203.500  313.0000  79.000   539.000  0.40679  0.21168
## protime  232    1   10.4541    0.92458   10.400    9.900   10.8000   9.000    18.000  4.21195 29.69337
## --------------------------------------------------------------------------------------- 
## status: 1
##           n miss      mean        sd   median      p25      p75    min      max      skew     kurt
## time     25    0 1546.2000 753.07425 1435.000  901.000 2241.000 533.00 3092.000  0.596113 -0.69276
## age      25    0   41.6934   6.33435   40.999   36.493   47.181  32.95   55.986  0.470499 -0.58282
## bili     25    0    3.5560   3.59619    3.100    1.300    3.500   0.50   18.000  2.950805 10.88744
## chol     25    7  439.5000 335.53666  343.500  311.500  445.500 201.00 1712.000  3.553207 13.79115
## albumin  25    0    3.4876   0.45599    3.530    3.180    3.770   2.31    4.200 -0.530839  0.30509
## copper   25    6  124.0000 100.07830  102.000   69.000  129.500  32.00  444.000  2.250350  5.61963
## alk.phos 25    6 1535.2105 837.74808 1345.000 1028.500 1777.500 637.00 3681.000  1.469519  1.83947
## ast      25    6  130.1158  36.94593  127.000  113.925  151.125  54.25  205.000  0.088453  0.31448
## trig     25    7  133.9444  70.54700  124.000   85.750  145.750  33.00  322.000  1.248931  1.75650
## platelet 25    0  309.6000 102.65314  304.000  248.000  372.000  76.00  517.000 -0.112316  0.20185
## protime  25    0   10.3600   0.53697   10.300   10.000   10.700   9.60   11.400  0.516009 -0.73202
## --------------------------------------------------------------------------------------- 
## status: 2
##            n miss      mean         sd   median      p25      p75     min       max      skew     kurt
## time     161    0 1376.9317 1049.22797 1083.000  597.000 2071.000  41.000  4191.000  0.832780 -0.18926
## age      161    0   53.9207    9.81423   53.498   46.628   61.295  30.864    76.709 -0.013216 -0.56233
## bili     161    0    5.5391    5.83710    3.200    1.400    7.100   0.300    28.000  1.683878  2.35585
## chol     161   47  415.7544  275.03076  339.000  257.500  454.000 127.000  1775.000  2.575250  8.11359
## albumin  161    0    3.3606    0.46875    3.400    3.080    3.650   1.960     4.520 -0.328598  0.18383
## copper   161   37  135.4113   98.49890  111.000   63.500  199.250  13.000   588.000  1.840411  5.50281
## alk.phos 161   36 2594.3536 2677.10859 1664.000 1029.000 2468.000 516.000 13862.400  2.300147  5.07611
## ast      161   36  141.9307   58.37952  134.850   99.330  176.700  28.380   338.000  0.807649  0.97760
## trig     161   48  140.4867   79.25818  122.000   91.000  171.000  49.000   598.000  2.505344 10.28687
## platelet 161    6  242.4903  107.87615  224.000  158.000  312.500  62.000   721.000  1.012383  1.80442
## protime  161    1   11.1906    1.04904   11.000   10.475   11.800   9.000    15.200  0.776316  0.85574
## 
## p-values
##            pNormal pNonNormal
## time     2.170e-18  1.070e-18
## age      4.513e-09  7.523e-09
## bili     4.006e-19  4.088e-26
## chol     3.118e-03  3.588e-03
## albumin  4.024e-07  2.875e-06
## copper   5.999e-12  2.935e-14
## alk.phos 1.655e-04  1.139e-05
## ast      7.554e-07  2.198e-08
## trig     1.401e-03  5.535e-03
## platelet 4.024e-03  8.025e-04
## protime  6.961e-13  1.987e-15
## print method by default
print(contTable)
##                       Stratified by status
##                        0                 1                2                 p      test
##   n                    232               25               161                          
##   time (mean (sd))     2333.16 (994.66)  1546.20 (753.07) 1376.93 (1049.23) <0.001     
##   age (mean (sd))        49.51 (10.43)     41.69 (6.33)     53.92 (9.81)    <0.001     
##   bili (mean (sd))        1.58 (1.91)       3.56 (3.60)      5.54 (5.84)    <0.001     
##   chol (mean (sd))      326.54 (165.80)   439.50 (335.54)  415.75 (275.03)   0.003     
##   albumin (mean (sd))     3.59 (0.36)       3.49 (0.46)      3.36 (0.47)    <0.001     
##   copper (mean (sd))     66.61 (57.05)    124.00 (100.08)  135.41 (98.50)   <0.001     
##   alk.phos (mean (sd)) 1578.13 (1633.07) 1535.21 (837.75) 2594.35 (2677.11) <0.001     
##   ast (mean (sd))       107.29 (52.79)    130.12 (36.95)   141.93 (58.38)   <0.001     
##   trig (mean (sd))      111.79 (48.28)    133.94 (70.55)   140.49 (79.26)    0.001     
##   platelet (mean (sd))  261.16 (88.61)    309.60 (102.65)  242.49 (107.88)   0.004     
##   protime (mean (sd))    10.45 (0.92)      10.36 (0.54)     11.19 (1.05)    <0.001
## Five digits
print(contTable, digits = 5)
##                       Stratified by status
##                        0                       1                      2                       p      test
##   n                    232                     25                     161                                
##   time (mean (sd))     2333.15517 (994.65895)  1546.20000 (753.07425) 1376.93168 (1049.22797) <0.001     
##   age (mean (sd))        49.51034 (10.42672)     41.69342 (6.33435)     53.92071 (9.81423)    <0.001     
##   bili (mean (sd))        1.57586 (1.91026)       3.55600 (3.59619)      5.53913 (5.83710)    <0.001     
##   chol (mean (sd))      326.53947 (165.79729)   439.50000 (335.53666)  415.75439 (275.03076)   0.003     
##   albumin (mean (sd))     3.59349 (0.36041)       3.48760 (0.45599)      3.36056 (0.46875)    <0.001     
##   copper (mean (sd))     66.61078 (57.05418)    124.00000 (100.07830)  135.41129 (98.49890)   <0.001     
##   alk.phos (mean (sd)) 1578.12738 (1633.07092) 1535.21053 (837.74808) 2594.35360 (2677.10859) <0.001     
##   ast (mean (sd))       107.28595 (52.79321)    130.11579 (36.94593)   141.93072 (58.37952)   <0.001     
##   trig (mean (sd))      111.78808 (48.27775)    133.94444 (70.54700)   140.48673 (79.25818)    0.001     
##   platelet (mean (sd))  261.15859 (88.60787)    309.60000 (102.65314)  242.49032 (107.87615)   0.004     
##   protime (mean (sd))    10.45411 (0.92458)      10.36000 (0.53697)     11.19063 (1.04904)    <0.001
## All nonnormal
print(contTable, nonnormal = TRUE)
##                          Stratified by status
##                           0                          1                          2                          p     
##   n                       232                        25                         161                              
##   time (median [IQR])     2186.50 [1456.50, 2979.50] 1435.00 [901.00, 2241.00]  1083.00 [597.00, 2071.00]  <0.001
##   age (median [IQR])        49.82 [41.38, 56.76]       41.00 [36.49, 47.18]       53.50 [46.63, 61.30]     <0.001
##   bili (median [IQR])        0.90 [0.60, 1.60]          3.10 [1.30, 3.50]          3.20 [1.40, 7.10]       <0.001
##   chol (median [IQR])      292.00 [245.25, 360.00]    343.50 [311.50, 445.50]    339.00 [257.50, 454.00]    0.004
##   albumin (median [IQR])     3.60 [3.36, 3.82]          3.53 [3.18, 3.77]          3.40 [3.08, 3.65]       <0.001
##   copper (median [IQR])     52.00 [33.50, 77.50]      102.00 [69.00, 129.50]     111.00 [63.50, 199.25]    <0.001
##   alk.phos (median [IQR]) 1107.50 [794.00, 1641.00]  1345.00 [1028.50, 1777.50] 1664.00 [1029.00, 2468.00] <0.001
##   ast (median [IQR])        94.55 [71.30, 128.99]     127.00 [113.93, 151.12]    134.85 [99.33, 176.70]    <0.001
##   trig (median [IQR])      104.00 [80.00, 133.50]     124.00 [85.75, 145.75]     122.00 [91.00, 171.00]     0.006
##   platelet (median [IQR])  256.00 [203.50, 313.00]    304.00 [248.00, 372.00]    224.00 [158.00, 312.50]    0.001
##   protime (median [IQR])    10.40 [9.90, 10.80]        10.30 [10.00, 10.70]       11.00 [10.47, 11.80]     <0.001
##                          Stratified by status
##                           test   
##   n                              
##   time (median [IQR])     nonnorm
##   age (median [IQR])      nonnorm
##   bili (median [IQR])     nonnorm
##   chol (median [IQR])     nonnorm
##   albumin (median [IQR])  nonnorm
##   copper (median [IQR])   nonnorm
##   alk.phos (median [IQR]) nonnorm
##   ast (median [IQR])      nonnorm
##   trig (median [IQR])     nonnorm
##   platelet (median [IQR]) nonnorm
##   protime (median [IQR])  nonnorm
## quote
print(contTable, quote = TRUE)
##                         "Stratified by status"
##  ""                      "0"                 "1"                "2"                 "p"      "test"
##   "n"                    "232"               "25"               "161"               ""       ""    
##   "time (mean (sd))"     "2333.16 (994.66)"  "1546.20 (753.07)" "1376.93 (1049.23)" "<0.001" ""    
##   "age (mean (sd))"      "  49.51 (10.43)"   "  41.69 (6.33)"   "  53.92 (9.81)"    "<0.001" ""    
##   "bili (mean (sd))"     "   1.58 (1.91)"    "   3.56 (3.60)"   "   5.54 (5.84)"    "<0.001" ""    
##   "chol (mean (sd))"     " 326.54 (165.80)"  " 439.50 (335.54)" " 415.75 (275.03)"  " 0.003" ""    
##   "albumin (mean (sd))"  "   3.59 (0.36)"    "   3.49 (0.46)"   "   3.36 (0.47)"    "<0.001" ""    
##   "copper (mean (sd))"   "  66.61 (57.05)"   " 124.00 (100.08)" " 135.41 (98.50)"   "<0.001" ""    
##   "alk.phos (mean (sd))" "1578.13 (1633.07)" "1535.21 (837.75)" "2594.35 (2677.11)" "<0.001" ""    
##   "ast (mean (sd))"      " 107.29 (52.79)"   " 130.12 (36.95)"  " 141.93 (58.38)"   "<0.001" ""    
##   "trig (mean (sd))"     " 111.79 (48.28)"   " 133.94 (70.55)"  " 140.49 (79.26)"   " 0.001" ""    
##   "platelet (mean (sd))" " 261.16 (88.61)"   " 309.60 (102.65)" " 242.49 (107.88)"  " 0.004" ""    
##   "protime (mean (sd))"  "  10.45 (0.92)"    "  10.36 (0.54)"   "  11.19 (1.05)"    "<0.001" ""
## Partially nonnormal
print(contTable, nonnormal = nonNormalVars)
##                          Stratified by status
##                           0                         1                          2                          p     
##   n                       232                       25                         161                              
##   time (mean (sd))        2333.16 (994.66)          1546.20 (753.07)           1376.93 (1049.23)          <0.001
##   age (mean (sd))           49.51 (10.43)             41.69 (6.33)               53.92 (9.81)             <0.001
##   bili (median [IQR])        0.90 [0.60, 1.60]         3.10 [1.30, 3.50]          3.20 [1.40, 7.10]       <0.001
##   chol (median [IQR])      292.00 [245.25, 360.00]   343.50 [311.50, 445.50]    339.00 [257.50, 454.00]    0.004
##   albumin (mean (sd))        3.59 (0.36)               3.49 (0.46)                3.36 (0.47)             <0.001
##   copper (median [IQR])     52.00 [33.50, 77.50]     102.00 [69.00, 129.50]     111.00 [63.50, 199.25]    <0.001
##   alk.phos (median [IQR]) 1107.50 [794.00, 1641.00] 1345.00 [1028.50, 1777.50] 1664.00 [1029.00, 2468.00] <0.001
##   ast (mean (sd))          107.29 (52.79)            130.12 (36.95)             141.93 (58.38)            <0.001
##   trig (median [IQR])      104.00 [80.00, 133.50]    124.00 [85.75, 145.75]     122.00 [91.00, 171.00]     0.006
##   platelet (mean (sd))     261.16 (88.61)            309.60 (102.65)            242.49 (107.88)            0.004
##   protime (median [IQR])    10.40 [9.90, 10.80]       10.30 [10.00, 10.70]       11.00 [10.47, 11.80]     <0.001
##                          Stratified by status
##                           test   
##   n                              
##   time (mean (sd))               
##   age (mean (sd))                
##   bili (median [IQR])     nonnorm
##   chol (median [IQR])     nonnorm
##   albumin (mean (sd))            
##   copper (median [IQR])   nonnorm
##   alk.phos (median [IQR]) nonnorm
##   ast (mean (sd))                
##   trig (median [IQR])     nonnorm
##   platelet (mean (sd))           
##   protime (median [IQR])  nonnorm
## Partially nonnormal median [range]
print(contTable, nonnormal = nonNormalVars, minMax = TRUE)
##                            Stratified by status
##                             0                          1                         2                          p     
##   n                         232                        25                        161                              
##   time (mean (sd))          2333.16 (994.66)           1546.20 (753.07)          1376.93 (1049.23)          <0.001
##   age (mean (sd))             49.51 (10.43)              41.69 (6.33)              53.92 (9.81)             <0.001
##   bili (median [range])        0.90 [0.30, 13.60]         3.10 [0.50, 18.00]        3.20 [0.30, 28.00]      <0.001
##   chol (median [range])      292.00 [120.00, 1480.00]   343.50 [201.00, 1712.00]  339.00 [127.00, 1775.00]   0.004
##   albumin (mean (sd))          3.59 (0.36)                3.49 (0.46)               3.36 (0.47)             <0.001
##   copper (median [range])     52.00 [4.00, 412.00]      102.00 [32.00, 444.00]    111.00 [13.00, 588.00]    <0.001
##   alk.phos (median [range]) 1107.50 [289.00, 11046.60] 1345.00 [637.00, 3681.00] 1664.00 [516.00, 13862.40] <0.001
##   ast (mean (sd))            107.29 (52.79)             130.12 (36.95)            141.93 (58.38)            <0.001
##   trig (median [range])      104.00 [44.00, 382.00]     124.00 [33.00, 322.00]    122.00 [49.00, 598.00]     0.006
##   platelet (mean (sd))       261.16 (88.61)             309.60 (102.65)           242.49 (107.88)            0.004
##   protime (median [range])    10.40 [9.00, 18.00]        10.30 [9.60, 11.40]       11.00 [9.00, 15.20]      <0.001
##                            Stratified by status
##                             test   
##   n                                
##   time (mean (sd))                 
##   age (mean (sd))                  
##   bili (median [range])     nonnorm
##   chol (median [range])     nonnorm
##   albumin (mean (sd))              
##   copper (median [range])   nonnorm
##   alk.phos (median [range]) nonnorm
##   ast (mean (sd))                  
##   trig (median [range])     nonnorm
##   platelet (mean (sd))             
##   protime (median [range])  nonnorm
## test
print(contTable, test = FALSE)
##                       Stratified by status
##                        0                 1                2                
##   n                    232               25               161              
##   time (mean (sd))     2333.16 (994.66)  1546.20 (753.07) 1376.93 (1049.23)
##   age (mean (sd))        49.51 (10.43)     41.69 (6.33)     53.92 (9.81)   
##   bili (mean (sd))        1.58 (1.91)       3.56 (3.60)      5.54 (5.84)   
##   chol (mean (sd))      326.54 (165.80)   439.50 (335.54)  415.75 (275.03) 
##   albumin (mean (sd))     3.59 (0.36)       3.49 (0.46)      3.36 (0.47)   
##   copper (mean (sd))     66.61 (57.05)    124.00 (100.08)  135.41 (98.50)  
##   alk.phos (mean (sd)) 1578.13 (1633.07) 1535.21 (837.75) 2594.35 (2677.11)
##   ast (mean (sd))       107.29 (52.79)    130.12 (36.95)   141.93 (58.38)  
##   trig (mean (sd))      111.79 (48.28)    133.94 (70.55)   140.49 (79.26)  
##   platelet (mean (sd))  261.16 (88.61)    309.60 (102.65)  242.49 (107.88) 
##   protime (mean (sd))    10.45 (0.92)      10.36 (0.54)     11.19 (1.05)
## pDigits
print(contTable, pDigits = 5)
##                       Stratified by status
##                        0                 1                2                 p        test
##   n                    232               25               161                            
##   time (mean (sd))     2333.16 (994.66)  1546.20 (753.07) 1376.93 (1049.23) <0.00001     
##   age (mean (sd))        49.51 (10.43)     41.69 (6.33)     53.92 (9.81)    <0.00001     
##   bili (mean (sd))        1.58 (1.91)       3.56 (3.60)      5.54 (5.84)    <0.00001     
##   chol (mean (sd))      326.54 (165.80)   439.50 (335.54)  415.75 (275.03)   0.00312     
##   albumin (mean (sd))     3.59 (0.36)       3.49 (0.46)      3.36 (0.47)    <0.00001     
##   copper (mean (sd))     66.61 (57.05)    124.00 (100.08)  135.41 (98.50)   <0.00001     
##   alk.phos (mean (sd)) 1578.13 (1633.07) 1535.21 (837.75) 2594.35 (2677.11)  0.00017     
##   ast (mean (sd))       107.29 (52.79)    130.12 (36.95)   141.93 (58.38)   <0.00001     
##   trig (mean (sd))      111.79 (48.28)    133.94 (70.55)   140.49 (79.26)    0.00140     
##   platelet (mean (sd))  261.16 (88.61)    309.60 (102.65)  242.49 (107.88)   0.00402     
##   protime (mean (sd))    10.45 (0.92)      10.36 (0.54)     11.19 (1.05)    <0.00001
## No explanation
print(contTable, explain = FALSE)
##           Stratified by status
##            0                 1                2                 p      test
##   n        232               25               161                          
##   time     2333.16 (994.66)  1546.20 (753.07) 1376.93 (1049.23) <0.001     
##   age        49.51 (10.43)     41.69 (6.33)     53.92 (9.81)    <0.001     
##   bili        1.58 (1.91)       3.56 (3.60)      5.54 (5.84)    <0.001     
##   chol      326.54 (165.80)   439.50 (335.54)  415.75 (275.03)   0.003     
##   albumin     3.59 (0.36)       3.49 (0.46)      3.36 (0.47)    <0.001     
##   copper     66.61 (57.05)    124.00 (100.08)  135.41 (98.50)   <0.001     
##   alk.phos 1578.13 (1633.07) 1535.21 (837.75) 2594.35 (2677.11) <0.001     
##   ast       107.29 (52.79)    130.12 (36.95)   141.93 (58.38)   <0.001     
##   trig      111.79 (48.28)    133.94 (70.55)   140.49 (79.26)    0.001     
##   platelet  261.16 (88.61)    309.60 (102.65)  242.49 (107.88)   0.004     
##   protime    10.45 (0.92)      10.36 (0.54)     11.19 (1.05)    <0.001



### Behaviors on correct data format (stratified, 2-variables)
## Two variables
contTable <- CreateContTable(vars = vars, strata = strataTwoVars, data = dataFrame)
## print method
contTable
##                       Stratified by status:sex
##                        0:m               1:m              2:m               0:f               1:f             
##   n                    17                3                24                215               22              
##   time (mean (sd))     2462.18 (1217.33) 1147.67 (785.78) 1584.88 (1120.46) 2322.95 (977.61)  1600.55 (750.70)
##   age (mean (sd))        55.69 (10.65)     42.16 (11.97)    57.42 (10.34)     49.02 (10.28)     41.63 (5.67)  
##   bili (mean (sd))        2.63 (2.62)       2.37 (1.15)      3.10 (2.25)       1.49 (1.83)       3.72 (3.80)  
##   chol (mean (sd))      367.91 (234.99)   415.33 (201.32)  352.05 (149.18)   323.31 (159.87)   444.33 (361.62)
##   albumin (mean (sd))     3.47 (0.43)       3.75 (0.28)      3.55 (0.50)       3.60 (0.35)       3.45 (0.47)  
##   copper (mean (sd))    128.82 (113.07)   215.33 (198.03)  158.68 (78.57)     62.22 (48.66)    106.88 (69.34) 
##   alk.phos (mean (sd)) 2482.25 (3052.94)  921.00 (196.50) 2189.02 (2243.18) 1514.78 (1481.83) 1650.38 (864.55)
##   ast (mean (sd))       112.28 (50.94)    110.73 (30.99)   128.38 (47.39)    106.94 (53.06)    133.75 (37.69) 
##   trig (mean (sd))      131.82 (33.73)    165.00 (64.58)   129.76 (58.95)    110.21 (48.98)    127.73 (72.11) 
##   platelet (mean (sd))  213.44 (72.17)    289.00 (65.18)   235.71 (93.92)    264.78 (88.83)    312.41 (107.56)
##   protime (mean (sd))    10.94 (0.80)      10.73 (0.51)     10.97 (1.07)      10.42 (0.92)      10.31 (0.53)  
##                       Stratified by status:sex
##                        2:f               p      test
##   n                    137                          
##   time (mean (sd))     1340.50 (1036.28) <0.001     
##   age (mean (sd))        53.31 (9.63)    <0.001     
##   bili (mean (sd))        5.97 (6.16)    <0.001     
##   chol (mean (sd))      430.14 (294.85)   0.016     
##   albumin (mean (sd))     3.33 (0.46)    <0.001     
##   copper (mean (sd))    130.39 (101.92)  <0.001     
##   alk.phos (mean (sd)) 2680.93 (2762.92)  0.001     
##   ast (mean (sd))       144.82 (60.27)   <0.001     
##   trig (mean (sd))      142.93 (83.28)    0.007     
##   platelet (mean (sd))  243.73 (110.52)   0.009     
##   protime (mean (sd))    11.23 (1.04)    <0.001
## summary method
summary(contTable)
## status: 0
## sex: m
##           n miss   mean      sd median    p25    p75    min     max   skew  kurt
## time     17    0 2462.2 1217.33 1899.0 1419.0 3445.0 1129.0  4459.0  0.581 -1.28
## age      17    0   55.7   10.65   52.9   49.1   61.0   41.0    78.4  0.818 -0.03
## bili     17    0    2.6    2.62    1.7    0.9    3.0    0.6     8.6  1.345  0.41
## chol     17    6  367.9  234.99  252.0  242.5  403.0  216.0  1000.0  2.304  5.61
## albumin  17    0    3.5    0.43    3.6    3.1    3.7    2.4     4.1 -0.937  1.18
## copper   17    6  128.8  113.07   84.0   57.0  168.0   25.0   380.0  1.380  1.25
## alk.phos 17    6 2482.3 3052.94 1098.0  913.0 2311.0  601.0 10396.8  2.175  4.50
## ast      17    6  112.3   50.94  108.5   62.8  142.6   56.8   193.0  0.446 -1.14
## trig     17    6  131.8   33.73  128.0  112.5  153.5   83.0   188.0  0.274 -0.75
## platelet 17    1  213.4   72.17  212.5  170.5  267.0   92.0   336.0 -0.066 -0.72
## protime  17    0   10.9    0.80   10.9   10.6   11.2    9.8    13.0  1.077  1.92
## --------------------------------------------------------------------------------------- 
## status: 1
## sex: m
##          n miss   mean     sd median   p25    p75   min    max  skew kurt
## time     3    0 1147.7 785.78  877.0 705.0 1455.0 533.0 2033.0  1.37  NaN
## age      3    0   42.2  11.97   35.4  35.3   45.7  35.2   56.0  1.73  NaN
## bili     3    0    2.4   1.15    2.4   1.8    3.0   1.2    3.5 -0.13  NaN
## chol     3    0  415.3 201.32  325.0 300.0  485.5 275.0  646.0  1.61  NaN
## albumin  3    0    3.7   0.28    3.8   3.6    3.9   3.4    4.0 -1.21  NaN
## copper   3    0  215.3 198.03  102.0 101.0  273.0 100.0  444.0  1.73  NaN
## alk.phos 3    0  921.0 196.50  855.0 810.5  998.5 766.0 1142.0  1.34  NaN
## ast      3    0  110.7  30.99  127.0 101.0  128.6  75.0  130.2 -1.71  NaN
## trig     3    0  165.0  64.58  194.0 142.5  202.0  91.0  210.0 -1.61  NaN
## platelet 3    0  289.0  65.18  306.0 261.5  325.0 217.0  344.0 -1.09  NaN
## protime  3    0   10.7   0.51   10.6  10.4   10.9  10.3   11.3  1.09  NaN
## --------------------------------------------------------------------------------------- 
## status: 2
## sex: m
##           n miss   mean     sd median   p25    p75   min     max   skew  kurt
## time     24    0 1584.9 1120.5 1257.0 867.2 1906.0 140.0  4191.0  1.112  0.55
## age      24    0   57.4   10.3   57.6  51.1   67.5  33.5    71.9 -0.403 -0.57
## bili     24    0    3.1    2.2    2.3   1.6    3.6   0.8     9.5  1.586  1.97
## chol     24    3  352.0  149.2  331.0 247.0  426.0 151.0   660.0  0.516 -0.44
## albumin  24    0    3.6    0.5    3.7   3.3    3.9   2.3     4.3 -0.947  0.81
## copper   24    2  158.7   78.6  165.0  96.8  215.2  13.0   290.0 -0.113 -0.99
## alk.phos 24    2 2189.0 2243.2 1452.0 973.8 2387.0 516.0 10165.0  2.551  7.32
## ast      24    2  128.4   47.4  124.8  88.5  170.5  46.5   221.9  0.313 -0.74
## trig     24    3  129.8   59.0  122.0  91.0  155.0  49.0   242.0  0.587 -0.69
## platelet 24    0  235.7   93.9  225.5 154.8  328.0  70.0   394.0  0.012 -1.17
## protime  24    0   11.0    1.1   10.9  10.2   11.3   9.7    14.1  1.391  2.25
## --------------------------------------------------------------------------------------- 
## status: 0
## sex: f
##            n miss   mean      sd median    p25    p75   min     max   skew  kurt
## time     215    0 2323.0  977.61 2195.0 1469.0 2917.5 691.0  4795.0  0.582 -0.53
## age      215    0   49.0   10.28   49.0   40.9   56.6  26.3    75.0  0.034 -0.78
## bili     215    0    1.5    1.83    0.9    0.6    1.4   0.3    13.6  3.915 18.58
## chol     215   74  323.3  159.87  294.0  246.0  360.0 120.0  1480.0  4.679 29.79
## albumin  215    0    3.6    0.35    3.6    3.4    3.8   2.5     4.6 -0.100  0.23
## copper   215   59   62.2   48.66   51.5   33.0   75.2   4.0   412.0  3.148 17.31
## alk.phos 215   58 1514.8 1481.83 1110.0  794.0 1637.0 289.0 11046.6  3.748 16.82
## ast      215   58  106.9   53.06   93.0   72.8  128.7  26.4   457.2  2.496 11.92
## trig     215   75  110.2   48.98  101.0   76.8  133.0  44.0   382.0  1.821  6.26
## platelet 215    4  264.8   88.83  256.0  209.0  317.5  79.0   539.0  0.402  0.19
## protime  215    1   10.4    0.92   10.3    9.9   10.7   9.0    18.0  4.532 32.79
## --------------------------------------------------------------------------------------- 
## status: 1
## sex: f
##           n miss   mean     sd median    p25    p75   min    max    skew   kurt
## time     22    0 1600.5 750.70 1441.0 1033.2 2260.5 617.0 3092.0  0.6083 -0.732
## age      22    0   41.6   5.67   41.1   37.3   47.0  33.0   52.0  0.1106 -1.025
## bili     22    0    3.7   3.80    3.2    1.4    4.2   0.5   18.0  2.7703  9.541
## chol     22    7  444.3 361.62  348.0  313.0  441.0 201.0 1712.0  3.4838 12.875
## albumin  22    0    3.5   0.47    3.5    3.1    3.8   2.3    4.2 -0.3997  0.202
## copper   22    6  106.9  69.34   98.0   58.5  126.2  32.0  308.0  1.6840  3.927
## alk.phos 22    6 1650.4 864.55 1407.0 1131.8 1932.0 637.0 3681.0  1.2790  1.262
## ast      22    6  133.8  37.69  124.0  114.3  153.5  54.2  205.0  0.0088  0.355
## trig     22    7  127.7  72.11  118.0   81.0  142.0  33.0  322.0  1.6287  3.156
## platelet 22    0  312.4 107.56  301.0  252.0  384.0  76.0  517.0 -0.1674  0.053
## protime  22    0   10.3   0.53   10.1   10.0   10.6   9.6   11.4  0.6395 -0.557
## --------------------------------------------------------------------------------------- 
## status: 2
## sex: f
##            n miss   mean      sd median    p25    p75   min     max   skew  kurt
## time     137    0 1340.5 1036.28 1037.0  549.0 2071.0  41.0  3853.0  0.783 -0.37
## age      137    0   53.3    9.63   53.0   46.4   60.7  30.9    76.7  0.032 -0.46
## bili     137    0    6.0    6.16    3.4    1.4    7.3   0.3    28.0  1.501  1.61
## chol     137   44  430.1  294.85  344.0  260.0  468.0 127.0  1775.0  2.454  6.88
## albumin  137    0    3.3    0.46    3.4    3.1    3.6   2.0     4.5 -0.271  0.35
## copper   137   35  130.4  101.92  102.5   58.0  172.8  14.0   588.0  2.102  6.35
## alk.phos 137   34 2680.9 2762.92 1787.0 1057.0 2562.0 559.0 13862.4  2.258  4.81
## ast      137   34  144.8   60.27  136.7  102.9  177.5  28.4   338.0  0.809  0.93
## trig     137   45  142.9   83.28  121.0   91.8  171.2  50.0   598.0  2.581 10.13
## platelet 137    6  243.7  110.52  224.0  160.0  304.0  62.0   721.0  1.106  1.97
## protime  137    1   11.2    1.04   11.1   10.6   11.8   9.0    15.2  0.695  0.84
## 
## p-values
##            pNormal pNonNormal
## time     1.891e-16  1.128e-16
## age      2.380e-09  1.699e-08
## bili     2.610e-19  1.499e-24
## chol     1.615e-02  4.032e-02
## albumin  2.891e-07  1.164e-06
## copper   6.640e-13  3.932e-14
## alk.phos 8.635e-04  7.643e-05
## ast      1.309e-05  6.230e-07
## trig     7.392e-03  7.804e-03
## platelet 8.655e-03  2.246e-03
## protime  3.480e-12  1.221e-15
## Five digits
summary(contTable, digits = 5)
## status: 0
## sex: m
##           n miss      mean         sd  median      p25      p75      min       max      skew      kurt
## time     17    0 2462.1765 1217.32721 1899.00 1419.000 3445.000 1129.000  4459.000  0.580553 -1.275652
## age      17    0   55.6860   10.64563   52.89   49.136   60.999   40.999    78.439  0.817549 -0.029683
## bili     17    0    2.6294    2.61576    1.70    0.900    3.000    0.600     8.600  1.345458  0.408840
## chol     17    6  367.9091  234.98572  252.00  242.500  403.000  216.000  1000.000  2.303585  5.609269
## albumin  17    0    3.4718    0.42631    3.59    3.150    3.730    2.380     4.080 -0.937381  1.179027
## copper   17    6  128.8182  113.07238   84.00   57.000  168.000   25.000   380.000  1.380101  1.250490
## alk.phos 17    6 2482.2545 3052.93587 1098.00  913.000 2311.000  601.000 10396.800  2.174870  4.499362
## ast      17    6  112.2773   50.94183  108.50   62.775  142.550   56.760   193.000  0.446108 -1.139098
## trig     17    6  131.8182   33.72779  128.00  112.500  153.500   83.000   188.000  0.274446 -0.745906
## platelet 17    1  213.4375   72.17291  212.50  170.500  267.000   92.000   336.000 -0.066326 -0.721429
## protime  17    0   10.9412    0.79926   10.90   10.600   11.200    9.800    13.000  1.076701  1.924353
## --------------------------------------------------------------------------------------- 
## status: 1
## sex: m
##          n miss      mean        sd  median     p25      p75     min      max     skew kurt
## time     3    0 1147.6667 785.77690 877.000 705.000 1455.000 533.000 2033.000  1.36614  NaN
## age      3    0   42.1629  11.97184  35.351  35.251   45.669  35.151   55.986  1.73151  NaN
## bili     3    0    2.3667   1.15036   2.400   1.800    2.950   1.200    3.500 -0.13028  NaN
## chol     3    0  415.3333 201.32147 325.000 300.000  485.500 275.000  646.000  1.61263  NaN
## albumin  3    0    3.7467   0.28431   3.830   3.630    3.905   3.430    3.980 -1.20566  NaN
## copper   3    0  215.3333 198.03367 102.000 101.000  273.000 100.000  444.000  1.73185  NaN
## alk.phos 3    0  921.0000 196.49682 855.000 810.500  998.500 766.000 1142.000  1.34095  NaN
## ast      3    0  110.7333  30.98731 127.000 101.000  128.600  75.000  130.200 -1.71129  NaN
## trig     3    0  165.0000  64.58328 194.000 142.500  202.000  91.000  210.000 -1.61322  NaN
## platelet 3    0  289.0000  65.18435 306.000 261.500  325.000 217.000  344.000 -1.09377  NaN
## protime  3    0   10.7333   0.51316  10.600  10.450   10.950  10.300   11.300  1.09029  NaN
## --------------------------------------------------------------------------------------- 
## status: 2
## sex: m
##           n miss      mean         sd   median      p25       p75     min       max      skew     kurt
## time     24    0 1584.8750 1120.46063 1257.000 867.2500 1906.0000 140.000  4191.000  1.111794  0.54917
## age      24    0   57.4217   10.34449   57.587  51.0726   67.4517  33.476    71.893 -0.402994 -0.57012
## bili     24    0    3.0958    2.24818    2.300   1.5750    3.6250   0.800     9.500  1.585959  1.97358
## chol     24    3  352.0476  149.17757  331.000 247.0000  426.0000 151.000   660.000  0.515581 -0.44479
## albumin  24    0    3.5533    0.49715    3.665   3.3275    3.9325   2.270     4.300 -0.946851  0.80931
## copper   24    2  158.6818   78.57201  165.000  96.7500  215.2500  13.000   290.000 -0.113305 -0.99399
## alk.phos 24    2 2189.0182 2243.18335 1452.000 973.7500 2387.0000 516.000 10165.000  2.551074  7.31597
## ast      24    2  128.3823   47.39408  124.775  88.5250  170.5000  46.500   221.880  0.313131 -0.73906
## trig     24    3  129.7619   58.95499  122.000  91.0000  155.0000  49.000   242.000  0.586741 -0.68788
## platelet 24    0  235.7083   93.91785  225.500 154.7500  328.0000  70.000   394.000  0.012464 -1.16878
## protime  24    0   10.9667    1.07164   10.950  10.1750   11.3250   9.700    14.100  1.390936  2.25229
## --------------------------------------------------------------------------------------- 
## status: 0
## sex: f
##            n miss      mean         sd   median      p25      p75     min       max      skew     kurt
## time     215    0 2322.9535  977.60792 2195.000 1469.000 2917.500 691.000  4795.000  0.582318 -0.53007
## age      215    0   49.0220   10.27669   48.999   40.895   56.600  26.278    75.012  0.033629 -0.78458
## bili     215    0    1.4926    1.82545    0.900    0.600    1.450   0.300    13.600  3.914967 18.57538
## chol     215   74  323.3121  159.87321  294.000  246.000  360.000 120.000  1480.000  4.678667 29.78599
## albumin  215    0    3.6031    0.35405    3.600    3.370    3.825   2.480     4.640 -0.100353  0.23378
## copper   215   59   62.2244   48.65528   51.500   33.000   75.250   4.000   412.000  3.148308 17.31419
## alk.phos 215   58 1514.7809 1481.83371 1110.000  794.000 1637.000 289.000 11046.600  3.748137 16.81930
## ast      215   58  106.9362   53.06053   93.000   72.850  128.650  26.350   457.250  2.495647 11.91733
## trig     215   75  110.2143   48.98066  101.000   76.750  133.000  44.000   382.000  1.821197  6.26465
## platelet 215    4  264.7773   88.83030  256.000  209.000  317.500  79.000   539.000  0.402233  0.19191
## protime  215    1   10.4154    0.92447   10.300    9.900   10.700   9.000    18.000  4.531750 32.78717
## --------------------------------------------------------------------------------------- 
## status: 1
## sex: f
##           n miss      mean        sd   median      p25       p75    min    max       skew      kurt
## time     22    0 1600.5455 750.69959 1441.000 1033.250 2260.5000 617.00 3092.0  0.6082827 -0.732399
## age      22    0   41.6294   5.67188   41.076   37.276   46.9815  32.95   52.0  0.1106357 -1.025452
## bili     22    0    3.7182   3.79795    3.150    1.375    4.1750   0.50   18.0  2.7702682  9.541192
## chol     22    7  444.3333 361.62128  348.000  313.000  441.0000 201.00 1712.0  3.4838018 12.874590
## albumin  22    0    3.4523   0.46801    3.520    3.135    3.7575   2.31    4.2 -0.3996645  0.202256
## copper   22    6  106.8750  69.34443   98.000   58.500  126.2500  32.00  308.0  1.6840068  3.926654
## alk.phos 22    6 1650.3750 864.54619 1407.000 1131.750 1932.0000 637.00 3681.0  1.2790073  1.261894
## ast      22    6  133.7500  37.69283  124.000  114.312  153.4500  54.25  205.0  0.0087982  0.354826
## trig     22    7  127.7333  72.10753  118.000   81.000  142.0000  33.00  322.0  1.6286698  3.156473
## platelet 22    0  312.4091 107.56157  301.000  252.000  384.0000  76.00  517.0 -0.1674101  0.053235
## protime  22    0   10.3091   0.53087   10.100   10.000   10.6500   9.60   11.4  0.6395260 -0.557078
## --------------------------------------------------------------------------------------- 
## status: 2
## sex: f
##            n miss      mean         sd   median     p25      p75     min       max      skew     kurt
## time     137    0 1340.5036 1036.27652 1037.000  549.00 2071.000  41.000  3853.000  0.782925 -0.36646
## age      137    0   53.3074    9.62692   52.999   46.39   60.706  30.864    76.709  0.031561 -0.46043
## bili     137    0    5.9672    6.16374    3.400    1.40    7.300   0.300    28.000  1.500648  1.60901
## chol     137   44  430.1398  294.84674  344.000  260.00  468.000 127.000  1775.000  2.453714  6.88168
## albumin  137    0    3.3268    0.45716    3.360    3.08    3.600   1.960     4.520 -0.270966  0.35446
## copper   137   35  130.3922  101.92321  102.500   58.00  172.750  14.000   588.000  2.101921  6.35488
## alk.phos 137   34 2680.9301 2762.92155 1787.000 1057.00 2562.000 559.000 13862.400  2.257705  4.80501
## ast      137   34  144.8246   60.27241  136.740  102.88  177.475  28.380   338.000  0.809307  0.92783
## trig     137   45  142.9348   83.27682  121.000   91.75  171.250  50.000   598.000  2.580792 10.13232
## platelet 137    6  243.7328  110.52183  224.000  160.00  304.000  62.000   721.000  1.106298  1.97335
## protime  137    1   11.2301    1.04402   11.050   10.60   11.800   9.000    15.200  0.694927  0.83719
## 
## p-values
##            pNormal pNonNormal
## time     1.891e-16  1.128e-16
## age      2.380e-09  1.699e-08
## bili     2.610e-19  1.499e-24
## chol     1.615e-02  4.032e-02
## albumin  2.891e-07  1.164e-06
## copper   6.640e-13  3.932e-14
## alk.phos 8.635e-04  7.643e-05
## ast      1.309e-05  6.230e-07
## trig     7.392e-03  7.804e-03
## platelet 8.655e-03  2.246e-03
## protime  3.480e-12  1.221e-15
## print method by default
print(contTable)
##                       Stratified by status:sex
##                        0:m               1:m              2:m               0:f               1:f             
##   n                    17                3                24                215               22              
##   time (mean (sd))     2462.18 (1217.33) 1147.67 (785.78) 1584.88 (1120.46) 2322.95 (977.61)  1600.55 (750.70)
##   age (mean (sd))        55.69 (10.65)     42.16 (11.97)    57.42 (10.34)     49.02 (10.28)     41.63 (5.67)  
##   bili (mean (sd))        2.63 (2.62)       2.37 (1.15)      3.10 (2.25)       1.49 (1.83)       3.72 (3.80)  
##   chol (mean (sd))      367.91 (234.99)   415.33 (201.32)  352.05 (149.18)   323.31 (159.87)   444.33 (361.62)
##   albumin (mean (sd))     3.47 (0.43)       3.75 (0.28)      3.55 (0.50)       3.60 (0.35)       3.45 (0.47)  
##   copper (mean (sd))    128.82 (113.07)   215.33 (198.03)  158.68 (78.57)     62.22 (48.66)    106.88 (69.34) 
##   alk.phos (mean (sd)) 2482.25 (3052.94)  921.00 (196.50) 2189.02 (2243.18) 1514.78 (1481.83) 1650.38 (864.55)
##   ast (mean (sd))       112.28 (50.94)    110.73 (30.99)   128.38 (47.39)    106.94 (53.06)    133.75 (37.69) 
##   trig (mean (sd))      131.82 (33.73)    165.00 (64.58)   129.76 (58.95)    110.21 (48.98)    127.73 (72.11) 
##   platelet (mean (sd))  213.44 (72.17)    289.00 (65.18)   235.71 (93.92)    264.78 (88.83)    312.41 (107.56)
##   protime (mean (sd))    10.94 (0.80)      10.73 (0.51)     10.97 (1.07)      10.42 (0.92)      10.31 (0.53)  
##                       Stratified by status:sex
##                        2:f               p      test
##   n                    137                          
##   time (mean (sd))     1340.50 (1036.28) <0.001     
##   age (mean (sd))        53.31 (9.63)    <0.001     
##   bili (mean (sd))        5.97 (6.16)    <0.001     
##   chol (mean (sd))      430.14 (294.85)   0.016     
##   albumin (mean (sd))     3.33 (0.46)    <0.001     
##   copper (mean (sd))    130.39 (101.92)  <0.001     
##   alk.phos (mean (sd)) 2680.93 (2762.92)  0.001     
##   ast (mean (sd))       144.82 (60.27)   <0.001     
##   trig (mean (sd))      142.93 (83.28)    0.007     
##   platelet (mean (sd))  243.73 (110.52)   0.009     
##   protime (mean (sd))    11.23 (1.04)    <0.001
## Five digits
print(contTable, digits = 5)
##                       Stratified by status:sex
##                        0:m                     1:m                    2:m                    
##   n                    17                      3                      24                     
##   time (mean (sd))     2462.17647 (1217.32721) 1147.66667 (785.77690) 1584.87500 (1120.46063)
##   age (mean (sd))        55.68595 (10.64563)     42.16290 (11.97184)    57.42174 (10.34449)  
##   bili (mean (sd))        2.62941 (2.61576)       2.36667 (1.15036)      3.09583 (2.24818)   
##   chol (mean (sd))      367.90909 (234.98572)   415.33333 (201.32147)  352.04762 (149.17757) 
##   albumin (mean (sd))     3.47176 (0.42631)       3.74667 (0.28431)      3.55333 (0.49715)   
##   copper (mean (sd))    128.81818 (113.07238)   215.33333 (198.03367)  158.68182 (78.57201)  
##   alk.phos (mean (sd)) 2482.25455 (3052.93587)  921.00000 (196.49682) 2189.01818 (2243.18335)
##   ast (mean (sd))       112.27727 (50.94183)    110.73333 (30.98731)   128.38227 (47.39408)  
##   trig (mean (sd))      131.81818 (33.72779)    165.00000 (64.58328)   129.76190 (58.95499)  
##   platelet (mean (sd))  213.43750 (72.17291)    289.00000 (65.18435)   235.70833 (93.91785)  
##   protime (mean (sd))    10.94118 (0.79926)      10.73333 (0.51316)     10.96667 (1.07164)   
##                       Stratified by status:sex
##                        0:f                     1:f                    2:f                     p      test
##   n                    215                     22                     137                                
##   time (mean (sd))     2322.95349 (977.60792)  1600.54545 (750.69959) 1340.50365 (1036.27652) <0.001     
##   age (mean (sd))        49.02203 (10.27669)     41.62939 (5.67188)     53.30739 (9.62692)    <0.001     
##   bili (mean (sd))        1.49256 (1.82545)       3.71818 (3.79795)      5.96715 (6.16374)    <0.001     
##   chol (mean (sd))      323.31206 (159.87321)   444.33333 (361.62128)  430.13978 (294.84674)   0.016     
##   albumin (mean (sd))     3.60312 (0.35405)       3.45227 (0.46801)      3.32679 (0.45716)    <0.001     
##   copper (mean (sd))     62.22436 (48.65528)    106.87500 (69.34443)   130.39216 (101.92321)  <0.001     
##   alk.phos (mean (sd)) 1514.78089 (1481.83371) 1650.37500 (864.54619) 2680.93010 (2762.92155)  0.001     
##   ast (mean (sd))       106.93624 (53.06053)    133.75000 (37.69283)   144.82456 (60.27241)   <0.001     
##   trig (mean (sd))      110.21429 (48.98066)    127.73333 (72.10753)   142.93478 (83.27682)    0.007     
##   platelet (mean (sd))  264.77725 (88.83030)    312.40909 (107.56157)  243.73282 (110.52183)   0.009     
##   protime (mean (sd))    10.41542 (0.92447)      10.30909 (0.53087)     11.23015 (1.04402)    <0.001
## All nonnormal
print(contTable, nonnormal = TRUE)
##                          Stratified by status:sex
##                           0:m                        1:m                      2:m                      
##   n                       17                         3                        24                       
##   time (median [IQR])     1899.00 [1419.00, 3445.00] 877.00 [705.00, 1455.00] 1257.00 [867.25, 1906.00]
##   age (median [IQR])        52.89 [49.14, 61.00]      35.35 [35.25, 45.67]      57.59 [51.07, 67.45]   
##   bili (median [IQR])        1.70 [0.90, 3.00]         2.40 [1.80, 2.95]         2.30 [1.58, 3.62]     
##   chol (median [IQR])      252.00 [242.50, 403.00]   325.00 [300.00, 485.50]   331.00 [247.00, 426.00] 
##   albumin (median [IQR])     3.59 [3.15, 3.73]         3.83 [3.63, 3.91]         3.67 [3.33, 3.93]     
##   copper (median [IQR])     84.00 [57.00, 168.00]    102.00 [101.00, 273.00]   165.00 [96.75, 215.25]  
##   alk.phos (median [IQR]) 1098.00 [913.00, 2311.00]  855.00 [810.50, 998.50]  1452.00 [973.75, 2387.00]
##   ast (median [IQR])       108.50 [62.77, 142.55]    127.00 [101.00, 128.60]   124.78 [88.53, 170.50]  
##   trig (median [IQR])      128.00 [112.50, 153.50]   194.00 [142.50, 202.00]   122.00 [91.00, 155.00]  
##   platelet (median [IQR])  212.50 [170.50, 267.00]   306.00 [261.50, 325.00]   225.50 [154.75, 328.00] 
##   protime (median [IQR])    10.90 [10.60, 11.20]      10.60 [10.45, 10.95]      10.95 [10.17, 11.33]   
##                          Stratified by status:sex
##                           0:f                        1:f                        2:f                        p     
##   n                       215                        22                         137                              
##   time (median [IQR])     2195.00 [1469.00, 2917.50] 1441.00 [1033.25, 2260.50] 1037.00 [549.00, 2071.00]  <0.001
##   age (median [IQR])        49.00 [40.90, 56.60]       41.08 [37.28, 46.98]       53.00 [46.39, 60.71]     <0.001
##   bili (median [IQR])        0.90 [0.60, 1.45]          3.15 [1.38, 4.18]          3.40 [1.40, 7.30]       <0.001
##   chol (median [IQR])      294.00 [246.00, 360.00]    348.00 [313.00, 441.00]    344.00 [260.00, 468.00]    0.040
##   albumin (median [IQR])     3.60 [3.37, 3.83]          3.52 [3.13, 3.76]          3.36 [3.08, 3.60]       <0.001
##   copper (median [IQR])     51.50 [33.00, 75.25]       98.00 [58.50, 126.25]     102.50 [58.00, 172.75]    <0.001
##   alk.phos (median [IQR]) 1110.00 [794.00, 1637.00]  1407.00 [1131.75, 1932.00] 1787.00 [1057.00, 2562.00] <0.001
##   ast (median [IQR])        93.00 [72.85, 128.65]     124.00 [114.31, 153.45]    136.74 [102.88, 177.48]   <0.001
##   trig (median [IQR])      101.00 [76.75, 133.00]     118.00 [81.00, 142.00]     121.00 [91.75, 171.25]     0.008
##   platelet (median [IQR])  256.00 [209.00, 317.50]    301.00 [252.00, 384.00]    224.00 [160.00, 304.00]    0.002
##   protime (median [IQR])    10.30 [9.90, 10.70]        10.10 [10.00, 10.65]       11.05 [10.60, 11.80]     <0.001
##                          Stratified by status:sex
##                           test   
##   n                              
##   time (median [IQR])     nonnorm
##   age (median [IQR])      nonnorm
##   bili (median [IQR])     nonnorm
##   chol (median [IQR])     nonnorm
##   albumin (median [IQR])  nonnorm
##   copper (median [IQR])   nonnorm
##   alk.phos (median [IQR]) nonnorm
##   ast (median [IQR])      nonnorm
##   trig (median [IQR])     nonnorm
##   platelet (median [IQR]) nonnorm
##   protime (median [IQR])  nonnorm
## quote
print(contTable, quote = TRUE)
##                         "Stratified by status:sex"
##  ""                      "0:m"               "1:m"              "2:m"               "0:f"              
##   "n"                    "17"                "3"                "24"                "215"              
##   "time (mean (sd))"     "2462.18 (1217.33)" "1147.67 (785.78)" "1584.88 (1120.46)" "2322.95 (977.61)" 
##   "age (mean (sd))"      "  55.69 (10.65)"   "  42.16 (11.97)"  "  57.42 (10.34)"   "  49.02 (10.28)"  
##   "bili (mean (sd))"     "   2.63 (2.62)"    "   2.37 (1.15)"   "   3.10 (2.25)"    "   1.49 (1.83)"   
##   "chol (mean (sd))"     " 367.91 (234.99)"  " 415.33 (201.32)" " 352.05 (149.18)"  " 323.31 (159.87)" 
##   "albumin (mean (sd))"  "   3.47 (0.43)"    "   3.75 (0.28)"   "   3.55 (0.50)"    "   3.60 (0.35)"   
##   "copper (mean (sd))"   " 128.82 (113.07)"  " 215.33 (198.03)" " 158.68 (78.57)"   "  62.22 (48.66)"  
##   "alk.phos (mean (sd))" "2482.25 (3052.94)" " 921.00 (196.50)" "2189.02 (2243.18)" "1514.78 (1481.83)"
##   "ast (mean (sd))"      " 112.28 (50.94)"   " 110.73 (30.99)"  " 128.38 (47.39)"   " 106.94 (53.06)"  
##   "trig (mean (sd))"     " 131.82 (33.73)"   " 165.00 (64.58)"  " 129.76 (58.95)"   " 110.21 (48.98)"  
##   "platelet (mean (sd))" " 213.44 (72.17)"   " 289.00 (65.18)"  " 235.71 (93.92)"   " 264.78 (88.83)"  
##   "protime (mean (sd))"  "  10.94 (0.80)"    "  10.73 (0.51)"   "  10.97 (1.07)"    "  10.42 (0.92)"   
##                         "Stratified by status:sex"
##  ""                      "1:f"              "2:f"               "p"      "test"
##   "n"                    "22"               "137"               ""       ""    
##   "time (mean (sd))"     "1600.55 (750.70)" "1340.50 (1036.28)" "<0.001" ""    
##   "age (mean (sd))"      "  41.63 (5.67)"   "  53.31 (9.63)"    "<0.001" ""    
##   "bili (mean (sd))"     "   3.72 (3.80)"   "   5.97 (6.16)"    "<0.001" ""    
##   "chol (mean (sd))"     " 444.33 (361.62)" " 430.14 (294.85)"  " 0.016" ""    
##   "albumin (mean (sd))"  "   3.45 (0.47)"   "   3.33 (0.46)"    "<0.001" ""    
##   "copper (mean (sd))"   " 106.88 (69.34)"  " 130.39 (101.92)"  "<0.001" ""    
##   "alk.phos (mean (sd))" "1650.38 (864.55)" "2680.93 (2762.92)" " 0.001" ""    
##   "ast (mean (sd))"      " 133.75 (37.69)"  " 144.82 (60.27)"   "<0.001" ""    
##   "trig (mean (sd))"     " 127.73 (72.11)"  " 142.93 (83.28)"   " 0.007" ""    
##   "platelet (mean (sd))" " 312.41 (107.56)" " 243.73 (110.52)"  " 0.009" ""    
##   "protime (mean (sd))"  "  10.31 (0.53)"   "  11.23 (1.04)"    "<0.001" ""
## Partially nonnormal
print(contTable, nonnormal = nonNormalVars)
##                          Stratified by status:sex
##                           0:m                       1:m                      2:m                      
##   n                       17                        3                        24                       
##   time (mean (sd))        2462.18 (1217.33)         1147.67 (785.78)         1584.88 (1120.46)        
##   age (mean (sd))           55.69 (10.65)             42.16 (11.97)            57.42 (10.34)          
##   bili (median [IQR])        1.70 [0.90, 3.00]         2.40 [1.80, 2.95]        2.30 [1.58, 3.62]     
##   chol (median [IQR])      252.00 [242.50, 403.00]   325.00 [300.00, 485.50]  331.00 [247.00, 426.00] 
##   albumin (mean (sd))        3.47 (0.43)               3.75 (0.28)              3.55 (0.50)           
##   copper (median [IQR])     84.00 [57.00, 168.00]    102.00 [101.00, 273.00]  165.00 [96.75, 215.25]  
##   alk.phos (median [IQR]) 1098.00 [913.00, 2311.00]  855.00 [810.50, 998.50] 1452.00 [973.75, 2387.00]
##   ast (mean (sd))          112.28 (50.94)            110.73 (30.99)           128.38 (47.39)          
##   trig (median [IQR])      128.00 [112.50, 153.50]   194.00 [142.50, 202.00]  122.00 [91.00, 155.00]  
##   platelet (mean (sd))     213.44 (72.17)            289.00 (65.18)           235.71 (93.92)          
##   protime (median [IQR])    10.90 [10.60, 11.20]      10.60 [10.45, 10.95]     10.95 [10.17, 11.33]   
##                          Stratified by status:sex
##                           0:f                       1:f                        2:f                        p     
##   n                       215                       22                         137                              
##   time (mean (sd))        2322.95 (977.61)          1600.55 (750.70)           1340.50 (1036.28)          <0.001
##   age (mean (sd))           49.02 (10.28)             41.63 (5.67)               53.31 (9.63)             <0.001
##   bili (median [IQR])        0.90 [0.60, 1.45]         3.15 [1.38, 4.18]          3.40 [1.40, 7.30]       <0.001
##   chol (median [IQR])      294.00 [246.00, 360.00]   348.00 [313.00, 441.00]    344.00 [260.00, 468.00]    0.040
##   albumin (mean (sd))        3.60 (0.35)               3.45 (0.47)                3.33 (0.46)             <0.001
##   copper (median [IQR])     51.50 [33.00, 75.25]      98.00 [58.50, 126.25]     102.50 [58.00, 172.75]    <0.001
##   alk.phos (median [IQR]) 1110.00 [794.00, 1637.00] 1407.00 [1131.75, 1932.00] 1787.00 [1057.00, 2562.00] <0.001
##   ast (mean (sd))          106.94 (53.06)            133.75 (37.69)             144.82 (60.27)            <0.001
##   trig (median [IQR])      101.00 [76.75, 133.00]    118.00 [81.00, 142.00]     121.00 [91.75, 171.25]     0.008
##   platelet (mean (sd))     264.78 (88.83)            312.41 (107.56)            243.73 (110.52)            0.009
##   protime (median [IQR])    10.30 [9.90, 10.70]       10.10 [10.00, 10.65]       11.05 [10.60, 11.80]     <0.001
##                          Stratified by status:sex
##                           test   
##   n                              
##   time (mean (sd))               
##   age (mean (sd))                
##   bili (median [IQR])     nonnorm
##   chol (median [IQR])     nonnorm
##   albumin (mean (sd))            
##   copper (median [IQR])   nonnorm
##   alk.phos (median [IQR]) nonnorm
##   ast (mean (sd))                
##   trig (median [IQR])     nonnorm
##   platelet (mean (sd))           
##   protime (median [IQR])  nonnorm
## Partially nonnormal median [range]
print(contTable, nonnormal = nonNormalVars, minMax = TRUE)
##                            Stratified by status:sex
##                             0:m                        1:m                       2:m                       
##   n                         17                         3                         24                        
##   time (mean (sd))          2462.18 (1217.33)          1147.67 (785.78)          1584.88 (1120.46)         
##   age (mean (sd))             55.69 (10.65)              42.16 (11.97)             57.42 (10.34)           
##   bili (median [range])        1.70 [0.60, 8.60]          2.40 [1.20, 3.50]         2.30 [0.80, 9.50]      
##   chol (median [range])      252.00 [216.00, 1000.00]   325.00 [275.00, 646.00]   331.00 [151.00, 660.00]  
##   albumin (mean (sd))          3.47 (0.43)                3.75 (0.28)               3.55 (0.50)            
##   copper (median [range])     84.00 [25.00, 380.00]     102.00 [100.00, 444.00]   165.00 [13.00, 290.00]   
##   alk.phos (median [range]) 1098.00 [601.00, 10396.80]  855.00 [766.00, 1142.00] 1452.00 [516.00, 10165.00]
##   ast (mean (sd))            112.28 (50.94)             110.73 (30.99)            128.38 (47.39)           
##   trig (median [range])      128.00 [83.00, 188.00]     194.00 [91.00, 210.00]    122.00 [49.00, 242.00]   
##   platelet (mean (sd))       213.44 (72.17)             289.00 (65.18)            235.71 (93.92)           
##   protime (median [range])    10.90 [9.80, 13.00]        10.60 [10.30, 11.30]      10.95 [9.70, 14.10]     
##                            Stratified by status:sex
##                             0:f                        1:f                       2:f                        p     
##   n                         215                        22                        137                              
##   time (mean (sd))          2322.95 (977.61)           1600.55 (750.70)          1340.50 (1036.28)          <0.001
##   age (mean (sd))             49.02 (10.28)              41.63 (5.67)              53.31 (9.63)             <0.001
##   bili (median [range])        0.90 [0.30, 13.60]         3.15 [0.50, 18.00]        3.40 [0.30, 28.00]      <0.001
##   chol (median [range])      294.00 [120.00, 1480.00]   348.00 [201.00, 1712.00]  344.00 [127.00, 1775.00]   0.040
##   albumin (mean (sd))          3.60 (0.35)                3.45 (0.47)               3.33 (0.46)             <0.001
##   copper (median [range])     51.50 [4.00, 412.00]       98.00 [32.00, 308.00]    102.50 [14.00, 588.00]    <0.001
##   alk.phos (median [range]) 1110.00 [289.00, 11046.60] 1407.00 [637.00, 3681.00] 1787.00 [559.00, 13862.40] <0.001
##   ast (mean (sd))            106.94 (53.06)             133.75 (37.69)            144.82 (60.27)            <0.001
##   trig (median [range])      101.00 [44.00, 382.00]     118.00 [33.00, 322.00]    121.00 [50.00, 598.00]     0.008
##   platelet (mean (sd))       264.78 (88.83)             312.41 (107.56)           243.73 (110.52)            0.009
##   protime (median [range])    10.30 [9.00, 18.00]        10.10 [9.60, 11.40]       11.05 [9.00, 15.20]      <0.001
##                            Stratified by status:sex
##                             test   
##   n                                
##   time (mean (sd))                 
##   age (mean (sd))                  
##   bili (median [range])     nonnorm
##   chol (median [range])     nonnorm
##   albumin (mean (sd))              
##   copper (median [range])   nonnorm
##   alk.phos (median [range]) nonnorm
##   ast (mean (sd))                  
##   trig (median [range])     nonnorm
##   platelet (mean (sd))             
##   protime (median [range])  nonnorm
## test
print(contTable, test = FALSE)
##                       Stratified by status:sex
##                        0:m               1:m              2:m               0:f               1:f             
##   n                    17                3                24                215               22              
##   time (mean (sd))     2462.18 (1217.33) 1147.67 (785.78) 1584.88 (1120.46) 2322.95 (977.61)  1600.55 (750.70)
##   age (mean (sd))        55.69 (10.65)     42.16 (11.97)    57.42 (10.34)     49.02 (10.28)     41.63 (5.67)  
##   bili (mean (sd))        2.63 (2.62)       2.37 (1.15)      3.10 (2.25)       1.49 (1.83)       3.72 (3.80)  
##   chol (mean (sd))      367.91 (234.99)   415.33 (201.32)  352.05 (149.18)   323.31 (159.87)   444.33 (361.62)
##   albumin (mean (sd))     3.47 (0.43)       3.75 (0.28)      3.55 (0.50)       3.60 (0.35)       3.45 (0.47)  
##   copper (mean (sd))    128.82 (113.07)   215.33 (198.03)  158.68 (78.57)     62.22 (48.66)    106.88 (69.34) 
##   alk.phos (mean (sd)) 2482.25 (3052.94)  921.00 (196.50) 2189.02 (2243.18) 1514.78 (1481.83) 1650.38 (864.55)
##   ast (mean (sd))       112.28 (50.94)    110.73 (30.99)   128.38 (47.39)    106.94 (53.06)    133.75 (37.69) 
##   trig (mean (sd))      131.82 (33.73)    165.00 (64.58)   129.76 (58.95)    110.21 (48.98)    127.73 (72.11) 
##   platelet (mean (sd))  213.44 (72.17)    289.00 (65.18)   235.71 (93.92)    264.78 (88.83)    312.41 (107.56)
##   protime (mean (sd))    10.94 (0.80)      10.73 (0.51)     10.97 (1.07)      10.42 (0.92)      10.31 (0.53)  
##                       Stratified by status:sex
##                        2:f              
##   n                    137              
##   time (mean (sd))     1340.50 (1036.28)
##   age (mean (sd))        53.31 (9.63)   
##   bili (mean (sd))        5.97 (6.16)   
##   chol (mean (sd))      430.14 (294.85) 
##   albumin (mean (sd))     3.33 (0.46)   
##   copper (mean (sd))    130.39 (101.92) 
##   alk.phos (mean (sd)) 2680.93 (2762.92)
##   ast (mean (sd))       144.82 (60.27)  
##   trig (mean (sd))      142.93 (83.28)  
##   platelet (mean (sd))  243.73 (110.52) 
##   protime (mean (sd))    11.23 (1.04)
## pDigits
print(contTable, pDigits = 5)
##                       Stratified by status:sex
##                        0:m               1:m              2:m               0:f               1:f             
##   n                    17                3                24                215               22              
##   time (mean (sd))     2462.18 (1217.33) 1147.67 (785.78) 1584.88 (1120.46) 2322.95 (977.61)  1600.55 (750.70)
##   age (mean (sd))        55.69 (10.65)     42.16 (11.97)    57.42 (10.34)     49.02 (10.28)     41.63 (5.67)  
##   bili (mean (sd))        2.63 (2.62)       2.37 (1.15)      3.10 (2.25)       1.49 (1.83)       3.72 (3.80)  
##   chol (mean (sd))      367.91 (234.99)   415.33 (201.32)  352.05 (149.18)   323.31 (159.87)   444.33 (361.62)
##   albumin (mean (sd))     3.47 (0.43)       3.75 (0.28)      3.55 (0.50)       3.60 (0.35)       3.45 (0.47)  
##   copper (mean (sd))    128.82 (113.07)   215.33 (198.03)  158.68 (78.57)     62.22 (48.66)    106.88 (69.34) 
##   alk.phos (mean (sd)) 2482.25 (3052.94)  921.00 (196.50) 2189.02 (2243.18) 1514.78 (1481.83) 1650.38 (864.55)
##   ast (mean (sd))       112.28 (50.94)    110.73 (30.99)   128.38 (47.39)    106.94 (53.06)    133.75 (37.69) 
##   trig (mean (sd))      131.82 (33.73)    165.00 (64.58)   129.76 (58.95)    110.21 (48.98)    127.73 (72.11) 
##   platelet (mean (sd))  213.44 (72.17)    289.00 (65.18)   235.71 (93.92)    264.78 (88.83)    312.41 (107.56)
##   protime (mean (sd))    10.94 (0.80)      10.73 (0.51)     10.97 (1.07)      10.42 (0.92)      10.31 (0.53)  
##                       Stratified by status:sex
##                        2:f               p        test
##   n                    137                            
##   time (mean (sd))     1340.50 (1036.28) <0.00001     
##   age (mean (sd))        53.31 (9.63)    <0.00001     
##   bili (mean (sd))        5.97 (6.16)    <0.00001     
##   chol (mean (sd))      430.14 (294.85)   0.01615     
##   albumin (mean (sd))     3.33 (0.46)    <0.00001     
##   copper (mean (sd))    130.39 (101.92)  <0.00001     
##   alk.phos (mean (sd)) 2680.93 (2762.92)  0.00086     
##   ast (mean (sd))       144.82 (60.27)    0.00001     
##   trig (mean (sd))      142.93 (83.28)    0.00739     
##   platelet (mean (sd))  243.73 (110.52)   0.00866     
##   protime (mean (sd))    11.23 (1.04)    <0.00001
## No explanation
print(contTable, explain = FALSE)
##           Stratified by status:sex
##            0:m               1:m              2:m               0:f               1:f             
##   n        17                3                24                215               22              
##   time     2462.18 (1217.33) 1147.67 (785.78) 1584.88 (1120.46) 2322.95 (977.61)  1600.55 (750.70)
##   age        55.69 (10.65)     42.16 (11.97)    57.42 (10.34)     49.02 (10.28)     41.63 (5.67)  
##   bili        2.63 (2.62)       2.37 (1.15)      3.10 (2.25)       1.49 (1.83)       3.72 (3.80)  
##   chol      367.91 (234.99)   415.33 (201.32)  352.05 (149.18)   323.31 (159.87)   444.33 (361.62)
##   albumin     3.47 (0.43)       3.75 (0.28)      3.55 (0.50)       3.60 (0.35)       3.45 (0.47)  
##   copper    128.82 (113.07)   215.33 (198.03)  158.68 (78.57)     62.22 (48.66)    106.88 (69.34) 
##   alk.phos 2482.25 (3052.94)  921.00 (196.50) 2189.02 (2243.18) 1514.78 (1481.83) 1650.38 (864.55)
##   ast       112.28 (50.94)    110.73 (30.99)   128.38 (47.39)    106.94 (53.06)    133.75 (37.69) 
##   trig      131.82 (33.73)    165.00 (64.58)   129.76 (58.95)    110.21 (48.98)    127.73 (72.11) 
##   platelet  213.44 (72.17)    289.00 (65.18)   235.71 (93.92)    264.78 (88.83)    312.41 (107.56)
##   protime    10.94 (0.80)      10.73 (0.51)     10.97 (1.07)      10.42 (0.92)      10.31 (0.53)  
##           Stratified by status:sex
##            2:f               p      test
##   n        137                          
##   time     1340.50 (1036.28) <0.001     
##   age        53.31 (9.63)    <0.001     
##   bili        5.97 (6.16)    <0.001     
##   chol      430.14 (294.85)   0.016     
##   albumin     3.33 (0.46)    <0.001     
##   copper    130.39 (101.92)  <0.001     
##   alk.phos 2680.93 (2762.92)  0.001     
##   ast       144.82 (60.27)   <0.001     
##   trig      142.93 (83.28)    0.007     
##   platelet  243.73 (110.52)   0.009     
##   protime    11.23 (1.04)    <0.001


### Behaviors on correct data format (stratified, 3-variables (1 empty level))
## Three variables
contTable <- CreateContTable(vars = vars, strata = strataThreeVars, data = dataFrame)
## print method
contTable
##                       Stratified by sex:ascites:hepato
##                        m:0:0             f:0:0             m:1:0 f:1:0             m:0:1            
##   n                    15                132               0     5                 18               
##   time (mean (sd))     2412.33 (1422.19) 2375.19 (1020.62) -     1130.20 (1382.64) 1702.78 (1198.55)
##   age (mean (sd))        51.07 (12.11)     48.41 (10.22)   -       64.57 (10.52)     58.60 (9.18)   
##   bili (mean (sd))        2.24 (1.31)       1.61 (2.40)    -        7.14 (7.65)       3.37 (2.61)   
##   chol (mean (sd))      360.33 (164.98)   336.99 (158.86)  -      253.00 (86.81)    382.61 (194.31) 
##   albumin (mean (sd))     3.72 (0.44)       3.67 (0.34)    -        2.85 (0.54)       3.59 (0.34)   
##   copper (mean (sd))    166.27 (107.94)    65.56 (56.66)   -      112.40 (72.72)    142.44 (82.94)  
##   alk.phos (mean (sd)) 2839.41 (3424.63) 1634.45 (1732.65) -     1257.60 (416.42)  1822.89 (1260.72)
##   ast (mean (sd))       125.02 (43.62)    111.35 (52.10)   -      170.83 (118.75)   124.49 (49.03)  
##   trig (mean (sd))      132.20 (55.55)    110.70 (52.29)   -      138.50 (67.34)    138.00 (49.34)  
##   platelet (mean (sd))  246.57 (88.70)    287.36 (87.74)   -      192.80 (116.54)   240.94 (86.30)  
##   protime (mean (sd))    11.07 (1.19)      10.42 (0.89)    -       12.02 (1.16)      10.82 (0.63)   
##                       Stratified by sex:ascites:hepato
##                        f:0:1             m:1:1            f:1:1             p      test
##   n                    123               3                16                           
##   time (mean (sd))     1838.28 (1007.36) 1057.67 (799.01)  668.25 (805.64)  <0.001     
##   age (mean (sd))        48.71 (9.71)      67.52 (11.11)    54.92 (8.91)    <0.001     
##   bili (mean (sd))        3.97 (4.84)       3.07 (3.50)     10.97 (7.80)    <0.001     
##   chol (mean (sd))      411.14 (298.67)   197.00 (65.05)   364.50 (247.72)   0.210     
##   albumin (mean (sd))     3.43 (0.39)       2.79 (0.45)      3.02 (0.45)    <0.001     
##   copper (mean (sd))    104.11 (85.01)    165.33 (186.51)  184.13 (125.71)  <0.001     
##   alk.phos (mean (sd)) 2259.90 (2445.16)  941.00 (195.41) 2522.41 (2043.39)  0.109     
##   ast (mean (sd))       130.47 (60.16)     91.87 (58.65)   140.36 (43.22)    0.032     
##   trig (mean (sd))      127.48 (60.14)    101.50 (74.25)   193.71 (145.19)   0.001     
##   platelet (mean (sd))  253.06 (97.99)    155.33 (58.00)   197.38 (94.71)   <0.001     
##   protime (mean (sd))    10.79 (0.96)      11.80 (1.22)     11.79 (1.09)    <0.001
## summary method
summary(contTable)
## sex: m
## ascites: 0
## hepato: 0
##           n miss   mean      sd median    p25    p75   min     max  skew  kurt
## time     15    0 2412.3 1422.19 2386.0 1186.0 3607.5 140.0  4459.0  0.12 -1.29
## age      15    0   51.1   12.11   49.1   44.2   60.8  33.5    70.1  0.19 -1.02
## bili     15    0    2.2    1.31    1.9    1.6    2.5   0.6     6.0  1.71  4.35
## chol     15    0  360.3  164.98  317.0  250.5  438.0 168.0   660.0  0.87 -0.46
## albumin  15    0    3.7    0.44    3.8    3.5    4.0   2.6     4.3 -1.27  2.40
## copper   15    0  166.3  107.94  158.0   98.0  213.5  13.0   444.0  1.02  2.05
## alk.phos 15    0 2839.4 3424.63 1056.0  740.0 3470.7 516.0 10396.8  1.61  1.36
## ast      15    0  125.0   43.62  127.0  102.3  141.1  56.8   206.4  0.26 -0.32
## trig     15    0  132.2   55.55  118.0   85.5  183.0  55.0   219.0  0.19 -1.42
## platelet 15    1  246.6   88.70  213.5  180.8  329.2 108.0   394.0  0.25 -1.17
## protime  15    0   11.1    1.19   10.6   10.2   11.3   9.7    14.1  1.47  1.96
## --------------------------------------------------------------------------------------- 
## sex: f
## ascites: 0
## hepato: 0
##            n miss   mean      sd median    p25    p75   min     max  skew  kurt
## time     132    0 2375.2 1020.62 2361.0 1475.0 3089.0 198.0  4556.0 0.168 -0.73
## age      132    0   48.4   10.22   48.0   40.7   56.1  28.9    75.0 0.271 -0.55
## bili     132    0    1.6    2.40    0.9    0.6    1.4   0.3    22.5 5.827 45.14
## chol     132   15  337.0  158.86  296.0  242.0  390.0 120.0  1276.0 2.853 12.23
## albumin  132    0    3.7    0.34    3.7    3.4    3.9   2.8     4.6 0.075  0.20
## copper   132    1   65.6   56.66   52.0   32.0   78.5   4.0   464.0 3.395 18.96
## alk.phos 132    0 1634.5 1732.65 1177.5  793.2 1689.8 369.0 12258.8 3.998 18.79
## ast      132    0  111.4   52.10   99.1   73.4  136.2  28.4   328.6 1.278  2.10
## trig     132   15  110.7   52.29  100.0   74.0  135.0  44.0   382.0 1.875  5.96
## platelet 132    0  287.4   87.74  278.0  226.5  336.5  71.0   514.0 0.267 -0.17
## protime  132    0   10.4    0.89   10.3    9.9   10.7   9.0    17.1 3.791 24.98
## --------------------------------------------------------------------------------------- 
## sex: m
## ascites: 1
## hepato: 0
## NULL
## --------------------------------------------------------------------------------------- 
## sex: f
## ascites: 1
## hepato: 0
##          n miss   mean      sd median   p25    p75   min    max  skew  kurt
## time     5    0 1130.2 1382.64  388.0  51.0 2081.0  41.0 3090.0  0.86 -1.63
## age      5    0   64.6   10.52   65.9  60.7   70.6  49.0   76.7 -0.66  0.39
## bili     5    0    7.1    7.65    2.5   1.4   12.6   1.3   17.9  0.86 -1.80
## chol     5    0  253.0   86.81  206.0 200.0  302.0 175.0  382.0  0.98 -0.68
## albumin  5    0    2.9    0.54    2.8   2.7    3.1   2.1    3.5 -0.20  0.49
## copper   5    0  112.4   72.72  108.0  58.0  140.0  36.0  220.0  0.71 -0.07
## alk.phos 5    0 1257.6  416.42 1516.0 918.0 1523.0 705.0 1626.0 -0.70 -2.41
## ast      5    0  170.8  118.75  147.2  86.8  238.7  43.4  338.0  0.57 -0.98
## trig     5    1  138.5   67.34  127.5 101.5  164.5  70.0  229.0  0.88  1.02
## platelet 5    0  192.8  116.54  145.0 126.0  302.0  62.0  329.0  0.31 -2.55
## protime  5    0   12.0    1.16   12.2  11.5   12.9  10.3   13.2 -0.76 -0.29
## --------------------------------------------------------------------------------------- 
## sex: m
## ascites: 0
## hepato: 1
##           n miss   mean      sd median    p25    p75   min    max  skew   kurt
## time     18    0 1702.8 1198.55 1299.5  821.8 2088.5 533.0 4191.0  1.14  0.053
## age      18    0   58.6    9.18   58.3   51.3   66.6  44.5   74.5  0.22 -1.195
## bili     18    0    3.4    2.61    2.3    1.2    5.2   0.6    8.6  0.78 -0.760
## chol     18    0  382.6  194.31  361.0  251.2  426.8 178.0 1000.0  1.98  5.357
## albumin  18    0    3.6    0.34    3.7    3.4    3.9   3.0    4.0 -0.61 -0.901
## copper   18    0  142.4   82.94  114.5   81.8  197.0  25.0  290.0  0.48 -1.049
## alk.phos 18    0 1822.9 1260.72 1222.5 1028.8 2387.0 681.0 5719.0  1.92  4.468
## ast      18    0  124.5   49.03  118.6   84.3  168.9  57.4  221.9  0.48 -0.872
## trig     18    0  138.0   49.34  127.0   95.0  153.8  83.0  242.0  1.00  0.086
## platelet 18    0  240.9   86.30  250.0  189.5  298.8  70.0  360.0 -0.47 -0.738
## protime  18    0   10.8    0.63   10.9   10.4   11.3   9.8   12.0 -0.25 -0.676
## --------------------------------------------------------------------------------------- 
## sex: f
## ascites: 0
## hepato: 1
##            n miss   mean      sd median    p25    p75   min     max  skew  kurt
## time     123    0 1838.3 1007.36 1741.0 1083.5 2391.0  71.0  4523.0  0.71  0.24
## age      123    0   48.7    9.71   49.3   41.4   55.6  26.3    69.3 -0.06 -0.69
## bili     123    0    4.0    4.84    2.1    1.0    5.0   0.4    28.0  2.64  8.22
## chol     123   10  411.1  298.67  322.0  260.0  408.0 149.0  1775.0  3.09  9.84
## albumin  123    0    3.4    0.39    3.5    3.2    3.6   2.0     4.2 -0.62  1.57
## copper   123    0  104.1   85.01   76.0   50.0  125.5  11.0   588.0  2.47  9.18
## alk.phos 123    0 2259.9 2445.16 1428.0  958.0 2280.0 289.0 13862.4  2.68  7.38
## ast      123    0  130.5   60.16  120.9   90.5  158.9  26.4   457.2  1.76  6.54
## trig     123   11  127.5   60.14  108.5   89.5  149.8  33.0   322.0  1.40  2.04
## platelet 123    3  253.1   97.99  239.0  184.5  306.0  79.0   563.0  0.71  0.72
## protime  123    0   10.8    0.96   10.6   10.0   11.5   9.2    13.3  0.65 -0.34
## --------------------------------------------------------------------------------------- 
## sex: m
## ascites: 1
## hepato: 1
##          n miss   mean     sd median   p25    p75   min    max   skew kurt
## time     3    0 1057.7 799.01 1217.0 704.0 1491.0 191.0 1765.0 -0.862  NaN
## age      3    0   67.5  11.11   67.9  62.1   73.2  56.2   78.4 -0.155  NaN
## bili     3    0    3.1   3.50    1.3   1.1    4.2   0.8    7.1  1.692  NaN
## chol     3    1  197.0  65.05  197.0 174.0  220.0 151.0  243.0    NaN  NaN
## albumin  3    0    2.8   0.45    3.0   2.6    3.1   2.3    3.1 -1.708  NaN
## copper   3    0  165.3 186.51   73.0  58.0  226.5  43.0  380.0  1.682  NaN
## alk.phos 3    0  941.0 195.41  983.0 855.5 1047.5 728.0 1112.0 -0.922  NaN
## ast      3    0   91.9  58.65   71.0  58.8  114.5  46.5  158.1  1.398  NaN
## trig     3    1  101.5  74.25  101.5  75.2  127.8  49.0  154.0    NaN  NaN
## platelet 3    0  155.3  58.00  156.0 126.5  184.5  97.0  213.0 -0.052  NaN
## protime  3    0   11.8   1.22   11.2  11.1   12.2  11.0   13.2  1.680  NaN
## --------------------------------------------------------------------------------------- 
## sex: f
## ascites: 1
## hepato: 1
##           n miss mean      sd median    p25    p75   min    max  skew  kurt
## time     16    0  668  805.64    341  206.8  915.8  77.0 3222.0 2.390  6.58
## age      16    0   55    8.91     55   48.3   61.4  39.2   70.9 0.048 -0.53
## bili     16    0   11    7.80     11    4.0   17.2   1.2   24.5 0.178 -1.43
## chol     16    2  364  247.72    278  222.0  382.2 175.0 1092.0 2.299  5.70
## albumin  16    0    3    0.45      3    2.6    3.3   2.3    3.9 0.261 -0.61
## copper   16    1  184  125.71    182  130.5  215.0  16.0  558.0 1.797  5.47
## alk.phos 16    0 2522 2043.39   1776 1070.2 3708.1 559.0 6931.2 1.158  0.10
## ast      16    0  140   43.22    136  105.5  176.5  73.5  227.0 0.288 -0.65
## trig     16    2  194  145.19    162  118.0  188.0  68.0  598.0 2.184  4.55
## platelet 16    0  197   94.71    178  138.5  224.0  80.0  401.0 1.194  0.97
## protime  16    0   12    1.09     12   11.1   12.0  10.6   15.2 2.201  6.15
## 
## p-values
##            pNormal pNonNormal
## time     2.212e-09  3.079e-09
## age      4.535e-07  2.860e-05
## bili     3.761e-15  1.059e-13
## chol     2.101e-01  7.850e-02
## albumin  5.323e-15  8.993e-11
## copper   4.615e-10  4.233e-10
## alk.phos 1.087e-01  7.650e-02
## ast      3.181e-02  2.190e-02
## trig     6.931e-04  8.213e-03
## platelet 2.232e-04  1.645e-04
## protime  1.554e-08  2.096e-08
## Five digits
summary(contTable, digits = 5)
## sex: m
## ascites: 0
## hepato: 0
##           n miss      mean        sd   median      p25      p75     min       max     skew     kurt
## time     15    0 2412.3333 1422.1935 2386.000 1186.000 3607.500 140.000  4459.000  0.11514 -1.28856
## age      15    0   51.0658   12.1127   49.136   44.234   60.798  33.476    70.073  0.18822 -1.02481
## bili     15    0    2.2400    1.3092    1.900    1.550    2.450   0.600     6.000  1.70918  4.35377
## chol     15    0  360.3333  164.9847  317.000  250.500  438.000 168.000   660.000  0.86891 -0.45501
## albumin  15    0    3.7227    0.4384    3.830    3.470    3.965   2.560     4.300 -1.26772  2.40204
## copper   15    0  166.2667  107.9421  158.000   98.000  213.500  13.000   444.000  1.02399  2.05082
## alk.phos 15    0 2839.4133 3424.6273 1056.000  740.000 3470.700 516.000 10396.800  1.61265  1.35674
## ast      15    0  125.0153   43.6168  127.000  102.300  141.050  56.760   206.400  0.26480 -0.32296
## trig     15    0  132.2000   55.5482  118.000   85.500  183.000  55.000   219.000  0.19362 -1.41698
## platelet 15    1  246.5714   88.7041  213.500  180.750  329.250 108.000   394.000  0.25147 -1.16574
## protime  15    0   11.0667    1.1938   10.600   10.250   11.350   9.700    14.100  1.47431  1.95643
## --------------------------------------------------------------------------------------- 
## sex: f
## ascites: 0
## hepato: 0
##            n miss      mean         sd   median      p25      p75     min       max     skew     kurt
## time     132    0 2375.1894 1020.61775 2361.000 1475.000 3089.000 198.000  4556.000 0.167853 -0.72608
## age      132    0   48.4083   10.22279   47.981   40.676   56.098  28.884    75.012 0.271431 -0.54517
## bili     132    0    1.6121    2.39898    0.900    0.600    1.425   0.300    22.500 5.826786 45.13848
## chol     132   15  336.9915  158.86242  296.000  242.000  390.000 120.000  1276.000 2.852877 12.22718
## albumin  132    0    3.6704    0.33816    3.660    3.440    3.875   2.750     4.640 0.074731  0.20094
## copper   132    1   65.5573   56.66177   52.000   32.000   78.500   4.000   464.000 3.395070 18.96074
## alk.phos 132    0 1634.4515 1732.64762 1177.500  793.250 1689.750 369.000 12258.800 3.998408 18.78644
## ast      132    0  111.3505   52.09675   99.100   73.360  136.250  28.380   328.600 1.277914  2.09790
## trig     132   15  110.7009   52.29018  100.000   74.000  135.000  44.000   382.000 1.874578  5.96483
## platelet 132    0  287.3636   87.73723  278.000  226.500  336.500  71.000   514.000 0.266767 -0.16977
## protime  132    0   10.4159    0.88627   10.300    9.900   10.700   9.000    17.100 3.790505 24.98418
## --------------------------------------------------------------------------------------- 
## sex: m
## ascites: 1
## hepato: 0
## NULL
## --------------------------------------------------------------------------------------- 
## sex: f
## ascites: 1
## hepato: 0
##          n miss     mean         sd   median     p25     p75     min      max     skew      kurt
## time     5    0 1130.200 1382.63578  388.000  51.000 2081.00  41.000 3090.000  0.85580 -1.625552
## age      5    0   64.567   10.52400   65.884  60.706   70.56  48.977   76.709 -0.65743  0.388535
## bili     5    0    7.140    7.65134    2.500   1.400   12.60   1.300   17.900  0.85610 -1.797767
## chol     5    0  253.000   86.81014  206.000 200.000  302.00 175.000  382.000  0.97898 -0.682133
## albumin  5    0    2.854    0.53687    2.750   2.740    3.13   2.100    3.550 -0.19680  0.485519
## copper   5    0  112.400   72.72414  108.000  58.000  140.00  36.000  220.000  0.71474 -0.069888
## alk.phos 5    0 1257.600  416.41962 1516.000 918.000 1523.00 705.000 1626.000 -0.70377 -2.413395
## ast      5    0  170.830  118.75143  147.250  86.800  238.70  43.400  338.000  0.57441 -0.984893
## trig     5    1  138.500   67.34241  127.500 101.500  164.50  70.000  229.000  0.87597  1.020728
## platelet 5    0  192.800  116.54484  145.000 126.000  302.00  62.000  329.000  0.31155 -2.551503
## protime  5    0   12.020    1.16490   12.200  11.500   12.90  10.300   13.200 -0.76406 -0.285444
## --------------------------------------------------------------------------------------- 
## sex: m
## ascites: 0
## hepato: 1
##           n miss      mean         sd   median      p25       p75    min      max     skew      kurt
## time     18    0 1702.7778 1198.55185 1299.500  821.750 2088.5000 533.00 4191.000  1.14049  0.052903
## age      18    0   58.5952    9.18409   58.261   51.305   66.6057  44.52   74.524  0.21632 -1.194823
## bili     18    0    3.3667    2.60903    2.300    1.250    5.2000   0.60    8.600  0.77784 -0.760092
## chol     18    0  382.6111  194.31180  361.000  251.250  426.7500 178.00 1000.000  1.98438  5.357124
## albumin  18    0    3.5906    0.33574    3.710    3.385    3.8525   3.00    4.000 -0.60837 -0.901375
## copper   18    0  142.4444   82.93741  114.500   81.750  197.0000  25.00  290.000  0.47972 -1.048835
## alk.phos 18    0 1822.8889 1260.71921 1222.500 1028.750 2387.0000 681.00 5719.000  1.92275  4.468294
## ast      18    0  124.4906   49.03280  118.575   84.275  168.9500  57.35  221.880  0.48276 -0.872198
## trig     18    0  138.0000   49.33916  127.000   95.000  153.7500  83.00  242.000  1.00071  0.085859
## platelet 18    0  240.9444   86.30416  250.000  189.500  298.7500  70.00  360.000 -0.47422 -0.738498
## protime  18    0   10.8167    0.62521   10.900   10.350   11.2750   9.80   12.000 -0.24516 -0.675953
## --------------------------------------------------------------------------------------- 
## sex: f
## ascites: 0
## hepato: 1
##            n miss      mean         sd   median      p25     p75     min       max      skew     kurt
## time     123    0 1838.2846 1007.36324 1741.000 1083.500 2391.00  71.000  4523.000  0.708350  0.24326
## age      123    0   48.7093    9.71164   49.339   41.380   55.63  26.278    69.347 -0.060499 -0.68836
## bili     123    0    3.9715    4.83689    2.100    1.000    5.00   0.400    28.000  2.637238  8.21899
## chol     123   10  411.1416  298.66715  322.000  260.000  408.00 149.000  1775.000  3.088032  9.84264
## albumin  123    0    3.4339    0.38584    3.480    3.205    3.65   1.960     4.240 -0.624972  1.57126
## copper   123    0  104.1057   85.01165   76.000   50.000  125.50  11.000   588.000  2.471784  9.17827
## alk.phos 123    0 2259.9041 2445.15851 1428.000  958.000 2280.00 289.000 13862.400  2.680596  7.37586
## ast      123    0  130.4689   60.15503  120.900   90.450  158.88  26.350   457.250  1.758908  6.53695
## trig     123   11  127.4821   60.13543  108.500   89.500  149.75  33.000   322.000  1.399209  2.03784
## platelet 123    3  253.0583   97.99025  239.000  184.500  306.00  79.000   563.000  0.713091  0.71525
## protime  123    0   10.7862    0.96235   10.600   10.000   11.50   9.200    13.300  0.648440 -0.33995
## --------------------------------------------------------------------------------------- 
## sex: m
## ascites: 1
## hepato: 1
##          n miss      mean        sd   median     p25      p75     min      max      skew kurt
## time     3    0 1057.6667 799.00521 1217.000 704.000 1491.000 191.000 1765.000 -0.861681  NaN
## age      3    0   67.5227  11.11381   67.907  62.064   73.173  56.222   78.439 -0.155382  NaN
## bili     3    0    3.0667   3.50190    1.300   1.050    4.200   0.800    7.100  1.692412  NaN
## chol     3    1  197.0000  65.05382  197.000 174.000  220.000 151.000  243.000       NaN  NaN
## albumin  3    0    2.7933   0.45391    3.030   2.650    3.055   2.270    3.080 -1.708437  NaN
## copper   3    0  165.3333 186.51095   73.000  58.000  226.500  43.000  380.000  1.681773  NaN
## alk.phos 3    0  941.0000 195.41494  983.000 855.500 1047.500 728.000 1112.000 -0.922495  NaN
## ast      3    0   91.8667  58.65325   71.000  58.750  114.550  46.500  158.100  1.398308  NaN
## trig     3    1  101.5000  74.24621  101.500  75.250  127.750  49.000  154.000       NaN  NaN
## platelet 3    0  155.3333  58.00287  156.000 126.500  184.500  97.000  213.000 -0.051715  NaN
## protime  3    0   11.8000   1.21655   11.200  11.100   12.200  11.000   13.200  1.679536  NaN
## --------------------------------------------------------------------------------------- 
## sex: f
## ascites: 1
## hepato: 1
##           n miss      mean         sd   median      p25      p75     min      max     skew     kurt
## time     16    0  668.2500  805.63685  341.000  206.750  915.750  77.000 3222.000 2.389812  6.58466
## age      16    0   54.9174    8.90951   54.917   48.320   61.364  39.198   70.908 0.048155 -0.53000
## bili     16    0   10.9688    7.80425   10.600    4.000   17.250   1.200   24.500 0.177903 -1.43003
## chol     16    2  364.5000  247.72216  278.500  222.000  382.250 175.000 1092.000 2.299491  5.69894
## albumin  16    0    3.0162    0.45119    3.030    2.630    3.320   2.330    3.900 0.261500 -0.61381
## copper   16    1  184.1333  125.70650  182.000  130.500  215.000  16.000  558.000 1.797284  5.46664
## alk.phos 16    0 2522.4125 2043.38875 1775.500 1070.250 3708.050 559.000 6931.200 1.158243  0.10099
## ast      16    0  140.3644   43.21937  135.975  105.463  176.513  73.530  227.040 0.288487 -0.64845
## trig     16    2  193.7143  145.18870  161.500  118.000  188.000  68.000  598.000 2.184143  4.54837
## platelet 16    0  197.3750   94.70648  178.000  138.500  224.000  80.000  401.000 1.194066  0.96941
## protime  16    0   11.7875    1.09354   11.600   11.075   12.025  10.600   15.200 2.200526  6.14523
## 
## p-values
##            pNormal pNonNormal
## time     2.212e-09  3.079e-09
## age      4.535e-07  2.860e-05
## bili     3.761e-15  1.059e-13
## chol     2.101e-01  7.850e-02
## albumin  5.323e-15  8.993e-11
## copper   4.615e-10  4.233e-10
## alk.phos 1.087e-01  7.650e-02
## ast      3.181e-02  2.190e-02
## trig     6.931e-04  8.213e-03
## platelet 2.232e-04  1.645e-04
## protime  1.554e-08  2.096e-08
## print method by default
print(contTable)
##                       Stratified by sex:ascites:hepato
##                        m:0:0             f:0:0             m:1:0 f:1:0             m:0:1            
##   n                    15                132               0     5                 18               
##   time (mean (sd))     2412.33 (1422.19) 2375.19 (1020.62) -     1130.20 (1382.64) 1702.78 (1198.55)
##   age (mean (sd))        51.07 (12.11)     48.41 (10.22)   -       64.57 (10.52)     58.60 (9.18)   
##   bili (mean (sd))        2.24 (1.31)       1.61 (2.40)    -        7.14 (7.65)       3.37 (2.61)   
##   chol (mean (sd))      360.33 (164.98)   336.99 (158.86)  -      253.00 (86.81)    382.61 (194.31) 
##   albumin (mean (sd))     3.72 (0.44)       3.67 (0.34)    -        2.85 (0.54)       3.59 (0.34)   
##   copper (mean (sd))    166.27 (107.94)    65.56 (56.66)   -      112.40 (72.72)    142.44 (82.94)  
##   alk.phos (mean (sd)) 2839.41 (3424.63) 1634.45 (1732.65) -     1257.60 (416.42)  1822.89 (1260.72)
##   ast (mean (sd))       125.02 (43.62)    111.35 (52.10)   -      170.83 (118.75)   124.49 (49.03)  
##   trig (mean (sd))      132.20 (55.55)    110.70 (52.29)   -      138.50 (67.34)    138.00 (49.34)  
##   platelet (mean (sd))  246.57 (88.70)    287.36 (87.74)   -      192.80 (116.54)   240.94 (86.30)  
##   protime (mean (sd))    11.07 (1.19)      10.42 (0.89)    -       12.02 (1.16)      10.82 (0.63)   
##                       Stratified by sex:ascites:hepato
##                        f:0:1             m:1:1            f:1:1             p      test
##   n                    123               3                16                           
##   time (mean (sd))     1838.28 (1007.36) 1057.67 (799.01)  668.25 (805.64)  <0.001     
##   age (mean (sd))        48.71 (9.71)      67.52 (11.11)    54.92 (8.91)    <0.001     
##   bili (mean (sd))        3.97 (4.84)       3.07 (3.50)     10.97 (7.80)    <0.001     
##   chol (mean (sd))      411.14 (298.67)   197.00 (65.05)   364.50 (247.72)   0.210     
##   albumin (mean (sd))     3.43 (0.39)       2.79 (0.45)      3.02 (0.45)    <0.001     
##   copper (mean (sd))    104.11 (85.01)    165.33 (186.51)  184.13 (125.71)  <0.001     
##   alk.phos (mean (sd)) 2259.90 (2445.16)  941.00 (195.41) 2522.41 (2043.39)  0.109     
##   ast (mean (sd))       130.47 (60.16)     91.87 (58.65)   140.36 (43.22)    0.032     
##   trig (mean (sd))      127.48 (60.14)    101.50 (74.25)   193.71 (145.19)   0.001     
##   platelet (mean (sd))  253.06 (97.99)    155.33 (58.00)   197.38 (94.71)   <0.001     
##   protime (mean (sd))    10.79 (0.96)      11.80 (1.22)     11.79 (1.09)    <0.001
## Five digits
print(contTable, digits = 5)
##                       Stratified by sex:ascites:hepato
##                        m:0:0                   f:0:0                   m:1:0 f:1:0                  
##   n                    15                      132                     0     5                      
##   time (mean (sd))     2412.33333 (1422.19351) 2375.18939 (1020.61775) -     1130.20000 (1382.63578)
##   age (mean (sd))        51.06585 (12.11265)     48.40831 (10.22279)   -       64.56728 (10.52400)  
##   bili (mean (sd))        2.24000 (1.30920)       1.61212 (2.39898)    -        7.14000 (7.65134)   
##   chol (mean (sd))      360.33333 (164.98470)   336.99145 (158.86242)  -      253.00000 (86.81014)  
##   albumin (mean (sd))     3.72267 (0.43840)       3.67038 (0.33816)    -        2.85400 (0.53687)   
##   copper (mean (sd))    166.26667 (107.94209)    65.55725 (56.66177)   -      112.40000 (72.72414)  
##   alk.phos (mean (sd)) 2839.41333 (3424.62730) 1634.45152 (1732.64762) -     1257.60000 (416.41962) 
##   ast (mean (sd))       125.01533 (43.61679)    111.35045 (52.09675)   -      170.83000 (118.75143) 
##   trig (mean (sd))      132.20000 (55.54818)    110.70085 (52.29018)   -      138.50000 (67.34241)  
##   platelet (mean (sd))  246.57143 (88.70410)    287.36364 (87.73723)   -      192.80000 (116.54484) 
##   protime (mean (sd))    11.06667 (1.19383)      10.41591 (0.88627)    -       12.02000 (1.16490)   
##                       Stratified by sex:ascites:hepato
##                        m:0:1                   f:0:1                   m:1:1                 
##   n                    18                      123                     3                     
##   time (mean (sd))     1702.77778 (1198.55185) 1838.28455 (1007.36324) 1057.66667 (799.00521)
##   age (mean (sd))        58.59518 (9.18409)      48.70935 (9.71164)      67.52270 (11.11381) 
##   bili (mean (sd))        3.36667 (2.60903)       3.97154 (4.83689)       3.06667 (3.50190)  
##   chol (mean (sd))      382.61111 (194.31180)   411.14159 (298.66715)   197.00000 (65.05382) 
##   albumin (mean (sd))     3.59056 (0.33574)       3.43390 (0.38584)       2.79333 (0.45391)  
##   copper (mean (sd))    142.44444 (82.93741)    104.10569 (85.01165)    165.33333 (186.51095)
##   alk.phos (mean (sd)) 1822.88889 (1260.71921) 2259.90407 (2445.15851)  941.00000 (195.41494)
##   ast (mean (sd))       124.49056 (49.03280)    130.46894 (60.15503)     91.86667 (58.65325) 
##   trig (mean (sd))      138.00000 (49.33916)    127.48214 (60.13543)    101.50000 (74.24621) 
##   platelet (mean (sd))  240.94444 (86.30416)    253.05833 (97.99025)    155.33333 (58.00287) 
##   protime (mean (sd))    10.81667 (0.62521)      10.78618 (0.96235)      11.80000 (1.21655)  
##                       Stratified by sex:ascites:hepato
##                        f:1:1                   p      test
##   n                    16                                 
##   time (mean (sd))      668.25000 (805.63685)  <0.001     
##   age (mean (sd))        54.91735 (8.90951)    <0.001     
##   bili (mean (sd))       10.96875 (7.80425)    <0.001     
##   chol (mean (sd))      364.50000 (247.72216)   0.210     
##   albumin (mean (sd))     3.01625 (0.45119)    <0.001     
##   copper (mean (sd))    184.13333 (125.70650)  <0.001     
##   alk.phos (mean (sd)) 2522.41250 (2043.38875)  0.109     
##   ast (mean (sd))       140.36437 (43.21937)    0.032     
##   trig (mean (sd))      193.71429 (145.18870)   0.001     
##   platelet (mean (sd))  197.37500 (94.70648)   <0.001     
##   protime (mean (sd))    11.78750 (1.09354)    <0.001
## All nonnormal
print(contTable, nonnormal = TRUE)
##                          Stratified by sex:ascites:hepato
##                           m:0:0                      f:0:0                      m:1:0 f:1:0                    
##   n                       15                         132                        0     5                        
##   time (median [IQR])     2386.00 [1186.00, 3607.50] 2361.00 [1475.00, 3089.00] -      388.00 [51.00, 2081.00] 
##   age (median [IQR])        49.14 [44.23, 60.80]       47.98 [40.68, 56.10]     -       65.88 [60.71, 70.56]   
##   bili (median [IQR])        1.90 [1.55, 2.45]          0.90 [0.60, 1.42]       -        2.50 [1.40, 12.60]    
##   chol (median [IQR])      317.00 [250.50, 438.00]    296.00 [242.00, 390.00]   -      206.00 [200.00, 302.00] 
##   albumin (median [IQR])     3.83 [3.47, 3.96]          3.66 [3.44, 3.88]       -        2.75 [2.74, 3.13]     
##   copper (median [IQR])    158.00 [98.00, 213.50]      52.00 [32.00, 78.50]     -      108.00 [58.00, 140.00]  
##   alk.phos (median [IQR]) 1056.00 [740.00, 3470.70]  1177.50 [793.25, 1689.75]  -     1516.00 [918.00, 1523.00]
##   ast (median [IQR])       127.00 [102.30, 141.05]     99.10 [73.36, 136.25]    -      147.25 [86.80, 238.70]  
##   trig (median [IQR])      118.00 [85.50, 183.00]     100.00 [74.00, 135.00]    -      127.50 [101.50, 164.50] 
##   platelet (median [IQR])  213.50 [180.75, 329.25]    278.00 [226.50, 336.50]   -      145.00 [126.00, 302.00] 
##   protime (median [IQR])    10.60 [10.25, 11.35]       10.30 [9.90, 10.70]      -       12.20 [11.50, 12.90]   
##                          Stratified by sex:ascites:hepato
##                           m:0:1                      f:0:1                      m:1:1                    
##   n                       18                         123                        3                        
##   time (median [IQR])     1299.50 [821.75, 2088.50]  1741.00 [1083.50, 2391.00] 1217.00 [704.00, 1491.00]
##   age (median [IQR])        58.26 [51.30, 66.61]       49.34 [41.38, 55.63]       67.91 [62.06, 73.17]   
##   bili (median [IQR])        2.30 [1.25, 5.20]          2.10 [1.00, 5.00]          1.30 [1.05, 4.20]     
##   chol (median [IQR])      361.00 [251.25, 426.75]    322.00 [260.00, 408.00]    197.00 [174.00, 220.00] 
##   albumin (median [IQR])     3.71 [3.38, 3.85]          3.48 [3.21, 3.65]          3.03 [2.65, 3.05]     
##   copper (median [IQR])    114.50 [81.75, 197.00]      76.00 [50.00, 125.50]      73.00 [58.00, 226.50]  
##   alk.phos (median [IQR]) 1222.50 [1028.75, 2387.00] 1428.00 [958.00, 2280.00]   983.00 [855.50, 1047.50]
##   ast (median [IQR])       118.58 [84.28, 168.95]     120.90 [90.45, 158.88]      71.00 [58.75, 114.55]  
##   trig (median [IQR])      127.00 [95.00, 153.75]     108.50 [89.50, 149.75]     101.50 [75.25, 127.75]  
##   platelet (median [IQR])  250.00 [189.50, 298.75]    239.00 [184.50, 306.00]    156.00 [126.50, 184.50] 
##   protime (median [IQR])    10.90 [10.35, 11.28]       10.60 [10.00, 11.50]       11.20 [11.10, 12.20]   
##                          Stratified by sex:ascites:hepato
##                           f:1:1                      p      test   
##   n                       16                                       
##   time (median [IQR])      341.00 [206.75, 915.75]   <0.001 nonnorm
##   age (median [IQR])        54.92 [48.32, 61.36]     <0.001 nonnorm
##   bili (median [IQR])       10.60 [4.00, 17.25]      <0.001 nonnorm
##   chol (median [IQR])      278.50 [222.00, 382.25]    0.079 nonnorm
##   albumin (median [IQR])     3.03 [2.63, 3.32]       <0.001 nonnorm
##   copper (median [IQR])    182.00 [130.50, 215.00]   <0.001 nonnorm
##   alk.phos (median [IQR]) 1775.50 [1070.25, 3708.05]  0.077 nonnorm
##   ast (median [IQR])       135.97 [105.46, 176.51]    0.022 nonnorm
##   trig (median [IQR])      161.50 [118.00, 188.00]    0.008 nonnorm
##   platelet (median [IQR])  178.00 [138.50, 224.00]   <0.001 nonnorm
##   protime (median [IQR])    11.60 [11.07, 12.03]     <0.001 nonnorm
## quote
print(contTable, quote = TRUE)
##                         "Stratified by sex:ascites:hepato"
##  ""                      "m:0:0"             "f:0:0"             "m:1:0" "f:1:0"             "m:0:1"            
##   "n"                    "15"                "132"               "0"     "5"                 "18"               
##   "time (mean (sd))"     "2412.33 (1422.19)" "2375.19 (1020.62)" "-"     "1130.20 (1382.64)" "1702.78 (1198.55)"
##   "age (mean (sd))"      "  51.07 (12.11)"   "  48.41 (10.22)"   "-"     "  64.57 (10.52)"   "  58.60 (9.18)"   
##   "bili (mean (sd))"     "   2.24 (1.31)"    "   1.61 (2.40)"    "-"     "   7.14 (7.65)"    "   3.37 (2.61)"   
##   "chol (mean (sd))"     " 360.33 (164.98)"  " 336.99 (158.86)"  "-"     " 253.00 (86.81)"   " 382.61 (194.31)" 
##   "albumin (mean (sd))"  "   3.72 (0.44)"    "   3.67 (0.34)"    "-"     "   2.85 (0.54)"    "   3.59 (0.34)"   
##   "copper (mean (sd))"   " 166.27 (107.94)"  "  65.56 (56.66)"   "-"     " 112.40 (72.72)"   " 142.44 (82.94)"  
##   "alk.phos (mean (sd))" "2839.41 (3424.63)" "1634.45 (1732.65)" "-"     "1257.60 (416.42)"  "1822.89 (1260.72)"
##   "ast (mean (sd))"      " 125.02 (43.62)"   " 111.35 (52.10)"   "-"     " 170.83 (118.75)"  " 124.49 (49.03)"  
##   "trig (mean (sd))"     " 132.20 (55.55)"   " 110.70 (52.29)"   "-"     " 138.50 (67.34)"   " 138.00 (49.34)"  
##   "platelet (mean (sd))" " 246.57 (88.70)"   " 287.36 (87.74)"   "-"     " 192.80 (116.54)"  " 240.94 (86.30)"  
##   "protime (mean (sd))"  "  11.07 (1.19)"    "  10.42 (0.89)"    "-"     "  12.02 (1.16)"    "  10.82 (0.63)"   
##                         "Stratified by sex:ascites:hepato"
##  ""                      "f:0:1"             "m:1:1"            "f:1:1"             "p"      "test"
##   "n"                    "123"               "3"                "16"                ""       ""    
##   "time (mean (sd))"     "1838.28 (1007.36)" "1057.67 (799.01)" " 668.25 (805.64)"  "<0.001" ""    
##   "age (mean (sd))"      "  48.71 (9.71)"    "  67.52 (11.11)"  "  54.92 (8.91)"    "<0.001" ""    
##   "bili (mean (sd))"     "   3.97 (4.84)"    "   3.07 (3.50)"   "  10.97 (7.80)"    "<0.001" ""    
##   "chol (mean (sd))"     " 411.14 (298.67)"  " 197.00 (65.05)"  " 364.50 (247.72)"  " 0.210" ""    
##   "albumin (mean (sd))"  "   3.43 (0.39)"    "   2.79 (0.45)"   "   3.02 (0.45)"    "<0.001" ""    
##   "copper (mean (sd))"   " 104.11 (85.01)"   " 165.33 (186.51)" " 184.13 (125.71)"  "<0.001" ""    
##   "alk.phos (mean (sd))" "2259.90 (2445.16)" " 941.00 (195.41)" "2522.41 (2043.39)" " 0.109" ""    
##   "ast (mean (sd))"      " 130.47 (60.16)"   "  91.87 (58.65)"  " 140.36 (43.22)"   " 0.032" ""    
##   "trig (mean (sd))"     " 127.48 (60.14)"   " 101.50 (74.25)"  " 193.71 (145.19)"  " 0.001" ""    
##   "platelet (mean (sd))" " 253.06 (97.99)"   " 155.33 (58.00)"  " 197.38 (94.71)"   "<0.001" ""    
##   "protime (mean (sd))"  "  10.79 (0.96)"    "  11.80 (1.22)"   "  11.79 (1.09)"    "<0.001" ""
## Partially nonnormal
print(contTable, nonnormal = nonNormalVars)
##                          Stratified by sex:ascites:hepato
##                           m:0:0                     f:0:0                     m:1:0 f:1:0                    
##   n                       15                        132                       0     5                        
##   time (mean (sd))        2412.33 (1422.19)         2375.19 (1020.62)         -     1130.20 (1382.64)        
##   age (mean (sd))           51.07 (12.11)             48.41 (10.22)           -       64.57 (10.52)          
##   bili (median [IQR])        1.90 [1.55, 2.45]         0.90 [0.60, 1.42]      -        2.50 [1.40, 12.60]    
##   chol (median [IQR])      317.00 [250.50, 438.00]   296.00 [242.00, 390.00]  -      206.00 [200.00, 302.00] 
##   albumin (mean (sd))        3.72 (0.44)               3.67 (0.34)            -        2.85 (0.54)           
##   copper (median [IQR])    158.00 [98.00, 213.50]     52.00 [32.00, 78.50]    -      108.00 [58.00, 140.00]  
##   alk.phos (median [IQR]) 1056.00 [740.00, 3470.70] 1177.50 [793.25, 1689.75] -     1516.00 [918.00, 1523.00]
##   ast (mean (sd))          125.02 (43.62)            111.35 (52.10)           -      170.83 (118.75)         
##   trig (median [IQR])      118.00 [85.50, 183.00]    100.00 [74.00, 135.00]   -      127.50 [101.50, 164.50] 
##   platelet (mean (sd))     246.57 (88.70)            287.36 (87.74)           -      192.80 (116.54)         
##   protime (median [IQR])    10.60 [10.25, 11.35]      10.30 [9.90, 10.70]     -       12.20 [11.50, 12.90]   
##                          Stratified by sex:ascites:hepato
##                           m:0:1                      f:0:1                     m:1:1                    
##   n                       18                         123                       3                        
##   time (mean (sd))        1702.78 (1198.55)          1838.28 (1007.36)         1057.67 (799.01)         
##   age (mean (sd))           58.60 (9.18)               48.71 (9.71)              67.52 (11.11)          
##   bili (median [IQR])        2.30 [1.25, 5.20]          2.10 [1.00, 5.00]         1.30 [1.05, 4.20]     
##   chol (median [IQR])      361.00 [251.25, 426.75]    322.00 [260.00, 408.00]   197.00 [174.00, 220.00] 
##   albumin (mean (sd))        3.59 (0.34)                3.43 (0.39)               2.79 (0.45)           
##   copper (median [IQR])    114.50 [81.75, 197.00]      76.00 [50.00, 125.50]     73.00 [58.00, 226.50]  
##   alk.phos (median [IQR]) 1222.50 [1028.75, 2387.00] 1428.00 [958.00, 2280.00]  983.00 [855.50, 1047.50]
##   ast (mean (sd))          124.49 (49.03)             130.47 (60.16)             91.87 (58.65)          
##   trig (median [IQR])      127.00 [95.00, 153.75]     108.50 [89.50, 149.75]    101.50 [75.25, 127.75]  
##   platelet (mean (sd))     240.94 (86.30)             253.06 (97.99)            155.33 (58.00)          
##   protime (median [IQR])    10.90 [10.35, 11.28]       10.60 [10.00, 11.50]      11.20 [11.10, 12.20]   
##                          Stratified by sex:ascites:hepato
##                           f:1:1                      p      test   
##   n                       16                                       
##   time (mean (sd))         668.25 (805.64)           <0.001        
##   age (mean (sd))           54.92 (8.91)             <0.001        
##   bili (median [IQR])       10.60 [4.00, 17.25]      <0.001 nonnorm
##   chol (median [IQR])      278.50 [222.00, 382.25]    0.079 nonnorm
##   albumin (mean (sd))        3.02 (0.45)             <0.001        
##   copper (median [IQR])    182.00 [130.50, 215.00]   <0.001 nonnorm
##   alk.phos (median [IQR]) 1775.50 [1070.25, 3708.05]  0.077 nonnorm
##   ast (mean (sd))          140.36 (43.22)             0.032        
##   trig (median [IQR])      161.50 [118.00, 188.00]    0.008 nonnorm
##   platelet (mean (sd))     197.38 (94.71)            <0.001        
##   protime (median [IQR])    11.60 [11.07, 12.03]     <0.001 nonnorm
## Partially nonnormal median [range]
print(contTable, nonnormal = nonNormalVars, minMax = TRUE)
##                            Stratified by sex:ascites:hepato
##                             m:0:0                      f:0:0                      m:1:0 f:1:0                    
##   n                         15                         132                        0     5                        
##   time (mean (sd))          2412.33 (1422.19)          2375.19 (1020.62)          -     1130.20 (1382.64)        
##   age (mean (sd))             51.07 (12.11)              48.41 (10.22)            -       64.57 (10.52)          
##   bili (median [range])        1.90 [0.60, 6.00]          0.90 [0.30, 22.50]      -        2.50 [1.30, 17.90]    
##   chol (median [range])      317.00 [168.00, 660.00]    296.00 [120.00, 1276.00]  -      206.00 [175.00, 382.00] 
##   albumin (mean (sd))          3.72 (0.44)                3.67 (0.34)             -        2.85 (0.54)           
##   copper (median [range])    158.00 [13.00, 444.00]      52.00 [4.00, 464.00]     -      108.00 [36.00, 220.00]  
##   alk.phos (median [range]) 1056.00 [516.00, 10396.80] 1177.50 [369.00, 12258.80] -     1516.00 [705.00, 1626.00]
##   ast (mean (sd))            125.02 (43.62)             111.35 (52.10)            -      170.83 (118.75)         
##   trig (median [range])      118.00 [55.00, 219.00]     100.00 [44.00, 382.00]    -      127.50 [70.00, 229.00]  
##   platelet (mean (sd))       246.57 (88.70)             287.36 (87.74)            -      192.80 (116.54)         
##   protime (median [range])    10.60 [9.70, 14.10]        10.30 [9.00, 17.10]      -       12.20 [10.30, 13.20]   
##                            Stratified by sex:ascites:hepato
##                             m:0:1                     f:0:1                      m:1:1                    
##   n                         18                        123                        3                        
##   time (mean (sd))          1702.78 (1198.55)         1838.28 (1007.36)          1057.67 (799.01)         
##   age (mean (sd))             58.60 (9.18)              48.71 (9.71)               67.52 (11.11)          
##   bili (median [range])        2.30 [0.60, 8.60]         2.10 [0.40, 28.00]         1.30 [0.80, 7.10]     
##   chol (median [range])      361.00 [178.00, 1000.00]  322.00 [149.00, 1775.00]   197.00 [151.00, 243.00] 
##   albumin (mean (sd))          3.59 (0.34)               3.43 (0.39)                2.79 (0.45)           
##   copper (median [range])    114.50 [25.00, 290.00]     76.00 [11.00, 588.00]      73.00 [43.00, 380.00]  
##   alk.phos (median [range]) 1222.50 [681.00, 5719.00] 1428.00 [289.00, 13862.40]  983.00 [728.00, 1112.00]
##   ast (mean (sd))            124.49 (49.03)            130.47 (60.16)              91.87 (58.65)          
##   trig (median [range])      127.00 [83.00, 242.00]    108.50 [33.00, 322.00]     101.50 [49.00, 154.00]  
##   platelet (mean (sd))       240.94 (86.30)            253.06 (97.99)             155.33 (58.00)          
##   protime (median [range])    10.90 [9.80, 12.00]       10.60 [9.20, 13.30]        11.20 [11.00, 13.20]   
##                            Stratified by sex:ascites:hepato
##                             f:1:1                     p      test   
##   n                         16                                      
##   time (mean (sd))           668.25 (805.64)          <0.001        
##   age (mean (sd))             54.92 (8.91)            <0.001        
##   bili (median [range])       10.60 [1.20, 24.50]     <0.001 nonnorm
##   chol (median [range])      278.50 [175.00, 1092.00]  0.079 nonnorm
##   albumin (mean (sd))          3.02 (0.45)            <0.001        
##   copper (median [range])    182.00 [16.00, 558.00]   <0.001 nonnorm
##   alk.phos (median [range]) 1775.50 [559.00, 6931.20]  0.077 nonnorm
##   ast (mean (sd))            140.36 (43.22)            0.032        
##   trig (median [range])      161.50 [68.00, 598.00]    0.008 nonnorm
##   platelet (mean (sd))       197.38 (94.71)           <0.001        
##   protime (median [range])    11.60 [10.60, 15.20]    <0.001 nonnorm
## test
print(contTable, test = FALSE)
##                       Stratified by sex:ascites:hepato
##                        m:0:0             f:0:0             m:1:0 f:1:0             m:0:1            
##   n                    15                132               0     5                 18               
##   time (mean (sd))     2412.33 (1422.19) 2375.19 (1020.62) -     1130.20 (1382.64) 1702.78 (1198.55)
##   age (mean (sd))        51.07 (12.11)     48.41 (10.22)   -       64.57 (10.52)     58.60 (9.18)   
##   bili (mean (sd))        2.24 (1.31)       1.61 (2.40)    -        7.14 (7.65)       3.37 (2.61)   
##   chol (mean (sd))      360.33 (164.98)   336.99 (158.86)  -      253.00 (86.81)    382.61 (194.31) 
##   albumin (mean (sd))     3.72 (0.44)       3.67 (0.34)    -        2.85 (0.54)       3.59 (0.34)   
##   copper (mean (sd))    166.27 (107.94)    65.56 (56.66)   -      112.40 (72.72)    142.44 (82.94)  
##   alk.phos (mean (sd)) 2839.41 (3424.63) 1634.45 (1732.65) -     1257.60 (416.42)  1822.89 (1260.72)
##   ast (mean (sd))       125.02 (43.62)    111.35 (52.10)   -      170.83 (118.75)   124.49 (49.03)  
##   trig (mean (sd))      132.20 (55.55)    110.70 (52.29)   -      138.50 (67.34)    138.00 (49.34)  
##   platelet (mean (sd))  246.57 (88.70)    287.36 (87.74)   -      192.80 (116.54)   240.94 (86.30)  
##   protime (mean (sd))    11.07 (1.19)      10.42 (0.89)    -       12.02 (1.16)      10.82 (0.63)   
##                       Stratified by sex:ascites:hepato
##                        f:0:1             m:1:1            f:1:1            
##   n                    123               3                16               
##   time (mean (sd))     1838.28 (1007.36) 1057.67 (799.01)  668.25 (805.64) 
##   age (mean (sd))        48.71 (9.71)      67.52 (11.11)    54.92 (8.91)   
##   bili (mean (sd))        3.97 (4.84)       3.07 (3.50)     10.97 (7.80)   
##   chol (mean (sd))      411.14 (298.67)   197.00 (65.05)   364.50 (247.72) 
##   albumin (mean (sd))     3.43 (0.39)       2.79 (0.45)      3.02 (0.45)   
##   copper (mean (sd))    104.11 (85.01)    165.33 (186.51)  184.13 (125.71) 
##   alk.phos (mean (sd)) 2259.90 (2445.16)  941.00 (195.41) 2522.41 (2043.39)
##   ast (mean (sd))       130.47 (60.16)     91.87 (58.65)   140.36 (43.22)  
##   trig (mean (sd))      127.48 (60.14)    101.50 (74.25)   193.71 (145.19) 
##   platelet (mean (sd))  253.06 (97.99)    155.33 (58.00)   197.38 (94.71)  
##   protime (mean (sd))    10.79 (0.96)      11.80 (1.22)     11.79 (1.09)
## pDigits
print(contTable, pDigits = 5)
##                       Stratified by sex:ascites:hepato
##                        m:0:0             f:0:0             m:1:0 f:1:0             m:0:1            
##   n                    15                132               0     5                 18               
##   time (mean (sd))     2412.33 (1422.19) 2375.19 (1020.62) -     1130.20 (1382.64) 1702.78 (1198.55)
##   age (mean (sd))        51.07 (12.11)     48.41 (10.22)   -       64.57 (10.52)     58.60 (9.18)   
##   bili (mean (sd))        2.24 (1.31)       1.61 (2.40)    -        7.14 (7.65)       3.37 (2.61)   
##   chol (mean (sd))      360.33 (164.98)   336.99 (158.86)  -      253.00 (86.81)    382.61 (194.31) 
##   albumin (mean (sd))     3.72 (0.44)       3.67 (0.34)    -        2.85 (0.54)       3.59 (0.34)   
##   copper (mean (sd))    166.27 (107.94)    65.56 (56.66)   -      112.40 (72.72)    142.44 (82.94)  
##   alk.phos (mean (sd)) 2839.41 (3424.63) 1634.45 (1732.65) -     1257.60 (416.42)  1822.89 (1260.72)
##   ast (mean (sd))       125.02 (43.62)    111.35 (52.10)   -      170.83 (118.75)   124.49 (49.03)  
##   trig (mean (sd))      132.20 (55.55)    110.70 (52.29)   -      138.50 (67.34)    138.00 (49.34)  
##   platelet (mean (sd))  246.57 (88.70)    287.36 (87.74)   -      192.80 (116.54)   240.94 (86.30)  
##   protime (mean (sd))    11.07 (1.19)      10.42 (0.89)    -       12.02 (1.16)      10.82 (0.63)   
##                       Stratified by sex:ascites:hepato
##                        f:0:1             m:1:1            f:1:1             p        test
##   n                    123               3                16                             
##   time (mean (sd))     1838.28 (1007.36) 1057.67 (799.01)  668.25 (805.64)  <0.00001     
##   age (mean (sd))        48.71 (9.71)      67.52 (11.11)    54.92 (8.91)    <0.00001     
##   bili (mean (sd))        3.97 (4.84)       3.07 (3.50)     10.97 (7.80)    <0.00001     
##   chol (mean (sd))      411.14 (298.67)   197.00 (65.05)   364.50 (247.72)   0.21011     
##   albumin (mean (sd))     3.43 (0.39)       2.79 (0.45)      3.02 (0.45)    <0.00001     
##   copper (mean (sd))    104.11 (85.01)    165.33 (186.51)  184.13 (125.71)  <0.00001     
##   alk.phos (mean (sd)) 2259.90 (2445.16)  941.00 (195.41) 2522.41 (2043.39)  0.10866     
##   ast (mean (sd))       130.47 (60.16)     91.87 (58.65)   140.36 (43.22)    0.03181     
##   trig (mean (sd))      127.48 (60.14)    101.50 (74.25)   193.71 (145.19)   0.00069     
##   platelet (mean (sd))  253.06 (97.99)    155.33 (58.00)   197.38 (94.71)    0.00022     
##   protime (mean (sd))    10.79 (0.96)      11.80 (1.22)     11.79 (1.09)    <0.00001
## No explanation
print(contTable, explain = FALSE)
##           Stratified by sex:ascites:hepato
##            m:0:0             f:0:0             m:1:0 f:1:0             m:0:1             f:0:1            
##   n        15                132               0     5                 18                123              
##   time     2412.33 (1422.19) 2375.19 (1020.62) -     1130.20 (1382.64) 1702.78 (1198.55) 1838.28 (1007.36)
##   age        51.07 (12.11)     48.41 (10.22)   -       64.57 (10.52)     58.60 (9.18)      48.71 (9.71)   
##   bili        2.24 (1.31)       1.61 (2.40)    -        7.14 (7.65)       3.37 (2.61)       3.97 (4.84)   
##   chol      360.33 (164.98)   336.99 (158.86)  -      253.00 (86.81)    382.61 (194.31)   411.14 (298.67) 
##   albumin     3.72 (0.44)       3.67 (0.34)    -        2.85 (0.54)       3.59 (0.34)       3.43 (0.39)   
##   copper    166.27 (107.94)    65.56 (56.66)   -      112.40 (72.72)    142.44 (82.94)    104.11 (85.01)  
##   alk.phos 2839.41 (3424.63) 1634.45 (1732.65) -     1257.60 (416.42)  1822.89 (1260.72) 2259.90 (2445.16)
##   ast       125.02 (43.62)    111.35 (52.10)   -      170.83 (118.75)   124.49 (49.03)    130.47 (60.16)  
##   trig      132.20 (55.55)    110.70 (52.29)   -      138.50 (67.34)    138.00 (49.34)    127.48 (60.14)  
##   platelet  246.57 (88.70)    287.36 (87.74)   -      192.80 (116.54)   240.94 (86.30)    253.06 (97.99)  
##   protime    11.07 (1.19)      10.42 (0.89)    -       12.02 (1.16)      10.82 (0.63)      10.79 (0.96)   
##           Stratified by sex:ascites:hepato
##            m:1:1            f:1:1             p      test
##   n        3                16                           
##   time     1057.67 (799.01)  668.25 (805.64)  <0.001     
##   age        67.52 (11.11)    54.92 (8.91)    <0.001     
##   bili        3.07 (3.50)     10.97 (7.80)    <0.001     
##   chol      197.00 (65.05)   364.50 (247.72)   0.210     
##   albumin     2.79 (0.45)      3.02 (0.45)    <0.001     
##   copper    165.33 (186.51)  184.13 (125.71)  <0.001     
##   alk.phos  941.00 (195.41) 2522.41 (2043.39)  0.109     
##   ast        91.87 (58.65)   140.36 (43.22)    0.032     
##   trig      101.50 (74.25)   193.71 (145.19)   0.001     
##   platelet  155.33 (58.00)   197.38 (94.71)   <0.001     
##   protime    11.80 (1.22)     11.79 (1.09)    <0.001

Categorical variables

###  Define variables
vars <- c("trt","ascites","spiders","edema","stage")
## Strata
strata <- "status"
strataTwoVars <- c("status","sex")
strataThreeVars <- c("sex","ascites","hepato")
## Data and variables
dataFrame <- pbc
exactlVars <- c("ascites","edema")
## Create edema strata that are of sizes 1, 2, and 3
smallDataFrame <- pbc[c(2, 3,4, 1,10,14),]
smallStrata <- "edema"


### Behaviors on correct data format (non-stratified, single variable)
## Creation
catTable <- CreateCatTable(vars = "trt", data = dataFrame)
## print method
catTable
##              
##               Overall    
##   n           418        
##   trt = 2 (%) 154 (49.4)
## summary method
summary(catTable)
## strata: Overall
##  var   n miss level freq percent cum.percent
##  trt 418  106     1  158    50.6        50.6
##                   2  154    49.4       100.0
## 
## digits
summary(catTable, digits = 5)
## strata: Overall
##  var   n miss level freq  percent cum.percent
##  trt 418  106     1  158 50.64103    50.64103
##                   2  154 49.35897   100.00000
## 
## print method by default
print(catTable)
##              
##               Overall    
##   n           418        
##   trt = 2 (%) 154 (49.4)
## format
print(catTable, format = "fp")
##              
##               Overall    
##   n           418        
##   trt = 2 (%) 154 (49.4)
print(catTable, format = "f")
##          
##           Overall
##   n       418    
##   trt = 2 154
print(catTable, format = "p")
##              
##               Overall
##   n           418    
##   trt = 2 (%) 49.4
print(catTable, format = "pf")
##                   
##                    Overall    
##   n                418        
##   trt = 2 % (freq) 49.4 (154)
## digits
print(catTable, digits = 5)
##              
##               Overall        
##   n           418            
##   trt = 2 (%) 154 (49.35897)
## exact
print(catTable, exact = TRUE)
##              
##               Overall    
##   n           418        
##   trt = 2 (%) 154 (49.4)
## Partially exact
print(catTable, exact = exactlVars)
##              
##               Overall    
##   n           418        
##   trt = 2 (%) 154 (49.4)
## quote
print(catTable, quote = TRUE)
##                ""
##  ""             "Overall"    
##   "n"           "418"        
##   "trt = 2 (%)" "154 (49.4) "
## No test
print(catTable, test = TRUE)
##              
##               Overall    
##   n           418        
##   trt = 2 (%) 154 (49.4)
## pDigits
print(catTable, pDigits = 5)
##              
##               Overall    
##   n           418        
##   trt = 2 (%) 154 (49.4)
## showAllLevel
print(catTable, showAllLevels = TRUE)
##          
##           level Overall    
##   n             418        
##   trt (%) 1     158 (50.6) 
##           2     154 (49.4)
## explain
print(catTable, explain = FALSE)
##          
##           Overall    
##   n       418        
##   trt = 2 154 (49.4)
## CrossTable
print(catTable, CrossTable = TRUE)
##              
##               Overall    
##   n           418        
##   trt = 2 (%) 154 (49.4)
## print and return object
matObj <- print(catTable, printToggle = TRUE)
##              
##               Overall    
##   n           418        
##   trt = 2 (%) 154 (49.4)
matObj
##              
##               Overall      
##   n           "418"        
##   trt = 2 (%) "154 (49.4) "
## attr(,"vecColWidths")
## Overall 
##       3
## do not print and return as object
matObj <- print(catTable, printToggle = FALSE)
matObj
##              
##               Overall      
##   n           "418"        
##   trt = 2 (%) "154 (49.4) "
## attr(,"vecColWidths")
## Overall 
##       3


### Behaviors on correct data format (non-stratified)
## Creation
catTable <- CreateCatTable(vars = vars, data = dataFrame)
## print method
catTable
##                  
##                   Overall    
##   n               418        
##   trt = 2 (%)     154 (49.4) 
##   ascites = 1 (%)  24 ( 7.7) 
##   spiders = 1 (%)  90 (28.8) 
##   edema (%)                  
##      0            354 (84.7) 
##      0.5           44 (10.5) 
##      1             20 ( 4.8) 
##   stage (%)                  
##      1             21 ( 5.1) 
##      2             92 (22.3) 
##      3            155 (37.6) 
##      4            144 (35.0)
## summary method
summary(catTable)
## strata: Overall
##      var   n miss level freq percent cum.percent
##      trt 418  106     1  158    50.6        50.6
##                       2  154    49.4       100.0
##                                                 
##  ascites 418  106     0  288    92.3        92.3
##                       1   24     7.7       100.0
##                                                 
##  spiders 418  106     0  222    71.2        71.2
##                       1   90    28.8       100.0
##                                                 
##    edema 418    0     0  354    84.7        84.7
##                     0.5   44    10.5        95.2
##                       1   20     4.8       100.0
##                                                 
##    stage 418    6     1   21     5.1         5.1
##                       2   92    22.3        27.4
##                       3  155    37.6        65.0
##                       4  144    35.0       100.0
## 
## digits
summary(catTable, digits = 5)
## strata: Overall
##      var   n miss level freq  percent cum.percent
##      trt 418  106     1  158 50.64103    50.64103
##                       2  154 49.35897   100.00000
##                                                  
##  ascites 418  106     0  288 92.30769    92.30769
##                       1   24  7.69231   100.00000
##                                                  
##  spiders 418  106     0  222 71.15385    71.15385
##                       1   90 28.84615   100.00000
##                                                  
##    edema 418    0     0  354 84.68900    84.68900
##                     0.5   44 10.52632    95.21531
##                       1   20  4.78469   100.00000
##                                                  
##    stage 418    6     1   21  5.09709     5.09709
##                       2   92 22.33010    27.42718
##                       3  155 37.62136    65.04854
##                       4  144 34.95146   100.00000
## 
## print method by default
print(catTable)
##                  
##                   Overall    
##   n               418        
##   trt = 2 (%)     154 (49.4) 
##   ascites = 1 (%)  24 ( 7.7) 
##   spiders = 1 (%)  90 (28.8) 
##   edema (%)                  
##      0            354 (84.7) 
##      0.5           44 (10.5) 
##      1             20 ( 4.8) 
##   stage (%)                  
##      1             21 ( 5.1) 
##      2             92 (22.3) 
##      3            155 (37.6) 
##      4            144 (35.0)
## format
print(catTable, format = "fp")
##                  
##                   Overall    
##   n               418        
##   trt = 2 (%)     154 (49.4) 
##   ascites = 1 (%)  24 ( 7.7) 
##   spiders = 1 (%)  90 (28.8) 
##   edema (%)                  
##      0            354 (84.7) 
##      0.5           44 (10.5) 
##      1             20 ( 4.8) 
##   stage (%)                  
##      1             21 ( 5.1) 
##      2             92 (22.3) 
##      3            155 (37.6) 
##      4            144 (35.0)
print(catTable, format = "f")
##              
##               Overall
##   n           418    
##   trt = 2     154    
##   ascites = 1  24    
##   spiders = 1  90    
##   edema              
##      0        354    
##      0.5       44    
##      1         20    
##   stage              
##      1         21    
##      2         92    
##      3        155    
##      4        144
print(catTable, format = "p")
##                  
##                   Overall
##   n               418    
##   trt = 2 (%)     49.4   
##   ascites = 1 (%)  7.7   
##   spiders = 1 (%) 28.8   
##   edema (%)              
##      0            84.7   
##      0.5          10.5   
##      1             4.8   
##   stage (%)              
##      1             5.1   
##      2            22.3   
##      3            37.6   
##      4            35.0
print(catTable, format = "pf")
##                       
##                        Overall    
##   n                    418        
##   trt = 2 % (freq)     49.4 (154) 
##   ascites = 1 % (freq)  7.7 ( 24) 
##   spiders = 1 % (freq) 28.8 ( 90) 
##   edema % (freq)                  
##      0                 84.7 (354) 
##      0.5               10.5 ( 44) 
##      1                  4.8 ( 20) 
##   stage % (freq)                  
##      1                  5.1 ( 21) 
##      2                 22.3 ( 92) 
##      3                 37.6 (155) 
##      4                 35.0 (144)
## digits
print(catTable, digits = 5)
##                  
##                   Overall        
##   n               418            
##   trt = 2 (%)     154 (49.35897) 
##   ascites = 1 (%)  24 ( 7.69231) 
##   spiders = 1 (%)  90 (28.84615) 
##   edema (%)                      
##      0            354 (84.68900) 
##      0.5           44 (10.52632) 
##      1             20 ( 4.78469) 
##   stage (%)                      
##      1             21 ( 5.09709) 
##      2             92 (22.33010) 
##      3            155 (37.62136) 
##      4            144 (34.95146)
## exact
print(catTable, exact = TRUE)
##                  
##                   Overall    
##   n               418        
##   trt = 2 (%)     154 (49.4) 
##   ascites = 1 (%)  24 ( 7.7) 
##   spiders = 1 (%)  90 (28.8) 
##   edema (%)                  
##      0            354 (84.7) 
##      0.5           44 (10.5) 
##      1             20 ( 4.8) 
##   stage (%)                  
##      1             21 ( 5.1) 
##      2             92 (22.3) 
##      3            155 (37.6) 
##      4            144 (35.0)
## Partially exact
print(catTable, exact = exactlVars)
##                  
##                   Overall    
##   n               418        
##   trt = 2 (%)     154 (49.4) 
##   ascites = 1 (%)  24 ( 7.7) 
##   spiders = 1 (%)  90 (28.8) 
##   edema (%)                  
##      0            354 (84.7) 
##      0.5           44 (10.5) 
##      1             20 ( 4.8) 
##   stage (%)                  
##      1             21 ( 5.1) 
##      2             92 (22.3) 
##      3            155 (37.6) 
##      4            144 (35.0)
## quote
print(catTable, quote = TRUE)
##                    ""
##  ""                 "Overall"    
##   "n"               "418"        
##   "trt = 2 (%)"     "154 (49.4) "
##   "ascites = 1 (%)" " 24 ( 7.7) "
##   "spiders = 1 (%)" " 90 (28.8) "
##   "edema (%)"       ""           
##   "   0"            "354 (84.7) "
##   "   0.5"          " 44 (10.5) "
##   "   1"            " 20 ( 4.8) "
##   "stage (%)"       ""           
##   "   1"            " 21 ( 5.1) "
##   "   2"            " 92 (22.3) "
##   "   3"            "155 (37.6) "
##   "   4"            "144 (35.0) "
## No test
print(catTable, test = TRUE)
##                  
##                   Overall    
##   n               418        
##   trt = 2 (%)     154 (49.4) 
##   ascites = 1 (%)  24 ( 7.7) 
##   spiders = 1 (%)  90 (28.8) 
##   edema (%)                  
##      0            354 (84.7) 
##      0.5           44 (10.5) 
##      1             20 ( 4.8) 
##   stage (%)                  
##      1             21 ( 5.1) 
##      2             92 (22.3) 
##      3            155 (37.6) 
##      4            144 (35.0)
## pDigits
print(catTable, pDigits = 5)
##                  
##                   Overall    
##   n               418        
##   trt = 2 (%)     154 (49.4) 
##   ascites = 1 (%)  24 ( 7.7) 
##   spiders = 1 (%)  90 (28.8) 
##   edema (%)                  
##      0            354 (84.7) 
##      0.5           44 (10.5) 
##      1             20 ( 4.8) 
##   stage (%)                  
##      1             21 ( 5.1) 
##      2             92 (22.3) 
##      3            155 (37.6) 
##      4            144 (35.0)
## showAllLevel
print(catTable, showAllLevels = TRUE)
##              
##               level Overall    
##   n                 418        
##   trt (%)     1     158 (50.6) 
##               2     154 (49.4) 
##   ascites (%) 0     288 (92.3) 
##               1      24 ( 7.7) 
##   spiders (%) 0     222 (71.2) 
##               1      90 (28.8) 
##   edema (%)   0     354 (84.7) 
##               0.5    44 (10.5) 
##               1      20 ( 4.8) 
##   stage (%)   1      21 ( 5.1) 
##               2      92 (22.3) 
##               3     155 (37.6) 
##               4     144 (35.0)
## explain
print(catTable, explain = FALSE)
##              
##               Overall    
##   n           418        
##   trt = 2     154 (49.4) 
##   ascites = 1  24 ( 7.7) 
##   spiders = 1  90 (28.8) 
##   edema                  
##      0        354 (84.7) 
##      0.5       44 (10.5) 
##      1         20 ( 4.8) 
##   stage                  
##      1         21 ( 5.1) 
##      2         92 (22.3) 
##      3        155 (37.6) 
##      4        144 (35.0)
## CrossTable
print(catTable, CrossTable = TRUE)
##                  
##                   Overall    
##   n               418        
##   trt = 2 (%)     154 (49.4) 
##   ascites = 1 (%)  24 ( 7.7) 
##   spiders = 1 (%)  90 (28.8) 
##   edema (%)                  
##      0            354 (84.7) 
##      0.5           44 (10.5) 
##      1             20 ( 4.8) 
##   stage (%)                  
##      1             21 ( 5.1) 
##      2             92 (22.3) 
##      3            155 (37.6) 
##      4            144 (35.0)


### Behaviors on correct data format (stratified, 2-group)
## Creation
catTable <- CreateCatTable(vars = vars, strata = "sex", data = dataFrame)
## print method
catTable
##                  Stratified by sex
##                   m          f           p      test
##   n               44         374                    
##   trt = 2 (%)     15 (41.7)  139 (50.4)   0.421     
##   ascites = 1 (%)  3 ( 8.3)   21 ( 7.6)   1.000     
##   spiders = 1 (%)  4 (11.1)   86 (31.2)   0.021     
##   edema (%)                               0.777     
##      0            36 (81.8)  318 (85.0)             
##      0.5           5 (11.4)   39 (10.4)             
##      1             3 ( 6.8)   17 ( 4.5)             
##   stage (%)                               0.831     
##      1             3 ( 6.8)   18 ( 4.9)             
##      2             8 (18.2)   84 (22.8)             
##      3            16 (36.4)  139 (37.8)             
##      4            17 (38.6)  127 (34.5)
## summary method
summary(catTable)
## sex: m
##      var  n miss level freq percent cum.percent
##      trt 44    8     1   21    58.3        58.3
##                      2   15    41.7       100.0
##                                                
##  ascites 44    8     0   33    91.7        91.7
##                      1    3     8.3       100.0
##                                                
##  spiders 44    8     0   32    88.9        88.9
##                      1    4    11.1       100.0
##                                                
##    edema 44    0     0   36    81.8        81.8
##                    0.5    5    11.4        93.2
##                      1    3     6.8       100.0
##                                                
##    stage 44    0     1    3     6.8         6.8
##                      2    8    18.2        25.0
##                      3   16    36.4        61.4
##                      4   17    38.6       100.0
##                                                
## --------------------------------------------------------------------------------------- 
## sex: f
##      var   n miss level freq percent cum.percent
##      trt 374   98     1  137    49.6        49.6
##                       2  139    50.4       100.0
##                                                 
##  ascites 374   98     0  255    92.4        92.4
##                       1   21     7.6       100.0
##                                                 
##  spiders 374   98     0  190    68.8        68.8
##                       1   86    31.2       100.0
##                                                 
##    edema 374    0     0  318    85.0        85.0
##                     0.5   39    10.4        95.5
##                       1   17     4.5       100.0
##                                                 
##    stage 374    6     1   18     4.9         4.9
##                       2   84    22.8        27.7
##                       3  139    37.8        65.5
##                       4  127    34.5       100.0
##                                                 
## 
## p-values
##         pApprox  pExact
## trt     0.42123 0.37743
## ascites 1.00000 0.74738
## spiders 0.02135 0.01094
## edema   0.77662 0.65149
## stage   0.83074 0.77658
## digits
summary(catTable, digits = 5)
## sex: m
##      var  n miss level freq  percent cum.percent
##      trt 44    8     1   21 58.33333    58.33333
##                      2   15 41.66667   100.00000
##                                                 
##  ascites 44    8     0   33 91.66667    91.66667
##                      1    3  8.33333   100.00000
##                                                 
##  spiders 44    8     0   32 88.88889    88.88889
##                      1    4 11.11111   100.00000
##                                                 
##    edema 44    0     0   36 81.81818    81.81818
##                    0.5    5 11.36364    93.18182
##                      1    3  6.81818   100.00000
##                                                 
##    stage 44    0     1    3  6.81818     6.81818
##                      2    8 18.18182    25.00000
##                      3   16 36.36364    61.36364
##                      4   17 38.63636   100.00000
##                                                 
## --------------------------------------------------------------------------------------- 
## sex: f
##      var   n miss level freq  percent cum.percent
##      trt 374   98     1  137 49.63768    49.63768
##                       2  139 50.36232   100.00000
##                                                  
##  ascites 374   98     0  255 92.39130    92.39130
##                       1   21  7.60870   100.00000
##                                                  
##  spiders 374   98     0  190 68.84058    68.84058
##                       1   86 31.15942   100.00000
##                                                  
##    edema 374    0     0  318 85.02674    85.02674
##                     0.5   39 10.42781    95.45455
##                       1   17  4.54545   100.00000
##                                                  
##    stage 374    6     1   18  4.89130     4.89130
##                       2   84 22.82609    27.71739
##                       3  139 37.77174    65.48913
##                       4  127 34.51087   100.00000
##                                                  
## 
## p-values
##         pApprox  pExact
## trt     0.42123 0.37743
## ascites 1.00000 0.74738
## spiders 0.02135 0.01094
## edema   0.77662 0.65149
## stage   0.83074 0.77658
## print method by default
print(catTable)
##                  Stratified by sex
##                   m          f           p      test
##   n               44         374                    
##   trt = 2 (%)     15 (41.7)  139 (50.4)   0.421     
##   ascites = 1 (%)  3 ( 8.3)   21 ( 7.6)   1.000     
##   spiders = 1 (%)  4 (11.1)   86 (31.2)   0.021     
##   edema (%)                               0.777     
##      0            36 (81.8)  318 (85.0)             
##      0.5           5 (11.4)   39 (10.4)             
##      1             3 ( 6.8)   17 ( 4.5)             
##   stage (%)                               0.831     
##      1             3 ( 6.8)   18 ( 4.9)             
##      2             8 (18.2)   84 (22.8)             
##      3            16 (36.4)  139 (37.8)             
##      4            17 (38.6)  127 (34.5)
## format
print(catTable, format = "fp")
##                  Stratified by sex
##                   m          f           p      test
##   n               44         374                    
##   trt = 2 (%)     15 (41.7)  139 (50.4)   0.421     
##   ascites = 1 (%)  3 ( 8.3)   21 ( 7.6)   1.000     
##   spiders = 1 (%)  4 (11.1)   86 (31.2)   0.021     
##   edema (%)                               0.777     
##      0            36 (81.8)  318 (85.0)             
##      0.5           5 (11.4)   39 (10.4)             
##      1             3 ( 6.8)   17 ( 4.5)             
##   stage (%)                               0.831     
##      1             3 ( 6.8)   18 ( 4.9)             
##      2             8 (18.2)   84 (22.8)             
##      3            16 (36.4)  139 (37.8)             
##      4            17 (38.6)  127 (34.5)
print(catTable, format = "f")
##              Stratified by sex
##               m  f   p      test
##   n           44 374            
##   trt = 2     15 139  0.421     
##   ascites = 1  3  21  1.000     
##   spiders = 1  4  86  0.021     
##   edema               0.777     
##      0        36 318            
##      0.5       5  39            
##      1         3  17            
##   stage               0.831     
##      1         3  18            
##      2         8  84            
##      3        16 139            
##      4        17 127
print(catTable, format = "p")
##                  Stratified by sex
##                   m    f    p      test
##   n               44   374             
##   trt = 2 (%)     41.7 50.4  0.421     
##   ascites = 1 (%)  8.3  7.6  1.000     
##   spiders = 1 (%) 11.1 31.2  0.021     
##   edema (%)                  0.777     
##      0            81.8 85.0            
##      0.5          11.4 10.4            
##      1             6.8  4.5            
##   stage (%)                  0.831     
##      1             6.8  4.9            
##      2            18.2 22.8            
##      3            36.4 37.8            
##      4            38.6 34.5
print(catTable, format = "pf")
##                       Stratified by sex
##                        m          f           p      test
##   n                    44         374                    
##   trt = 2 % (freq)     41.7 (15)  50.4 (139)   0.421     
##   ascites = 1 % (freq)  8.3 ( 3)   7.6 ( 21)   1.000     
##   spiders = 1 % (freq) 11.1 ( 4)  31.2 ( 86)   0.021     
##   edema % (freq)                               0.777     
##      0                 81.8 (36)  85.0 (318)             
##      0.5               11.4 ( 5)  10.4 ( 39)             
##      1                  6.8 ( 3)   4.5 ( 17)             
##   stage % (freq)                               0.831     
##      1                  6.8 ( 3)   4.9 ( 18)             
##      2                 18.2 ( 8)  22.8 ( 84)             
##      3                 36.4 (16)  37.8 (139)             
##      4                 38.6 (17)  34.5 (127)
## digits
print(catTable, digits = 5)
##                  Stratified by sex
##                   m              f               p      test
##   n               44             374                        
##   trt = 2 (%)     15 (41.66667)  139 (50.36232)   0.421     
##   ascites = 1 (%)  3 ( 8.33333)   21 ( 7.60870)   1.000     
##   spiders = 1 (%)  4 (11.11111)   86 (31.15942)   0.021     
##   edema (%)                                       0.777     
##      0            36 (81.81818)  318 (85.02674)             
##      0.5           5 (11.36364)   39 (10.42781)             
##      1             3 ( 6.81818)   17 ( 4.54545)             
##   stage (%)                                       0.831     
##      1             3 ( 6.81818)   18 ( 4.89130)             
##      2             8 (18.18182)   84 (22.82609)             
##      3            16 (36.36364)  139 (37.77174)             
##      4            17 (38.63636)  127 (34.51087)
## exact
print(catTable, exact = TRUE)
##                  Stratified by sex
##                   m          f           p      test 
##   n               44         374                     
##   trt = 2 (%)     15 (41.7)  139 (50.4)   0.377 exact
##   ascites = 1 (%)  3 ( 8.3)   21 ( 7.6)   0.747 exact
##   spiders = 1 (%)  4 (11.1)   86 (31.2)   0.011 exact
##   edema (%)                               0.651 exact
##      0            36 (81.8)  318 (85.0)              
##      0.5           5 (11.4)   39 (10.4)              
##      1             3 ( 6.8)   17 ( 4.5)              
##   stage (%)                               0.777 exact
##      1             3 ( 6.8)   18 ( 4.9)              
##      2             8 (18.2)   84 (22.8)              
##      3            16 (36.4)  139 (37.8)              
##      4            17 (38.6)  127 (34.5)
## Partially exact
print(catTable, exact = exactlVars)
##                  Stratified by sex
##                   m          f           p      test 
##   n               44         374                     
##   trt = 2 (%)     15 (41.7)  139 (50.4)   0.421      
##   ascites = 1 (%)  3 ( 8.3)   21 ( 7.6)   0.747 exact
##   spiders = 1 (%)  4 (11.1)   86 (31.2)   0.021      
##   edema (%)                               0.651 exact
##      0            36 (81.8)  318 (85.0)              
##      0.5           5 (11.4)   39 (10.4)              
##      1             3 ( 6.8)   17 ( 4.5)              
##   stage (%)                               0.831      
##      1             3 ( 6.8)   18 ( 4.9)              
##      2             8 (18.2)   84 (22.8)              
##      3            16 (36.4)  139 (37.8)              
##      4            17 (38.6)  127 (34.5)
## quote
print(catTable, quote = TRUE)
##                    "Stratified by sex"
##  ""                 "m"          "f"           "p"      "test"
##   "n"               "44"         "374"         ""       ""    
##   "trt = 2 (%)"     "15 (41.7) " "139 (50.4) " " 0.421" ""    
##   "ascites = 1 (%)" " 3 ( 8.3) " " 21 ( 7.6) " " 1.000" ""    
##   "spiders = 1 (%)" " 4 (11.1) " " 86 (31.2) " " 0.021" ""    
##   "edema (%)"       ""           ""            " 0.777" ""    
##   "   0"            "36 (81.8) " "318 (85.0) " ""       ""    
##   "   0.5"          " 5 (11.4) " " 39 (10.4) " ""       ""    
##   "   1"            " 3 ( 6.8) " " 17 ( 4.5) " ""       ""    
##   "stage (%)"       ""           ""            " 0.831" ""    
##   "   1"            " 3 ( 6.8) " " 18 ( 4.9) " ""       ""    
##   "   2"            " 8 (18.2) " " 84 (22.8) " ""       ""    
##   "   3"            "16 (36.4) " "139 (37.8) " ""       ""    
##   "   4"            "17 (38.6) " "127 (34.5) " ""       ""
## No test
print(catTable, test = TRUE)
##                  Stratified by sex
##                   m          f           p      test
##   n               44         374                    
##   trt = 2 (%)     15 (41.7)  139 (50.4)   0.421     
##   ascites = 1 (%)  3 ( 8.3)   21 ( 7.6)   1.000     
##   spiders = 1 (%)  4 (11.1)   86 (31.2)   0.021     
##   edema (%)                               0.777     
##      0            36 (81.8)  318 (85.0)             
##      0.5           5 (11.4)   39 (10.4)             
##      1             3 ( 6.8)   17 ( 4.5)             
##   stage (%)                               0.831     
##      1             3 ( 6.8)   18 ( 4.9)             
##      2             8 (18.2)   84 (22.8)             
##      3            16 (36.4)  139 (37.8)             
##      4            17 (38.6)  127 (34.5)
## pDigits
print(catTable, pDigits = 5)
##                  Stratified by sex
##                   m          f           p        test
##   n               44         374                      
##   trt = 2 (%)     15 (41.7)  139 (50.4)   0.42123     
##   ascites = 1 (%)  3 ( 8.3)   21 ( 7.6)   1.00000     
##   spiders = 1 (%)  4 (11.1)   86 (31.2)   0.02135     
##   edema (%)                               0.77662     
##      0            36 (81.8)  318 (85.0)               
##      0.5           5 (11.4)   39 (10.4)               
##      1             3 ( 6.8)   17 ( 4.5)               
##   stage (%)                               0.83074     
##      1             3 ( 6.8)   18 ( 4.9)               
##      2             8 (18.2)   84 (22.8)               
##      3            16 (36.4)  139 (37.8)               
##      4            17 (38.6)  127 (34.5)
## showAllLevel
print(catTable, showAllLevels = TRUE)
##              Stratified by sex
##               level m          f           p      test
##   n                 44         374                    
##   trt (%)     1     21 (58.3)  137 (49.6)   0.421     
##               2     15 (41.7)  139 (50.4)             
##   ascites (%) 0     33 (91.7)  255 (92.4)   1.000     
##               1      3 ( 8.3)   21 ( 7.6)             
##   spiders (%) 0     32 (88.9)  190 (68.8)   0.021     
##               1      4 (11.1)   86 (31.2)             
##   edema (%)   0     36 (81.8)  318 (85.0)   0.777     
##               0.5    5 (11.4)   39 (10.4)             
##               1      3 ( 6.8)   17 ( 4.5)             
##   stage (%)   1      3 ( 6.8)   18 ( 4.9)   0.831     
##               2      8 (18.2)   84 (22.8)             
##               3     16 (36.4)  139 (37.8)             
##               4     17 (38.6)  127 (34.5)
## explain
print(catTable, explain = FALSE)
##              Stratified by sex
##               m          f           p      test
##   n           44         374                    
##   trt = 2     15 (41.7)  139 (50.4)   0.421     
##   ascites = 1  3 ( 8.3)   21 ( 7.6)   1.000     
##   spiders = 1  4 (11.1)   86 (31.2)   0.021     
##   edema                               0.777     
##      0        36 (81.8)  318 (85.0)             
##      0.5       5 (11.4)   39 (10.4)             
##      1         3 ( 6.8)   17 ( 4.5)             
##   stage                               0.831     
##      1         3 ( 6.8)   18 ( 4.9)             
##      2         8 (18.2)   84 (22.8)             
##      3        16 (36.4)  139 (37.8)             
##      4        17 (38.6)  127 (34.5)
## CrossTable
print(catTable, CrossTable = TRUE)
##                  Stratified by sex
##                   m          f           p      test
##   n               44         374                    
##   trt = 2 (%)     15 (41.7)  139 (50.4)   0.421     
##   ascites = 1 (%)  3 ( 8.3)   21 ( 7.6)   1.000     
##   spiders = 1 (%)  4 (11.1)   86 (31.2)   0.021     
##   edema (%)                               0.777     
##      0            36 (81.8)  318 (85.0)             
##      0.5           5 (11.4)   39 (10.4)             
##      1             3 ( 6.8)   17 ( 4.5)             
##   stage (%)                               0.831     
##      1             3 ( 6.8)   18 ( 4.9)             
##      2             8 (18.2)   84 (22.8)             
##      3            16 (36.4)  139 (37.8)             
##      4            17 (38.6)  127 (34.5)             
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  312 
## 
##  
##              | sex 
##          trt |         m |         f | Row Total | 
## -------------|-----------|-----------|-----------|
##            1 |        21 |       137 |       158 | 
##              |     0.421 |     0.055 |           | 
##              |     0.133 |     0.867 |     0.506 | 
##              |     0.583 |     0.496 |           | 
##              |     0.067 |     0.439 |           | 
## -------------|-----------|-----------|-----------|
##            2 |        15 |       139 |       154 | 
##              |     0.432 |     0.056 |           | 
##              |     0.097 |     0.903 |     0.494 | 
##              |     0.417 |     0.504 |           | 
##              |     0.048 |     0.446 |           | 
## -------------|-----------|-----------|-----------|
## Column Total |        36 |       276 |       312 | 
##              |     0.115 |     0.885 |           | 
## -------------|-----------|-----------|-----------|
## 
##  
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  312 
## 
##  
##              | sex 
##      ascites |         m |         f | Row Total | 
## -------------|-----------|-----------|-----------|
##            0 |        33 |       255 |       288 | 
##              |     0.002 |     0.000 |           | 
##              |     0.115 |     0.885 |     0.923 | 
##              |     0.917 |     0.924 |           | 
##              |     0.106 |     0.817 |           | 
## -------------|-----------|-----------|-----------|
##            1 |         3 |        21 |        24 | 
##              |     0.019 |     0.003 |           | 
##              |     0.125 |     0.875 |     0.077 | 
##              |     0.083 |     0.076 |           | 
##              |     0.010 |     0.067 |           | 
## -------------|-----------|-----------|-----------|
## Column Total |        36 |       276 |       312 | 
##              |     0.115 |     0.885 |           | 
## -------------|-----------|-----------|-----------|
## 
##  
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  312 
## 
##  
##              | sex 
##      spiders |         m |         f | Row Total | 
## -------------|-----------|-----------|-----------|
##            0 |        32 |       190 |       222 | 
##              |     1.591 |     0.208 |           | 
##              |     0.144 |     0.856 |     0.712 | 
##              |     0.889 |     0.688 |           | 
##              |     0.103 |     0.609 |           | 
## -------------|-----------|-----------|-----------|
##            1 |         4 |        86 |        90 | 
##              |     3.925 |     0.512 |           | 
##              |     0.044 |     0.956 |     0.288 | 
##              |     0.111 |     0.312 |           | 
##              |     0.013 |     0.276 |           | 
## -------------|-----------|-----------|-----------|
## Column Total |        36 |       276 |       312 | 
##              |     0.115 |     0.885 |           | 
## -------------|-----------|-----------|-----------|
## 
##  
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  418 
## 
##  
##              | sex 
##        edema |         m |         f | Row Total | 
## -------------|-----------|-----------|-----------|
##            0 |        36 |       318 |       354 | 
##              |     0.043 |     0.005 |           | 
##              |     0.102 |     0.898 |     0.847 | 
##              |     0.818 |     0.850 |           | 
##              |     0.086 |     0.761 |           | 
## -------------|-----------|-----------|-----------|
##          0.5 |         5 |        39 |        44 | 
##              |     0.029 |     0.003 |           | 
##              |     0.114 |     0.886 |     0.105 | 
##              |     0.114 |     0.104 |           | 
##              |     0.012 |     0.093 |           | 
## -------------|-----------|-----------|-----------|
##            1 |         3 |        17 |        20 | 
##              |     0.380 |     0.045 |           | 
##              |     0.150 |     0.850 |     0.048 | 
##              |     0.068 |     0.045 |           | 
##              |     0.007 |     0.041 |           | 
## -------------|-----------|-----------|-----------|
## Column Total |        44 |       374 |       418 | 
##              |     0.105 |     0.895 |           | 
## -------------|-----------|-----------|-----------|
## 
##  
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  412 
## 
##  
##              | sex 
##        stage |         m |         f | Row Total | 
## -------------|-----------|-----------|-----------|
##            1 |         3 |        18 |        21 | 
##              |     0.256 |     0.031 |           | 
##              |     0.143 |     0.857 |     0.051 | 
##              |     0.068 |     0.049 |           | 
##              |     0.007 |     0.044 |           | 
## -------------|-----------|-----------|-----------|
##            2 |         8 |        84 |        92 | 
##              |     0.339 |     0.041 |           | 
##              |     0.087 |     0.913 |     0.223 | 
##              |     0.182 |     0.228 |           | 
##              |     0.019 |     0.204 |           | 
## -------------|-----------|-----------|-----------|
##            3 |        16 |       139 |       155 | 
##              |     0.019 |     0.002 |           | 
##              |     0.103 |     0.897 |     0.376 | 
##              |     0.364 |     0.378 |           | 
##              |     0.039 |     0.337 |           | 
## -------------|-----------|-----------|-----------|
##            4 |        17 |       127 |       144 | 
##              |     0.171 |     0.020 |           | 
##              |     0.118 |     0.882 |     0.350 | 
##              |     0.386 |     0.345 |           | 
##              |     0.041 |     0.308 |           | 
## -------------|-----------|-----------|-----------|
## Column Total |        44 |       368 |       412 | 
##              |     0.107 |     0.893 |           | 
## -------------|-----------|-----------|-----------|
## 
## 


### Behaviors on correct data format (stratified, 3-group)
## Creation
catTable <- CreateCatTable(vars = vars, strata = strata, data = dataFrame)
## print method
catTable
##                  Stratified by status
##                   0           1          2           p      test
##   n               232         25         161                    
##   trt = 2 (%)      85 (50.6)   9 (47.4)   60 (48.0)   0.894     
##   ascites = 1 (%)   1 ( 0.6)   0 ( 0.0)   23 (18.4)  <0.001     
##   spiders = 1 (%)  33 (19.6)   5 (26.3)   52 (41.6)  <0.001     
##   edema (%)                                          <0.001     
##      0            216 (93.1)  22 (88.0)  116 (72.0)             
##      0.5           15 ( 6.5)   3 (12.0)   26 (16.1)             
##      1              1 ( 0.4)   0 ( 0.0)   19 (11.8)             
##   stage (%)                                          <0.001     
##      1             19 ( 8.3)   0 ( 0.0)    2 ( 1.3)             
##      2             64 (27.8)   5 (20.0)   23 (14.6)             
##      3             97 (42.2)  10 (40.0)   48 (30.6)             
##      4             50 (21.7)  10 (40.0)   84 (53.5)
## summary method
summary(catTable)
## status: 0
##      var   n miss level freq percent cum.percent
##      trt 232   64     1   83    49.4        49.4
##                       2   85    50.6       100.0
##                                                 
##  ascites 232   64     0  167    99.4        99.4
##                       1    1     0.6       100.0
##                                                 
##  spiders 232   64     0  135    80.4        80.4
##                       1   33    19.6       100.0
##                                                 
##    edema 232    0     0  216    93.1        93.1
##                     0.5   15     6.5        99.6
##                       1    1     0.4       100.0
##                                                 
##    stage 232    2     1   19     8.3         8.3
##                       2   64    27.8        36.1
##                       3   97    42.2        78.3
##                       4   50    21.7       100.0
##                                                 
## --------------------------------------------------------------------------------------- 
## status: 1
##      var  n miss level freq percent cum.percent
##      trt 25    6     1   10    52.6        52.6
##                      2    9    47.4       100.0
##                                                
##  ascites 25    6     0   19   100.0       100.0
##                      1    0     0.0       100.0
##                                                
##  spiders 25    6     0   14    73.7        73.7
##                      1    5    26.3       100.0
##                                                
##    edema 25    0     0   22    88.0        88.0
##                    0.5    3    12.0       100.0
##                      1    0     0.0       100.0
##                                                
##    stage 25    0     1    0     0.0         0.0
##                      2    5    20.0        20.0
##                      3   10    40.0        60.0
##                      4   10    40.0       100.0
##                                                
## --------------------------------------------------------------------------------------- 
## status: 2
##      var   n miss level freq percent cum.percent
##      trt 161   36     1   65    52.0        52.0
##                       2   60    48.0       100.0
##                                                 
##  ascites 161   36     0  102    81.6        81.6
##                       1   23    18.4       100.0
##                                                 
##  spiders 161   36     0   73    58.4        58.4
##                       1   52    41.6       100.0
##                                                 
##    edema 161    0     0  116    72.0        72.0
##                     0.5   26    16.1        88.2
##                       1   19    11.8       100.0
##                                                 
##    stage 161    4     1    2     1.3         1.3
##                       2   23    14.6        15.9
##                       3   48    30.6        46.5
##                       4   84    53.5       100.0
##                                                 
## 
## p-values
##               pApprox        pExact
## trt     0.89350974940 0.88422188365
## ascites 0.00000004847 0.00000001915
## spiders 0.00021408606 0.00019418862
## edema   0.00000003438 0.00000001955
## stage   0.00000001118            NA
## digits
summary(catTable, digits = 5)
## status: 0
##      var   n miss level freq  percent cum.percent
##      trt 232   64     1   83 49.40476    49.40476
##                       2   85 50.59524   100.00000
##                                                  
##  ascites 232   64     0  167 99.40476    99.40476
##                       1    1  0.59524   100.00000
##                                                  
##  spiders 232   64     0  135 80.35714    80.35714
##                       1   33 19.64286   100.00000
##                                                  
##    edema 232    0     0  216 93.10345    93.10345
##                     0.5   15  6.46552    99.56897
##                       1    1  0.43103   100.00000
##                                                  
##    stage 232    2     1   19  8.26087     8.26087
##                       2   64 27.82609    36.08696
##                       3   97 42.17391    78.26087
##                       4   50 21.73913   100.00000
##                                                  
## --------------------------------------------------------------------------------------- 
## status: 1
##      var  n miss level freq   percent cum.percent
##      trt 25    6     1   10  52.63158    52.63158
##                      2    9  47.36842   100.00000
##                                                  
##  ascites 25    6     0   19 100.00000   100.00000
##                      1    0   0.00000   100.00000
##                                                  
##  spiders 25    6     0   14  73.68421    73.68421
##                      1    5  26.31579   100.00000
##                                                  
##    edema 25    0     0   22  88.00000    88.00000
##                    0.5    3  12.00000   100.00000
##                      1    0   0.00000   100.00000
##                                                  
##    stage 25    0     1    0   0.00000     0.00000
##                      2    5  20.00000    20.00000
##                      3   10  40.00000    60.00000
##                      4   10  40.00000   100.00000
##                                                  
## --------------------------------------------------------------------------------------- 
## status: 2
##      var   n miss level freq  percent cum.percent
##      trt 161   36     1   65 52.00000    52.00000
##                       2   60 48.00000   100.00000
##                                                  
##  ascites 161   36     0  102 81.60000    81.60000
##                       1   23 18.40000   100.00000
##                                                  
##  spiders 161   36     0   73 58.40000    58.40000
##                       1   52 41.60000   100.00000
##                                                  
##    edema 161    0     0  116 72.04969    72.04969
##                     0.5   26 16.14907    88.19876
##                       1   19 11.80124   100.00000
##                                                  
##    stage 161    4     1    2  1.27389     1.27389
##                       2   23 14.64968    15.92357
##                       3   48 30.57325    46.49682
##                       4   84 53.50318   100.00000
##                                                  
## 
## p-values
##               pApprox        pExact
## trt     0.89350974940 0.88422188365
## ascites 0.00000004847 0.00000001915
## spiders 0.00021408606 0.00019418862
## edema   0.00000003438 0.00000001955
## stage   0.00000001118            NA
## print method by default
print(catTable)
##                  Stratified by status
##                   0           1          2           p      test
##   n               232         25         161                    
##   trt = 2 (%)      85 (50.6)   9 (47.4)   60 (48.0)   0.894     
##   ascites = 1 (%)   1 ( 0.6)   0 ( 0.0)   23 (18.4)  <0.001     
##   spiders = 1 (%)  33 (19.6)   5 (26.3)   52 (41.6)  <0.001     
##   edema (%)                                          <0.001     
##      0            216 (93.1)  22 (88.0)  116 (72.0)             
##      0.5           15 ( 6.5)   3 (12.0)   26 (16.1)             
##      1              1 ( 0.4)   0 ( 0.0)   19 (11.8)             
##   stage (%)                                          <0.001     
##      1             19 ( 8.3)   0 ( 0.0)    2 ( 1.3)             
##      2             64 (27.8)   5 (20.0)   23 (14.6)             
##      3             97 (42.2)  10 (40.0)   48 (30.6)             
##      4             50 (21.7)  10 (40.0)   84 (53.5)
## format
print(catTable, format = "fp")
##                  Stratified by status
##                   0           1          2           p      test
##   n               232         25         161                    
##   trt = 2 (%)      85 (50.6)   9 (47.4)   60 (48.0)   0.894     
##   ascites = 1 (%)   1 ( 0.6)   0 ( 0.0)   23 (18.4)  <0.001     
##   spiders = 1 (%)  33 (19.6)   5 (26.3)   52 (41.6)  <0.001     
##   edema (%)                                          <0.001     
##      0            216 (93.1)  22 (88.0)  116 (72.0)             
##      0.5           15 ( 6.5)   3 (12.0)   26 (16.1)             
##      1              1 ( 0.4)   0 ( 0.0)   19 (11.8)             
##   stage (%)                                          <0.001     
##      1             19 ( 8.3)   0 ( 0.0)    2 ( 1.3)             
##      2             64 (27.8)   5 (20.0)   23 (14.6)             
##      3             97 (42.2)  10 (40.0)   48 (30.6)             
##      4             50 (21.7)  10 (40.0)   84 (53.5)
print(catTable, format = "f")
##              Stratified by status
##               0   1  2   p      test
##   n           232 25 161            
##   trt = 2      85  9  60  0.894     
##   ascites = 1   1  0  23 <0.001     
##   spiders = 1  33  5  52 <0.001     
##   edema                  <0.001     
##      0        216 22 116            
##      0.5       15  3  26            
##      1          1  0  19            
##   stage                  <0.001     
##      1         19  0   2            
##      2         64  5  23            
##      3         97 10  48            
##      4         50 10  84
print(catTable, format = "p")
##                  Stratified by status
##                   0    1    2    p      test
##   n               232  25   161             
##   trt = 2 (%)     50.6 47.4 48.0  0.894     
##   ascites = 1 (%)  0.6  0.0 18.4 <0.001     
##   spiders = 1 (%) 19.6 26.3 41.6 <0.001     
##   edema (%)                      <0.001     
##      0            93.1 88.0 72.0            
##      0.5           6.5 12.0 16.1            
##      1             0.4  0.0 11.8            
##   stage (%)                      <0.001     
##      1             8.3  0.0  1.3            
##      2            27.8 20.0 14.6            
##      3            42.2 40.0 30.6            
##      4            21.7 40.0 53.5
print(catTable, format = "pf")
##                       Stratified by status
##                        0           1          2           p      test
##   n                    232         25         161                    
##   trt = 2 % (freq)     50.6 ( 85)  47.4 ( 9)  48.0 ( 60)   0.894     
##   ascites = 1 % (freq)  0.6 (  1)   0.0 ( 0)  18.4 ( 23)  <0.001     
##   spiders = 1 % (freq) 19.6 ( 33)  26.3 ( 5)  41.6 ( 52)  <0.001     
##   edema % (freq)                                          <0.001     
##      0                 93.1 (216)  88.0 (22)  72.0 (116)             
##      0.5                6.5 ( 15)  12.0 ( 3)  16.1 ( 26)             
##      1                  0.4 (  1)   0.0 ( 0)  11.8 ( 19)             
##   stage % (freq)                                          <0.001     
##      1                  8.3 ( 19)   0.0 ( 0)   1.3 (  2)             
##      2                 27.8 ( 64)  20.0 ( 5)  14.6 ( 23)             
##      3                 42.2 ( 97)  40.0 (10)  30.6 ( 48)             
##      4                 21.7 ( 50)  40.0 (10)  53.5 ( 84)
## digits
print(catTable, digits = 5)
##                  Stratified by status
##                   0               1              2               p      test
##   n               232             25             161                        
##   trt = 2 (%)      85 (50.59524)   9 (47.36842)   60 (48.00000)   0.894     
##   ascites = 1 (%)   1 ( 0.59524)   0 ( 0.00000)   23 (18.40000)  <0.001     
##   spiders = 1 (%)  33 (19.64286)   5 (26.31579)   52 (41.60000)  <0.001     
##   edema (%)                                                      <0.001     
##      0            216 (93.10345)  22 (88.00000)  116 (72.04969)             
##      0.5           15 ( 6.46552)   3 (12.00000)   26 (16.14907)             
##      1              1 ( 0.43103)   0 ( 0.00000)   19 (11.80124)             
##   stage (%)                                                      <0.001     
##      1             19 ( 8.26087)   0 ( 0.00000)    2 ( 1.27389)             
##      2             64 (27.82609)   5 (20.00000)   23 (14.64968)             
##      3             97 (42.17391)  10 (40.00000)   48 (30.57325)             
##      4             50 (21.73913)  10 (40.00000)   84 (53.50318)
## exact
print(catTable, exact = TRUE)
##                  Stratified by status
##                   0           1          2           p      test 
##   n               232         25         161                     
##   trt = 2 (%)      85 (50.6)   9 (47.4)   60 (48.0)   0.884 exact
##   ascites = 1 (%)   1 ( 0.6)   0 ( 0.0)   23 (18.4)  <0.001 exact
##   spiders = 1 (%)  33 (19.6)   5 (26.3)   52 (41.6)  <0.001 exact
##   edema (%)                                          <0.001 exact
##      0            216 (93.1)  22 (88.0)  116 (72.0)              
##      0.5           15 ( 6.5)   3 (12.0)   26 (16.1)              
##      1              1 ( 0.4)   0 ( 0.0)   19 (11.8)              
##   stage (%)                                           NA    exact
##      1             19 ( 8.3)   0 ( 0.0)    2 ( 1.3)              
##      2             64 (27.8)   5 (20.0)   23 (14.6)              
##      3             97 (42.2)  10 (40.0)   48 (30.6)              
##      4             50 (21.7)  10 (40.0)   84 (53.5)
## Partially exact
print(catTable, exact = exactlVars)
##                  Stratified by status
##                   0           1          2           p      test 
##   n               232         25         161                     
##   trt = 2 (%)      85 (50.6)   9 (47.4)   60 (48.0)   0.894      
##   ascites = 1 (%)   1 ( 0.6)   0 ( 0.0)   23 (18.4)  <0.001 exact
##   spiders = 1 (%)  33 (19.6)   5 (26.3)   52 (41.6)  <0.001      
##   edema (%)                                          <0.001 exact
##      0            216 (93.1)  22 (88.0)  116 (72.0)              
##      0.5           15 ( 6.5)   3 (12.0)   26 (16.1)              
##      1              1 ( 0.4)   0 ( 0.0)   19 (11.8)              
##   stage (%)                                          <0.001      
##      1             19 ( 8.3)   0 ( 0.0)    2 ( 1.3)              
##      2             64 (27.8)   5 (20.0)   23 (14.6)              
##      3             97 (42.2)  10 (40.0)   48 (30.6)              
##      4             50 (21.7)  10 (40.0)   84 (53.5)
## quote
print(catTable, quote = TRUE)
##                    "Stratified by status"
##  ""                 "0"           "1"          "2"           "p"      "test"
##   "n"               "232"         "25"         "161"         ""       ""    
##   "trt = 2 (%)"     " 85 (50.6) " " 9 (47.4) " " 60 (48.0) " " 0.894" ""    
##   "ascites = 1 (%)" "  1 ( 0.6) " " 0 ( 0.0) " " 23 (18.4) " "<0.001" ""    
##   "spiders = 1 (%)" " 33 (19.6) " " 5 (26.3) " " 52 (41.6) " "<0.001" ""    
##   "edema (%)"       ""            ""           ""            "<0.001" ""    
##   "   0"            "216 (93.1) " "22 (88.0) " "116 (72.0) " ""       ""    
##   "   0.5"          " 15 ( 6.5) " " 3 (12.0) " " 26 (16.1) " ""       ""    
##   "   1"            "  1 ( 0.4) " " 0 ( 0.0) " " 19 (11.8) " ""       ""    
##   "stage (%)"       ""            ""           ""            "<0.001" ""    
##   "   1"            " 19 ( 8.3) " " 0 ( 0.0) " "  2 ( 1.3) " ""       ""    
##   "   2"            " 64 (27.8) " " 5 (20.0) " " 23 (14.6) " ""       ""    
##   "   3"            " 97 (42.2) " "10 (40.0) " " 48 (30.6) " ""       ""    
##   "   4"            " 50 (21.7) " "10 (40.0) " " 84 (53.5) " ""       ""
## No test
print(catTable, test = TRUE)
##                  Stratified by status
##                   0           1          2           p      test
##   n               232         25         161                    
##   trt = 2 (%)      85 (50.6)   9 (47.4)   60 (48.0)   0.894     
##   ascites = 1 (%)   1 ( 0.6)   0 ( 0.0)   23 (18.4)  <0.001     
##   spiders = 1 (%)  33 (19.6)   5 (26.3)   52 (41.6)  <0.001     
##   edema (%)                                          <0.001     
##      0            216 (93.1)  22 (88.0)  116 (72.0)             
##      0.5           15 ( 6.5)   3 (12.0)   26 (16.1)             
##      1              1 ( 0.4)   0 ( 0.0)   19 (11.8)             
##   stage (%)                                          <0.001     
##      1             19 ( 8.3)   0 ( 0.0)    2 ( 1.3)             
##      2             64 (27.8)   5 (20.0)   23 (14.6)             
##      3             97 (42.2)  10 (40.0)   48 (30.6)             
##      4             50 (21.7)  10 (40.0)   84 (53.5)
## pDigits
print(catTable, pDigits = 5)
##                  Stratified by status
##                   0           1          2           p        test
##   n               232         25         161                      
##   trt = 2 (%)      85 (50.6)   9 (47.4)   60 (48.0)   0.89351     
##   ascites = 1 (%)   1 ( 0.6)   0 ( 0.0)   23 (18.4)  <0.00001     
##   spiders = 1 (%)  33 (19.6)   5 (26.3)   52 (41.6)   0.00021     
##   edema (%)                                          <0.00001     
##      0            216 (93.1)  22 (88.0)  116 (72.0)               
##      0.5           15 ( 6.5)   3 (12.0)   26 (16.1)               
##      1              1 ( 0.4)   0 ( 0.0)   19 (11.8)               
##   stage (%)                                          <0.00001     
##      1             19 ( 8.3)   0 ( 0.0)    2 ( 1.3)               
##      2             64 (27.8)   5 (20.0)   23 (14.6)               
##      3             97 (42.2)  10 (40.0)   48 (30.6)               
##      4             50 (21.7)  10 (40.0)   84 (53.5)
## showAllLevel
print(catTable, showAllLevels = TRUE)
##              Stratified by status
##               level 0           1           2           p      test
##   n                 232         25          161                    
##   trt (%)     1      83 (49.4)  10 ( 52.6)   65 (52.0)   0.894     
##               2      85 (50.6)   9 ( 47.4)   60 (48.0)             
##   ascites (%) 0     167 (99.4)  19 (100.0)  102 (81.6)  <0.001     
##               1       1 ( 0.6)   0 (  0.0)   23 (18.4)             
##   spiders (%) 0     135 (80.4)  14 ( 73.7)   73 (58.4)  <0.001     
##               1      33 (19.6)   5 ( 26.3)   52 (41.6)             
##   edema (%)   0     216 (93.1)  22 ( 88.0)  116 (72.0)  <0.001     
##               0.5    15 ( 6.5)   3 ( 12.0)   26 (16.1)             
##               1       1 ( 0.4)   0 (  0.0)   19 (11.8)             
##   stage (%)   1      19 ( 8.3)   0 (  0.0)    2 ( 1.3)  <0.001     
##               2      64 (27.8)   5 ( 20.0)   23 (14.6)             
##               3      97 (42.2)  10 ( 40.0)   48 (30.6)             
##               4      50 (21.7)  10 ( 40.0)   84 (53.5)
## explain
print(catTable, explain = FALSE)
##              Stratified by status
##               0           1          2           p      test
##   n           232         25         161                    
##   trt = 2      85 (50.6)   9 (47.4)   60 (48.0)   0.894     
##   ascites = 1   1 ( 0.6)   0 ( 0.0)   23 (18.4)  <0.001     
##   spiders = 1  33 (19.6)   5 (26.3)   52 (41.6)  <0.001     
##   edema                                          <0.001     
##      0        216 (93.1)  22 (88.0)  116 (72.0)             
##      0.5       15 ( 6.5)   3 (12.0)   26 (16.1)             
##      1          1 ( 0.4)   0 ( 0.0)   19 (11.8)             
##   stage                                          <0.001     
##      1         19 ( 8.3)   0 ( 0.0)    2 ( 1.3)             
##      2         64 (27.8)   5 (20.0)   23 (14.6)             
##      3         97 (42.2)  10 (40.0)   48 (30.6)             
##      4         50 (21.7)  10 (40.0)   84 (53.5)
## CrossTable
print(catTable, CrossTable = TRUE)
##                  Stratified by status
##                   0           1          2           p      test
##   n               232         25         161                    
##   trt = 2 (%)      85 (50.6)   9 (47.4)   60 (48.0)   0.894     
##   ascites = 1 (%)   1 ( 0.6)   0 ( 0.0)   23 (18.4)  <0.001     
##   spiders = 1 (%)  33 (19.6)   5 (26.3)   52 (41.6)  <0.001     
##   edema (%)                                          <0.001     
##      0            216 (93.1)  22 (88.0)  116 (72.0)             
##      0.5           15 ( 6.5)   3 (12.0)   26 (16.1)             
##      1              1 ( 0.4)   0 ( 0.0)   19 (11.8)             
##   stage (%)                                          <0.001     
##      1             19 ( 8.3)   0 ( 0.0)    2 ( 1.3)             
##      2             64 (27.8)   5 (20.0)   23 (14.6)             
##      3             97 (42.2)  10 (40.0)   48 (30.6)             
##      4             50 (21.7)  10 (40.0)   84 (53.5)             
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  312 
## 
##  
##              | status 
##          trt |         0 |         1 |         2 | Row Total | 
## -------------|-----------|-----------|-----------|-----------|
##            1 |        83 |        10 |        65 |       158 | 
##              |     0.051 |     0.015 |     0.046 |           | 
##              |     0.525 |     0.063 |     0.411 |     0.506 | 
##              |     0.494 |     0.526 |     0.520 |           | 
##              |     0.266 |     0.032 |     0.208 |           | 
## -------------|-----------|-----------|-----------|-----------|
##            2 |        85 |         9 |        60 |       154 | 
##              |     0.052 |     0.015 |     0.047 |           | 
##              |     0.552 |     0.058 |     0.390 |     0.494 | 
##              |     0.506 |     0.474 |     0.480 |           | 
##              |     0.272 |     0.029 |     0.192 |           | 
## -------------|-----------|-----------|-----------|-----------|
## Column Total |       168 |        19 |       125 |       312 | 
##              |     0.538 |     0.061 |     0.401 |           | 
## -------------|-----------|-----------|-----------|-----------|
## 
##  
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  312 
## 
##  
##              | status 
##      ascites |         0 |         1 |         2 | Row Total | 
## -------------|-----------|-----------|-----------|-----------|
##            0 |       167 |        19 |       102 |       288 | 
##              |     0.917 |     0.122 |     1.553 |           | 
##              |     0.580 |     0.066 |     0.354 |     0.923 | 
##              |     0.994 |     1.000 |     0.816 |           | 
##              |     0.535 |     0.061 |     0.327 |           | 
## -------------|-----------|-----------|-----------|-----------|
##            1 |         1 |         0 |        23 |        24 | 
##              |    11.000 |     1.462 |    18.631 |           | 
##              |     0.042 |     0.000 |     0.958 |     0.077 | 
##              |     0.006 |     0.000 |     0.184 |           | 
##              |     0.003 |     0.000 |     0.074 |           | 
## -------------|-----------|-----------|-----------|-----------|
## Column Total |       168 |        19 |       125 |       312 | 
##              |     0.538 |     0.061 |     0.401 |           | 
## -------------|-----------|-----------|-----------|-----------|
## 
##  
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  312 
## 
##  
##              | status 
##      spiders |         0 |         1 |         2 | Row Total | 
## -------------|-----------|-----------|-----------|-----------|
##            0 |       135 |        14 |        73 |       222 | 
##              |     2.000 |     0.017 |     2.858 |           | 
##              |     0.608 |     0.063 |     0.329 |     0.712 | 
##              |     0.804 |     0.737 |     0.584 |           | 
##              |     0.433 |     0.045 |     0.234 |           | 
## -------------|-----------|-----------|-----------|-----------|
##            1 |        33 |         5 |        52 |        90 | 
##              |     4.933 |     0.042 |     7.049 |           | 
##              |     0.367 |     0.056 |     0.578 |     0.288 | 
##              |     0.196 |     0.263 |     0.416 |           | 
##              |     0.106 |     0.016 |     0.167 |           | 
## -------------|-----------|-----------|-----------|-----------|
## Column Total |       168 |        19 |       125 |       312 | 
##              |     0.538 |     0.061 |     0.401 |           | 
## -------------|-----------|-----------|-----------|-----------|
## 
##  
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  418 
## 
##  
##              | status 
##        edema |         0 |         1 |         2 | Row Total | 
## -------------|-----------|-----------|-----------|-----------|
##            0 |       216 |        22 |       116 |       354 | 
##              |     1.940 |     0.032 |     3.037 |           | 
##              |     0.610 |     0.062 |     0.328 |     0.847 | 
##              |     0.931 |     0.880 |     0.720 |           | 
##              |     0.517 |     0.053 |     0.278 |           | 
## -------------|-----------|-----------|-----------|-----------|
##          0.5 |        15 |         3 |        26 |        44 | 
##              |     3.634 |     0.052 |     4.836 |           | 
##              |     0.341 |     0.068 |     0.591 |     0.105 | 
##              |     0.065 |     0.120 |     0.161 |           | 
##              |     0.036 |     0.007 |     0.062 |           | 
## -------------|-----------|-----------|-----------|-----------|
##            1 |         1 |         0 |        19 |        20 | 
##              |     9.191 |     1.196 |    16.566 |           | 
##              |     0.050 |     0.000 |     0.950 |     0.048 | 
##              |     0.004 |     0.000 |     0.118 |           | 
##              |     0.002 |     0.000 |     0.045 |           | 
## -------------|-----------|-----------|-----------|-----------|
## Column Total |       232 |        25 |       161 |       418 | 
##              |     0.555 |     0.060 |     0.385 |           | 
## -------------|-----------|-----------|-----------|-----------|
## 
##  
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  412 
## 
##  
##              | status 
##        stage |         0 |         1 |         2 | Row Total | 
## -------------|-----------|-----------|-----------|-----------|
##            1 |        19 |         0 |         2 |        21 | 
##              |     4.517 |     1.274 |     4.502 |           | 
##              |     0.905 |     0.000 |     0.095 |     0.051 | 
##              |     0.083 |     0.000 |     0.013 |           | 
##              |     0.046 |     0.000 |     0.005 |           | 
## -------------|-----------|-----------|-----------|-----------|
##            2 |        64 |         5 |        23 |        92 | 
##              |     3.111 |     0.061 |     4.147 |           | 
##              |     0.696 |     0.054 |     0.250 |     0.223 | 
##              |     0.278 |     0.200 |     0.146 |           | 
##              |     0.155 |     0.012 |     0.056 |           | 
## -------------|-----------|-----------|-----------|-----------|
##            3 |        97 |        10 |        48 |       155 | 
##              |     1.267 |     0.038 |     2.073 |           | 
##              |     0.626 |     0.065 |     0.310 |     0.376 | 
##              |     0.422 |     0.400 |     0.306 |           | 
##              |     0.235 |     0.024 |     0.117 |           | 
## -------------|-----------|-----------|-----------|-----------|
##            4 |        50 |        10 |        84 |       144 | 
##              |    11.487 |     0.182 |    15.460 |           | 
##              |     0.347 |     0.069 |     0.583 |     0.350 | 
##              |     0.217 |     0.400 |     0.535 |           | 
##              |     0.121 |     0.024 |     0.204 |           | 
## -------------|-----------|-----------|-----------|-----------|
## Column Total |       230 |        25 |       157 |       412 | 
##              |     0.558 |     0.061 |     0.381 |           | 
## -------------|-----------|-----------|-----------|-----------|
## 
## 



### Behaviors on correct data format (stratified, 2-variable)
## Creation
catTable <- CreateCatTable(vars = vars, strata = strataTwoVars, data = dataFrame)
## print method
catTable
##                  Stratified by status:sex
##                   0:m        1:m        2:m        0:f         1:f        2:f        p      test
##   n               17         3          24         215         22         137                   
##   trt = 2 (%)      7 (63.6)  0 (  0.0)   8 (36.4)   78 (49.7)   9 (56.2)  52 (50.5)   0.340     
##   ascites = 1 (%)  1 ( 9.1)  0 (  0.0)   2 ( 9.1)    0 ( 0.0)   0 ( 0.0)  21 (20.4)  <0.001     
##   spiders = 1 (%)  2 (18.2)  0 (  0.0)   2 ( 9.1)   31 (19.7)   5 (31.2)  50 (48.5)  <0.001     
##   edema (%)                                                                          <0.001     
##      0            16 (94.1)  3 (100.0)  17 (70.8)  200 (93.0)  19 (86.4)  99 (72.3)             
##      0.5           1 ( 5.9)  0 (  0.0)   4 (16.7)   14 ( 6.5)   3 (13.6)  22 (16.1)             
##      1             0 ( 0.0)  0 (  0.0)   3 (12.5)    1 ( 0.5)   0 ( 0.0)  16 (11.7)             
##   stage (%)                                                                          <0.001     
##      1             2 (11.8)  0 (  0.0)   1 ( 4.2)   17 ( 8.0)   0 ( 0.0)   1 ( 0.8)             
##      2             3 (17.6)  0 (  0.0)   5 (20.8)   61 (28.6)   5 (22.7)  18 (13.5)             
##      3             5 (29.4)  2 ( 66.7)   9 (37.5)   92 (43.2)   8 (36.4)  39 (29.3)             
##      4             7 (41.2)  1 ( 33.3)   9 (37.5)   43 (20.2)   9 (40.9)  75 (56.4)
## summary method
summary(catTable)
## status: 0
## sex: m
##      var  n miss level freq percent cum.percent
##      trt 17    6     1    4    36.4        36.4
##                      2    7    63.6       100.0
##                                                
##  ascites 17    6     0   10    90.9        90.9
##                      1    1     9.1       100.0
##                                                
##  spiders 17    6     0    9    81.8        81.8
##                      1    2    18.2       100.0
##                                                
##    edema 17    0     0   16    94.1        94.1
##                    0.5    1     5.9       100.0
##                      1    0     0.0       100.0
##                                                
##    stage 17    0     1    2    11.8        11.8
##                      2    3    17.6        29.4
##                      3    5    29.4        58.8
##                      4    7    41.2       100.0
##                                                
## --------------------------------------------------------------------------------------- 
## status: 1
## sex: m
##      var n miss level freq percent cum.percent
##      trt 3    0     1    3   100.0       100.0
##                     2    0     0.0       100.0
##                                               
##  ascites 3    0     0    3   100.0       100.0
##                     1    0     0.0       100.0
##                                               
##  spiders 3    0     0    3   100.0       100.0
##                     1    0     0.0       100.0
##                                               
##    edema 3    0     0    3   100.0       100.0
##                   0.5    0     0.0       100.0
##                     1    0     0.0       100.0
##                                               
##    stage 3    0     1    0     0.0         0.0
##                     2    0     0.0         0.0
##                     3    2    66.7        66.7
##                     4    1    33.3       100.0
##                                               
## --------------------------------------------------------------------------------------- 
## status: 2
## sex: m
##      var  n miss level freq percent cum.percent
##      trt 24    2     1   14    63.6        63.6
##                      2    8    36.4       100.0
##                                                
##  ascites 24    2     0   20    90.9        90.9
##                      1    2     9.1       100.0
##                                                
##  spiders 24    2     0   20    90.9        90.9
##                      1    2     9.1       100.0
##                                                
##    edema 24    0     0   17    70.8        70.8
##                    0.5    4    16.7        87.5
##                      1    3    12.5       100.0
##                                                
##    stage 24    0     1    1     4.2         4.2
##                      2    5    20.8        25.0
##                      3    9    37.5        62.5
##                      4    9    37.5       100.0
##                                                
## --------------------------------------------------------------------------------------- 
## status: 0
## sex: f
##      var   n miss level freq percent cum.percent
##      trt 215   58     1   79    50.3        50.3
##                       2   78    49.7       100.0
##                                                 
##  ascites 215   58     0  157   100.0       100.0
##                       1    0     0.0       100.0
##                                                 
##  spiders 215   58     0  126    80.3        80.3
##                       1   31    19.7       100.0
##                                                 
##    edema 215    0     0  200    93.0        93.0
##                     0.5   14     6.5        99.5
##                       1    1     0.5       100.0
##                                                 
##    stage 215    2     1   17     8.0         8.0
##                       2   61    28.6        36.6
##                       3   92    43.2        79.8
##                       4   43    20.2       100.0
##                                                 
## --------------------------------------------------------------------------------------- 
## status: 1
## sex: f
##      var  n miss level freq percent cum.percent
##      trt 22    6     1    7    43.8        43.8
##                      2    9    56.2       100.0
##                                                
##  ascites 22    6     0   16   100.0       100.0
##                      1    0     0.0       100.0
##                                                
##  spiders 22    6     0   11    68.8        68.8
##                      1    5    31.2       100.0
##                                                
##    edema 22    0     0   19    86.4        86.4
##                    0.5    3    13.6       100.0
##                      1    0     0.0       100.0
##                                                
##    stage 22    0     1    0     0.0         0.0
##                      2    5    22.7        22.7
##                      3    8    36.4        59.1
##                      4    9    40.9       100.0
##                                                
## --------------------------------------------------------------------------------------- 
## status: 2
## sex: f
##      var   n miss level freq percent cum.percent
##      trt 137   34     1   51    49.5        49.5
##                       2   52    50.5       100.0
##                                                 
##  ascites 137   34     0   82    79.6        79.6
##                       1   21    20.4       100.0
##                                                 
##  spiders 137   34     0   53    51.5        51.5
##                       1   50    48.5       100.0
##                                                 
##    edema 137    0     0   99    72.3        72.3
##                     0.5   22    16.1        88.3
##                       1   16    11.7       100.0
##                                                 
##    stage 137    4     1    1     0.8         0.8
##                       2   18    13.5        14.3
##                       3   39    29.3        43.6
##                       4   75    56.4       100.0
##                                                 
## 
## p-values
##              pApprox        pExact
## trt     0.3396357021 0.38716295778
## ascites 0.0000003538 0.00000003965
## spiders 0.0000063333 0.00000475377
## edema   0.0000109942            NA
## stage   0.0000008605            NA
## digits
summary(catTable, digits = 5)
## status: 0
## sex: m
##      var  n miss level freq  percent cum.percent
##      trt 17    6     1    4 36.36364    36.36364
##                      2    7 63.63636   100.00000
##                                                 
##  ascites 17    6     0   10 90.90909    90.90909
##                      1    1  9.09091   100.00000
##                                                 
##  spiders 17    6     0    9 81.81818    81.81818
##                      1    2 18.18182   100.00000
##                                                 
##    edema 17    0     0   16 94.11765    94.11765
##                    0.5    1  5.88235   100.00000
##                      1    0  0.00000   100.00000
##                                                 
##    stage 17    0     1    2 11.76471    11.76471
##                      2    3 17.64706    29.41176
##                      3    5 29.41176    58.82353
##                      4    7 41.17647   100.00000
##                                                 
## --------------------------------------------------------------------------------------- 
## status: 1
## sex: m
##      var n miss level freq   percent cum.percent
##      trt 3    0     1    3 100.00000   100.00000
##                     2    0   0.00000   100.00000
##                                                 
##  ascites 3    0     0    3 100.00000   100.00000
##                     1    0   0.00000   100.00000
##                                                 
##  spiders 3    0     0    3 100.00000   100.00000
##                     1    0   0.00000   100.00000
##                                                 
##    edema 3    0     0    3 100.00000   100.00000
##                   0.5    0   0.00000   100.00000
##                     1    0   0.00000   100.00000
##                                                 
##    stage 3    0     1    0   0.00000     0.00000
##                     2    0   0.00000     0.00000
##                     3    2  66.66667    66.66667
##                     4    1  33.33333   100.00000
##                                                 
## --------------------------------------------------------------------------------------- 
## status: 2
## sex: m
##      var  n miss level freq  percent cum.percent
##      trt 24    2     1   14 63.63636    63.63636
##                      2    8 36.36364   100.00000
##                                                 
##  ascites 24    2     0   20 90.90909    90.90909
##                      1    2  9.09091   100.00000
##                                                 
##  spiders 24    2     0   20 90.90909    90.90909
##                      1    2  9.09091   100.00000
##                                                 
##    edema 24    0     0   17 70.83333    70.83333
##                    0.5    4 16.66667    87.50000
##                      1    3 12.50000   100.00000
##                                                 
##    stage 24    0     1    1  4.16667     4.16667
##                      2    5 20.83333    25.00000
##                      3    9 37.50000    62.50000
##                      4    9 37.50000   100.00000
##                                                 
## --------------------------------------------------------------------------------------- 
## status: 0
## sex: f
##      var   n miss level freq   percent cum.percent
##      trt 215   58     1   79  50.31847    50.31847
##                       2   78  49.68153   100.00000
##                                                   
##  ascites 215   58     0  157 100.00000   100.00000
##                       1    0   0.00000   100.00000
##                                                   
##  spiders 215   58     0  126  80.25478    80.25478
##                       1   31  19.74522   100.00000
##                                                   
##    edema 215    0     0  200  93.02326    93.02326
##                     0.5   14   6.51163    99.53488
##                       1    1   0.46512   100.00000
##                                                   
##    stage 215    2     1   17   7.98122     7.98122
##                       2   61  28.63850    36.61972
##                       3   92  43.19249    79.81221
##                       4   43  20.18779   100.00000
##                                                   
## --------------------------------------------------------------------------------------- 
## status: 1
## sex: f
##      var  n miss level freq   percent cum.percent
##      trt 22    6     1    7  43.75000    43.75000
##                      2    9  56.25000   100.00000
##                                                  
##  ascites 22    6     0   16 100.00000   100.00000
##                      1    0   0.00000   100.00000
##                                                  
##  spiders 22    6     0   11  68.75000    68.75000
##                      1    5  31.25000   100.00000
##                                                  
##    edema 22    0     0   19  86.36364    86.36364
##                    0.5    3  13.63636   100.00000
##                      1    0   0.00000   100.00000
##                                                  
##    stage 22    0     1    0   0.00000     0.00000
##                      2    5  22.72727    22.72727
##                      3    8  36.36364    59.09091
##                      4    9  40.90909   100.00000
##                                                  
## --------------------------------------------------------------------------------------- 
## status: 2
## sex: f
##      var   n miss level freq  percent cum.percent
##      trt 137   34     1   51 49.51456    49.51456
##                       2   52 50.48544   100.00000
##                                                  
##  ascites 137   34     0   82 79.61165    79.61165
##                       1   21 20.38835   100.00000
##                                                  
##  spiders 137   34     0   53 51.45631    51.45631
##                       1   50 48.54369   100.00000
##                                                  
##    edema 137    0     0   99 72.26277    72.26277
##                     0.5   22 16.05839    88.32117
##                       1   16 11.67883   100.00000
##                                                  
##    stage 137    4     1    1  0.75188     0.75188
##                       2   18 13.53383    14.28571
##                       3   39 29.32331    43.60902
##                       4   75 56.39098   100.00000
##                                                  
## 
## p-values
##              pApprox        pExact
## trt     0.3396357021 0.38716295778
## ascites 0.0000003538 0.00000003965
## spiders 0.0000063333 0.00000475377
## edema   0.0000109942            NA
## stage   0.0000008605            NA
## print method by default
print(catTable)
##                  Stratified by status:sex
##                   0:m        1:m        2:m        0:f         1:f        2:f        p      test
##   n               17         3          24         215         22         137                   
##   trt = 2 (%)      7 (63.6)  0 (  0.0)   8 (36.4)   78 (49.7)   9 (56.2)  52 (50.5)   0.340     
##   ascites = 1 (%)  1 ( 9.1)  0 (  0.0)   2 ( 9.1)    0 ( 0.0)   0 ( 0.0)  21 (20.4)  <0.001     
##   spiders = 1 (%)  2 (18.2)  0 (  0.0)   2 ( 9.1)   31 (19.7)   5 (31.2)  50 (48.5)  <0.001     
##   edema (%)                                                                          <0.001     
##      0            16 (94.1)  3 (100.0)  17 (70.8)  200 (93.0)  19 (86.4)  99 (72.3)             
##      0.5           1 ( 5.9)  0 (  0.0)   4 (16.7)   14 ( 6.5)   3 (13.6)  22 (16.1)             
##      1             0 ( 0.0)  0 (  0.0)   3 (12.5)    1 ( 0.5)   0 ( 0.0)  16 (11.7)             
##   stage (%)                                                                          <0.001     
##      1             2 (11.8)  0 (  0.0)   1 ( 4.2)   17 ( 8.0)   0 ( 0.0)   1 ( 0.8)             
##      2             3 (17.6)  0 (  0.0)   5 (20.8)   61 (28.6)   5 (22.7)  18 (13.5)             
##      3             5 (29.4)  2 ( 66.7)   9 (37.5)   92 (43.2)   8 (36.4)  39 (29.3)             
##      4             7 (41.2)  1 ( 33.3)   9 (37.5)   43 (20.2)   9 (40.9)  75 (56.4)
## format
print(catTable, format = "fp")
##                  Stratified by status:sex
##                   0:m        1:m        2:m        0:f         1:f        2:f        p      test
##   n               17         3          24         215         22         137                   
##   trt = 2 (%)      7 (63.6)  0 (  0.0)   8 (36.4)   78 (49.7)   9 (56.2)  52 (50.5)   0.340     
##   ascites = 1 (%)  1 ( 9.1)  0 (  0.0)   2 ( 9.1)    0 ( 0.0)   0 ( 0.0)  21 (20.4)  <0.001     
##   spiders = 1 (%)  2 (18.2)  0 (  0.0)   2 ( 9.1)   31 (19.7)   5 (31.2)  50 (48.5)  <0.001     
##   edema (%)                                                                          <0.001     
##      0            16 (94.1)  3 (100.0)  17 (70.8)  200 (93.0)  19 (86.4)  99 (72.3)             
##      0.5           1 ( 5.9)  0 (  0.0)   4 (16.7)   14 ( 6.5)   3 (13.6)  22 (16.1)             
##      1             0 ( 0.0)  0 (  0.0)   3 (12.5)    1 ( 0.5)   0 ( 0.0)  16 (11.7)             
##   stage (%)                                                                          <0.001     
##      1             2 (11.8)  0 (  0.0)   1 ( 4.2)   17 ( 8.0)   0 ( 0.0)   1 ( 0.8)             
##      2             3 (17.6)  0 (  0.0)   5 (20.8)   61 (28.6)   5 (22.7)  18 (13.5)             
##      3             5 (29.4)  2 ( 66.7)   9 (37.5)   92 (43.2)   8 (36.4)  39 (29.3)             
##      4             7 (41.2)  1 ( 33.3)   9 (37.5)   43 (20.2)   9 (40.9)  75 (56.4)
print(catTable, format = "f")
##              Stratified by status:sex
##               0:m 1:m 2:m 0:f 1:f 2:f p      test
##   n           17  3   24  215 22  137            
##   trt = 2      7  0    8   78  9  52   0.340     
##   ascites = 1  1  0    2    0  0  21  <0.001     
##   spiders = 1  2  0    2   31  5  50  <0.001     
##   edema                               <0.001     
##      0        16  3   17  200 19  99             
##      0.5       1  0    4   14  3  22             
##      1         0  0    3    1  0  16             
##   stage                               <0.001     
##      1         2  0    1   17  0   1             
##      2         3  0    5   61  5  18             
##      3         5  2    9   92  8  39             
##      4         7  1    9   43  9  75
print(catTable, format = "p")
##                  Stratified by status:sex
##                   0:m  1:m   2:m  0:f  1:f  2:f  p      test
##   n               17   3     24   215  22   137             
##   trt = 2 (%)     63.6   0.0 36.4 49.7 56.2 50.5  0.340     
##   ascites = 1 (%)  9.1   0.0  9.1  0.0  0.0 20.4 <0.001     
##   spiders = 1 (%) 18.2   0.0  9.1 19.7 31.2 48.5 <0.001     
##   edema (%)                                      <0.001     
##      0            94.1 100.0 70.8 93.0 86.4 72.3            
##      0.5           5.9   0.0 16.7  6.5 13.6 16.1            
##      1             0.0   0.0 12.5  0.5  0.0 11.7            
##   stage (%)                                      <0.001     
##      1            11.8   0.0  4.2  8.0  0.0  0.8            
##      2            17.6   0.0 20.8 28.6 22.7 13.5            
##      3            29.4  66.7 37.5 43.2 36.4 29.3            
##      4            41.2  33.3 37.5 20.2 40.9 56.4
print(catTable, format = "pf")
##                       Stratified by status:sex
##                        0:m        1:m        2:m        0:f         1:f        2:f        p      test
##   n                    17         3          24         215         22         137                   
##   trt = 2 % (freq)     63.6 ( 7)    0.0 (0)  36.4 ( 8)  49.7 ( 78)  56.2 ( 9)  50.5 (52)   0.340     
##   ascites = 1 % (freq)  9.1 ( 1)    0.0 (0)   9.1 ( 2)   0.0 (  0)   0.0 ( 0)  20.4 (21)  <0.001     
##   spiders = 1 % (freq) 18.2 ( 2)    0.0 (0)   9.1 ( 2)  19.7 ( 31)  31.2 ( 5)  48.5 (50)  <0.001     
##   edema % (freq)                                                                          <0.001     
##      0                 94.1 (16)  100.0 (3)  70.8 (17)  93.0 (200)  86.4 (19)  72.3 (99)             
##      0.5                5.9 ( 1)    0.0 (0)  16.7 ( 4)   6.5 ( 14)  13.6 ( 3)  16.1 (22)             
##      1                  0.0 ( 0)    0.0 (0)  12.5 ( 3)   0.5 (  1)   0.0 ( 0)  11.7 (16)             
##   stage % (freq)                                                                          <0.001     
##      1                 11.8 ( 2)    0.0 (0)   4.2 ( 1)   8.0 ( 17)   0.0 ( 0)   0.8 ( 1)             
##      2                 17.6 ( 3)    0.0 (0)  20.8 ( 5)  28.6 ( 61)  22.7 ( 5)  13.5 (18)             
##      3                 29.4 ( 5)   66.7 (2)  37.5 ( 9)  43.2 ( 92)  36.4 ( 8)  29.3 (39)             
##      4                 41.2 ( 7)   33.3 (1)  37.5 ( 9)  20.2 ( 43)  40.9 ( 9)  56.4 (75)
## digits
print(catTable, digits = 5)
##                  Stratified by status:sex
##                   0:m            1:m            2:m            0:f             1:f            2:f            p     
##   n               17             3              24             215             22             137                  
##   trt = 2 (%)      7 (63.63636)  0 (  0.00000)   8 (36.36364)   78 (49.68153)   9 (56.25000)  52 (50.48544)   0.340
##   ascites = 1 (%)  1 ( 9.09091)  0 (  0.00000)   2 ( 9.09091)    0 ( 0.00000)   0 ( 0.00000)  21 (20.38835)  <0.001
##   spiders = 1 (%)  2 (18.18182)  0 (  0.00000)   2 ( 9.09091)   31 (19.74522)   5 (31.25000)  50 (48.54369)  <0.001
##   edema (%)                                                                                                  <0.001
##      0            16 (94.11765)  3 (100.00000)  17 (70.83333)  200 (93.02326)  19 (86.36364)  99 (72.26277)        
##      0.5           1 ( 5.88235)  0 (  0.00000)   4 (16.66667)   14 ( 6.51163)   3 (13.63636)  22 (16.05839)        
##      1             0 ( 0.00000)  0 (  0.00000)   3 (12.50000)    1 ( 0.46512)   0 ( 0.00000)  16 (11.67883)        
##   stage (%)                                                                                                  <0.001
##      1             2 (11.76471)  0 (  0.00000)   1 ( 4.16667)   17 ( 7.98122)   0 ( 0.00000)   1 ( 0.75188)        
##      2             3 (17.64706)  0 (  0.00000)   5 (20.83333)   61 (28.63850)   5 (22.72727)  18 (13.53383)        
##      3             5 (29.41176)  2 ( 66.66667)   9 (37.50000)   92 (43.19249)   8 (36.36364)  39 (29.32331)        
##      4             7 (41.17647)  1 ( 33.33333)   9 (37.50000)   43 (20.18779)   9 (40.90909)  75 (56.39098)        
##                  Stratified by status:sex
##                   test
##   n                   
##   trt = 2 (%)         
##   ascites = 1 (%)     
##   spiders = 1 (%)     
##   edema (%)           
##      0                
##      0.5              
##      1                
##   stage (%)           
##      1                
##      2                
##      3                
##      4
## exact
print(catTable, exact = TRUE)
##                  Stratified by status:sex
##                   0:m        1:m        2:m        0:f         1:f        2:f        p      test 
##   n               17         3          24         215         22         137                    
##   trt = 2 (%)      7 (63.6)  0 (  0.0)   8 (36.4)   78 (49.7)   9 (56.2)  52 (50.5)   0.387 exact
##   ascites = 1 (%)  1 ( 9.1)  0 (  0.0)   2 ( 9.1)    0 ( 0.0)   0 ( 0.0)  21 (20.4)  <0.001 exact
##   spiders = 1 (%)  2 (18.2)  0 (  0.0)   2 ( 9.1)   31 (19.7)   5 (31.2)  50 (48.5)  <0.001 exact
##   edema (%)                                                                           NA    exact
##      0            16 (94.1)  3 (100.0)  17 (70.8)  200 (93.0)  19 (86.4)  99 (72.3)              
##      0.5           1 ( 5.9)  0 (  0.0)   4 (16.7)   14 ( 6.5)   3 (13.6)  22 (16.1)              
##      1             0 ( 0.0)  0 (  0.0)   3 (12.5)    1 ( 0.5)   0 ( 0.0)  16 (11.7)              
##   stage (%)                                                                           NA    exact
##      1             2 (11.8)  0 (  0.0)   1 ( 4.2)   17 ( 8.0)   0 ( 0.0)   1 ( 0.8)              
##      2             3 (17.6)  0 (  0.0)   5 (20.8)   61 (28.6)   5 (22.7)  18 (13.5)              
##      3             5 (29.4)  2 ( 66.7)   9 (37.5)   92 (43.2)   8 (36.4)  39 (29.3)              
##      4             7 (41.2)  1 ( 33.3)   9 (37.5)   43 (20.2)   9 (40.9)  75 (56.4)
## Partially exact
print(catTable, exact = exactlVars)
##                  Stratified by status:sex
##                   0:m        1:m        2:m        0:f         1:f        2:f        p      test 
##   n               17         3          24         215         22         137                    
##   trt = 2 (%)      7 (63.6)  0 (  0.0)   8 (36.4)   78 (49.7)   9 (56.2)  52 (50.5)   0.340      
##   ascites = 1 (%)  1 ( 9.1)  0 (  0.0)   2 ( 9.1)    0 ( 0.0)   0 ( 0.0)  21 (20.4)  <0.001 exact
##   spiders = 1 (%)  2 (18.2)  0 (  0.0)   2 ( 9.1)   31 (19.7)   5 (31.2)  50 (48.5)  <0.001      
##   edema (%)                                                                           NA    exact
##      0            16 (94.1)  3 (100.0)  17 (70.8)  200 (93.0)  19 (86.4)  99 (72.3)              
##      0.5           1 ( 5.9)  0 (  0.0)   4 (16.7)   14 ( 6.5)   3 (13.6)  22 (16.1)              
##      1             0 ( 0.0)  0 (  0.0)   3 (12.5)    1 ( 0.5)   0 ( 0.0)  16 (11.7)              
##   stage (%)                                                                          <0.001      
##      1             2 (11.8)  0 (  0.0)   1 ( 4.2)   17 ( 8.0)   0 ( 0.0)   1 ( 0.8)              
##      2             3 (17.6)  0 (  0.0)   5 (20.8)   61 (28.6)   5 (22.7)  18 (13.5)              
##      3             5 (29.4)  2 ( 66.7)   9 (37.5)   92 (43.2)   8 (36.4)  39 (29.3)              
##      4             7 (41.2)  1 ( 33.3)   9 (37.5)   43 (20.2)   9 (40.9)  75 (56.4)
## quote
print(catTable, quote = TRUE)
##                    "Stratified by status:sex"
##  ""                 "0:m"        "1:m"        "2:m"        "0:f"         "1:f"        "2:f"        "p"      "test"
##   "n"               "17"         "3"          "24"         "215"         "22"         "137"        ""       ""    
##   "trt = 2 (%)"     " 7 (63.6) " "0 (  0.0) " " 8 (36.4) " " 78 (49.7) " " 9 (56.2) " "52 (50.5) " " 0.340" ""    
##   "ascites = 1 (%)" " 1 ( 9.1) " "0 (  0.0) " " 2 ( 9.1) " "  0 ( 0.0) " " 0 ( 0.0) " "21 (20.4) " "<0.001" ""    
##   "spiders = 1 (%)" " 2 (18.2) " "0 (  0.0) " " 2 ( 9.1) " " 31 (19.7) " " 5 (31.2) " "50 (48.5) " "<0.001" ""    
##   "edema (%)"       ""           ""           ""           ""            ""           ""           "<0.001" ""    
##   "   0"            "16 (94.1) " "3 (100.0) " "17 (70.8) " "200 (93.0) " "19 (86.4) " "99 (72.3) " ""       ""    
##   "   0.5"          " 1 ( 5.9) " "0 (  0.0) " " 4 (16.7) " " 14 ( 6.5) " " 3 (13.6) " "22 (16.1) " ""       ""    
##   "   1"            " 0 ( 0.0) " "0 (  0.0) " " 3 (12.5) " "  1 ( 0.5) " " 0 ( 0.0) " "16 (11.7) " ""       ""    
##   "stage (%)"       ""           ""           ""           ""            ""           ""           "<0.001" ""    
##   "   1"            " 2 (11.8) " "0 (  0.0) " " 1 ( 4.2) " " 17 ( 8.0) " " 0 ( 0.0) " " 1 ( 0.8) " ""       ""    
##   "   2"            " 3 (17.6) " "0 (  0.0) " " 5 (20.8) " " 61 (28.6) " " 5 (22.7) " "18 (13.5) " ""       ""    
##   "   3"            " 5 (29.4) " "2 ( 66.7) " " 9 (37.5) " " 92 (43.2) " " 8 (36.4) " "39 (29.3) " ""       ""    
##   "   4"            " 7 (41.2) " "1 ( 33.3) " " 9 (37.5) " " 43 (20.2) " " 9 (40.9) " "75 (56.4) " ""       ""
## No test
print(catTable, test = TRUE)
##                  Stratified by status:sex
##                   0:m        1:m        2:m        0:f         1:f        2:f        p      test
##   n               17         3          24         215         22         137                   
##   trt = 2 (%)      7 (63.6)  0 (  0.0)   8 (36.4)   78 (49.7)   9 (56.2)  52 (50.5)   0.340     
##   ascites = 1 (%)  1 ( 9.1)  0 (  0.0)   2 ( 9.1)    0 ( 0.0)   0 ( 0.0)  21 (20.4)  <0.001     
##   spiders = 1 (%)  2 (18.2)  0 (  0.0)   2 ( 9.1)   31 (19.7)   5 (31.2)  50 (48.5)  <0.001     
##   edema (%)                                                                          <0.001     
##      0            16 (94.1)  3 (100.0)  17 (70.8)  200 (93.0)  19 (86.4)  99 (72.3)             
##      0.5           1 ( 5.9)  0 (  0.0)   4 (16.7)   14 ( 6.5)   3 (13.6)  22 (16.1)             
##      1             0 ( 0.0)  0 (  0.0)   3 (12.5)    1 ( 0.5)   0 ( 0.0)  16 (11.7)             
##   stage (%)                                                                          <0.001     
##      1             2 (11.8)  0 (  0.0)   1 ( 4.2)   17 ( 8.0)   0 ( 0.0)   1 ( 0.8)             
##      2             3 (17.6)  0 (  0.0)   5 (20.8)   61 (28.6)   5 (22.7)  18 (13.5)             
##      3             5 (29.4)  2 ( 66.7)   9 (37.5)   92 (43.2)   8 (36.4)  39 (29.3)             
##      4             7 (41.2)  1 ( 33.3)   9 (37.5)   43 (20.2)   9 (40.9)  75 (56.4)
## pDigits
print(catTable, pDigits = 5)
##                  Stratified by status:sex
##                   0:m        1:m        2:m        0:f         1:f        2:f        p        test
##   n               17         3          24         215         22         137                     
##   trt = 2 (%)      7 (63.6)  0 (  0.0)   8 (36.4)   78 (49.7)   9 (56.2)  52 (50.5)   0.33964     
##   ascites = 1 (%)  1 ( 9.1)  0 (  0.0)   2 ( 9.1)    0 ( 0.0)   0 ( 0.0)  21 (20.4)  <0.00001     
##   spiders = 1 (%)  2 (18.2)  0 (  0.0)   2 ( 9.1)   31 (19.7)   5 (31.2)  50 (48.5)   0.00001     
##   edema (%)                                                                           0.00001     
##      0            16 (94.1)  3 (100.0)  17 (70.8)  200 (93.0)  19 (86.4)  99 (72.3)               
##      0.5           1 ( 5.9)  0 (  0.0)   4 (16.7)   14 ( 6.5)   3 (13.6)  22 (16.1)               
##      1             0 ( 0.0)  0 (  0.0)   3 (12.5)    1 ( 0.5)   0 ( 0.0)  16 (11.7)               
##   stage (%)                                                                          <0.00001     
##      1             2 (11.8)  0 (  0.0)   1 ( 4.2)   17 ( 8.0)   0 ( 0.0)   1 ( 0.8)               
##      2             3 (17.6)  0 (  0.0)   5 (20.8)   61 (28.6)   5 (22.7)  18 (13.5)               
##      3             5 (29.4)  2 ( 66.7)   9 (37.5)   92 (43.2)   8 (36.4)  39 (29.3)               
##      4             7 (41.2)  1 ( 33.3)   9 (37.5)   43 (20.2)   9 (40.9)  75 (56.4)
## showAllLevel
print(catTable, showAllLevels = TRUE)
##              Stratified by status:sex
##               level 0:m        1:m        2:m        0:f          1:f         2:f        p      test
##   n                 17         3          24         215          22          137                   
##   trt (%)     1      4 (36.4)  3 (100.0)  14 (63.6)   79 ( 50.3)   7 ( 43.8)  51 (49.5)   0.340     
##               2      7 (63.6)  0 (  0.0)   8 (36.4)   78 ( 49.7)   9 ( 56.2)  52 (50.5)             
##   ascites (%) 0     10 (90.9)  3 (100.0)  20 (90.9)  157 (100.0)  16 (100.0)  82 (79.6)  <0.001     
##               1      1 ( 9.1)  0 (  0.0)   2 ( 9.1)    0 (  0.0)   0 (  0.0)  21 (20.4)             
##   spiders (%) 0      9 (81.8)  3 (100.0)  20 (90.9)  126 ( 80.3)  11 ( 68.8)  53 (51.5)  <0.001     
##               1      2 (18.2)  0 (  0.0)   2 ( 9.1)   31 ( 19.7)   5 ( 31.2)  50 (48.5)             
##   edema (%)   0     16 (94.1)  3 (100.0)  17 (70.8)  200 ( 93.0)  19 ( 86.4)  99 (72.3)  <0.001     
##               0.5    1 ( 5.9)  0 (  0.0)   4 (16.7)   14 (  6.5)   3 ( 13.6)  22 (16.1)             
##               1      0 ( 0.0)  0 (  0.0)   3 (12.5)    1 (  0.5)   0 (  0.0)  16 (11.7)             
##   stage (%)   1      2 (11.8)  0 (  0.0)   1 ( 4.2)   17 (  8.0)   0 (  0.0)   1 ( 0.8)  <0.001     
##               2      3 (17.6)  0 (  0.0)   5 (20.8)   61 ( 28.6)   5 ( 22.7)  18 (13.5)             
##               3      5 (29.4)  2 ( 66.7)   9 (37.5)   92 ( 43.2)   8 ( 36.4)  39 (29.3)             
##               4      7 (41.2)  1 ( 33.3)   9 (37.5)   43 ( 20.2)   9 ( 40.9)  75 (56.4)
## explain
print(catTable, explain = FALSE)
##              Stratified by status:sex
##               0:m        1:m        2:m        0:f         1:f        2:f        p      test
##   n           17         3          24         215         22         137                   
##   trt = 2      7 (63.6)  0 (  0.0)   8 (36.4)   78 (49.7)   9 (56.2)  52 (50.5)   0.340     
##   ascites = 1  1 ( 9.1)  0 (  0.0)   2 ( 9.1)    0 ( 0.0)   0 ( 0.0)  21 (20.4)  <0.001     
##   spiders = 1  2 (18.2)  0 (  0.0)   2 ( 9.1)   31 (19.7)   5 (31.2)  50 (48.5)  <0.001     
##   edema                                                                          <0.001     
##      0        16 (94.1)  3 (100.0)  17 (70.8)  200 (93.0)  19 (86.4)  99 (72.3)             
##      0.5       1 ( 5.9)  0 (  0.0)   4 (16.7)   14 ( 6.5)   3 (13.6)  22 (16.1)             
##      1         0 ( 0.0)  0 (  0.0)   3 (12.5)    1 ( 0.5)   0 ( 0.0)  16 (11.7)             
##   stage                                                                          <0.001     
##      1         2 (11.8)  0 (  0.0)   1 ( 4.2)   17 ( 8.0)   0 ( 0.0)   1 ( 0.8)             
##      2         3 (17.6)  0 (  0.0)   5 (20.8)   61 (28.6)   5 (22.7)  18 (13.5)             
##      3         5 (29.4)  2 ( 66.7)   9 (37.5)   92 (43.2)   8 (36.4)  39 (29.3)             
##      4         7 (41.2)  1 ( 33.3)   9 (37.5)   43 (20.2)   9 (40.9)  75 (56.4)
## CrossTable
print(catTable, CrossTable = TRUE)
##                  Stratified by status:sex
##                   0:m        1:m        2:m        0:f         1:f        2:f        p      test
##   n               17         3          24         215         22         137                   
##   trt = 2 (%)      7 (63.6)  0 (  0.0)   8 (36.4)   78 (49.7)   9 (56.2)  52 (50.5)   0.340     
##   ascites = 1 (%)  1 ( 9.1)  0 (  0.0)   2 ( 9.1)    0 ( 0.0)   0 ( 0.0)  21 (20.4)  <0.001     
##   spiders = 1 (%)  2 (18.2)  0 (  0.0)   2 ( 9.1)   31 (19.7)   5 (31.2)  50 (48.5)  <0.001     
##   edema (%)                                                                          <0.001     
##      0            16 (94.1)  3 (100.0)  17 (70.8)  200 (93.0)  19 (86.4)  99 (72.3)             
##      0.5           1 ( 5.9)  0 (  0.0)   4 (16.7)   14 ( 6.5)   3 (13.6)  22 (16.1)             
##      1             0 ( 0.0)  0 (  0.0)   3 (12.5)    1 ( 0.5)   0 ( 0.0)  16 (11.7)             
##   stage (%)                                                                          <0.001     
##      1             2 (11.8)  0 (  0.0)   1 ( 4.2)   17 ( 8.0)   0 ( 0.0)   1 ( 0.8)             
##      2             3 (17.6)  0 (  0.0)   5 (20.8)   61 (28.6)   5 (22.7)  18 (13.5)             
##      3             5 (29.4)  2 ( 66.7)   9 (37.5)   92 (43.2)   8 (36.4)  39 (29.3)             
##      4             7 (41.2)  1 ( 33.3)   9 (37.5)   43 (20.2)   9 (40.9)  75 (56.4)             
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  312 
## 
##  
##              | status:sex 
##          trt |       0:m |       1:m |       2:m |       0:f |       1:f |       2:f | Row Total | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            1 |         4 |         3 |        14 |        79 |         7 |        51 |       158 | 
##              |     0.443 |     1.443 |     0.734 |     0.003 |     0.150 |     0.026 |           | 
##              |     0.025 |     0.019 |     0.089 |     0.500 |     0.044 |     0.323 |     0.506 | 
##              |     0.364 |     1.000 |     0.636 |     0.503 |     0.438 |     0.495 |           | 
##              |     0.013 |     0.010 |     0.045 |     0.253 |     0.022 |     0.163 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            2 |         7 |         0 |         8 |        78 |         9 |        52 |       154 | 
##              |     0.454 |     1.481 |     0.753 |     0.003 |     0.154 |     0.026 |           | 
##              |     0.045 |     0.000 |     0.052 |     0.506 |     0.058 |     0.338 |     0.494 | 
##              |     0.636 |     0.000 |     0.364 |     0.497 |     0.562 |     0.505 |           | 
##              |     0.022 |     0.000 |     0.026 |     0.250 |     0.029 |     0.167 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## Column Total |        11 |         3 |        22 |       157 |        16 |       103 |       312 | 
##              |     0.035 |     0.010 |     0.071 |     0.503 |     0.051 |     0.330 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## 
##  
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  312 
## 
##  
##              | status:sex 
##      ascites |       0:m |       1:m |       2:m |       0:f |       1:f |       2:f | Row Total | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            0 |        10 |         3 |        20 |       157 |        16 |        82 |       288 | 
##              |     0.002 |     0.019 |     0.005 |     1.006 |     0.103 |     1.799 |           | 
##              |     0.035 |     0.010 |     0.069 |     0.545 |     0.056 |     0.285 |     0.923 | 
##              |     0.909 |     1.000 |     0.909 |     1.000 |     1.000 |     0.796 |           | 
##              |     0.032 |     0.010 |     0.064 |     0.503 |     0.051 |     0.263 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            1 |         1 |         0 |         2 |         0 |         0 |        21 |        24 | 
##              |     0.028 |     0.231 |     0.056 |    12.077 |     1.231 |    21.583 |           | 
##              |     0.042 |     0.000 |     0.083 |     0.000 |     0.000 |     0.875 |     0.077 | 
##              |     0.091 |     0.000 |     0.091 |     0.000 |     0.000 |     0.204 |           | 
##              |     0.003 |     0.000 |     0.006 |     0.000 |     0.000 |     0.067 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## Column Total |        11 |         3 |        22 |       157 |        16 |       103 |       312 | 
##              |     0.035 |     0.010 |     0.071 |     0.503 |     0.051 |     0.330 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## 
##  
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  312 
## 
##  
##              | status:sex 
##      spiders |       0:m |       1:m |       2:m |       0:f |       1:f |       2:f | Row Total | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            0 |         9 |         3 |        20 |       126 |        11 |        53 |       222 | 
##              |     0.176 |     0.351 |     1.207 |     1.828 |     0.013 |     5.616 |           | 
##              |     0.041 |     0.014 |     0.090 |     0.568 |     0.050 |     0.239 |     0.712 | 
##              |     0.818 |     1.000 |     0.909 |     0.803 |     0.688 |     0.515 |           | 
##              |     0.029 |     0.010 |     0.064 |     0.404 |     0.035 |     0.170 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            1 |         2 |         0 |         2 |        31 |         5 |        50 |        90 | 
##              |     0.434 |     0.865 |     2.976 |     4.508 |     0.032 |    13.854 |           | 
##              |     0.022 |     0.000 |     0.022 |     0.344 |     0.056 |     0.556 |     0.288 | 
##              |     0.182 |     0.000 |     0.091 |     0.197 |     0.312 |     0.485 |           | 
##              |     0.006 |     0.000 |     0.006 |     0.099 |     0.016 |     0.160 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## Column Total |        11 |         3 |        22 |       157 |        16 |       103 |       312 | 
##              |     0.035 |     0.010 |     0.071 |     0.503 |     0.051 |     0.330 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## 
##  
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  418 
## 
##  
##              | status:sex 
##        edema |       0:m |       1:m |       2:m |       0:f |       1:f |       2:f | Row Total | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            0 |        16 |         3 |        17 |       200 |        19 |        99 |       354 | 
##              |     0.178 |     0.083 |     0.544 |     1.763 |     0.007 |     2.498 |           | 
##              |     0.045 |     0.008 |     0.048 |     0.565 |     0.054 |     0.280 |     0.847 | 
##              |     0.941 |     1.000 |     0.708 |     0.930 |     0.864 |     0.723 |           | 
##              |     0.038 |     0.007 |     0.041 |     0.478 |     0.045 |     0.237 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##          0.5 |         1 |         0 |         4 |        14 |         3 |        22 |        44 | 
##              |     0.348 |     0.316 |     0.860 |     3.292 |     0.202 |     3.983 |           | 
##              |     0.023 |     0.000 |     0.091 |     0.318 |     0.068 |     0.500 |     0.105 | 
##              |     0.059 |     0.000 |     0.167 |     0.065 |     0.136 |     0.161 |           | 
##              |     0.002 |     0.000 |     0.010 |     0.033 |     0.007 |     0.053 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            1 |         0 |         0 |         3 |         1 |         0 |        16 |        20 | 
##              |     0.813 |     0.144 |     2.986 |     8.384 |     1.053 |    13.609 |           | 
##              |     0.000 |     0.000 |     0.150 |     0.050 |     0.000 |     0.800 |     0.048 | 
##              |     0.000 |     0.000 |     0.125 |     0.005 |     0.000 |     0.117 |           | 
##              |     0.000 |     0.000 |     0.007 |     0.002 |     0.000 |     0.038 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## Column Total |        17 |         3 |        24 |       215 |        22 |       137 |       418 | 
##              |     0.041 |     0.007 |     0.057 |     0.514 |     0.053 |     0.328 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## 
##  
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  412 
## 
##  
##              | status:sex 
##        stage |       0:m |       1:m |       2:m |       0:f |       1:f |       2:f | Row Total | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            1 |         2 |         0 |         1 |        17 |         0 |         1 |        21 | 
##              |     1.483 |     0.153 |     0.041 |     3.476 |     1.121 |     4.927 |           | 
##              |     0.095 |     0.000 |     0.048 |     0.810 |     0.000 |     0.048 |     0.051 | 
##              |     0.118 |     0.000 |     0.042 |     0.080 |     0.000 |     0.008 |           | 
##              |     0.005 |     0.000 |     0.002 |     0.041 |     0.000 |     0.002 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            2 |         3 |         0 |         5 |        61 |         5 |        18 |        92 | 
##              |     0.167 |     0.670 |     0.024 |     3.796 |     0.002 |     4.608 |           | 
##              |     0.033 |     0.000 |     0.054 |     0.663 |     0.054 |     0.196 |     0.223 | 
##              |     0.176 |     0.000 |     0.208 |     0.286 |     0.227 |     0.135 |           | 
##              |     0.007 |     0.000 |     0.012 |     0.148 |     0.012 |     0.044 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            3 |         5 |         2 |         9 |        92 |         8 |        39 |       155 | 
##              |     0.305 |     0.673 |     0.000 |     1.757 |     0.009 |     2.434 |           | 
##              |     0.032 |     0.013 |     0.058 |     0.594 |     0.052 |     0.252 |     0.376 | 
##              |     0.294 |     0.667 |     0.375 |     0.432 |     0.364 |     0.293 |           | 
##              |     0.012 |     0.005 |     0.022 |     0.223 |     0.019 |     0.095 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            4 |         7 |         1 |         9 |        43 |         9 |        75 |       144 | 
##              |     0.188 |     0.002 |     0.045 |    13.283 |     0.223 |    17.491 |           | 
##              |     0.049 |     0.007 |     0.062 |     0.299 |     0.062 |     0.521 |     0.350 | 
##              |     0.412 |     0.333 |     0.375 |     0.202 |     0.409 |     0.564 |           | 
##              |     0.017 |     0.002 |     0.022 |     0.104 |     0.022 |     0.182 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## Column Total |        17 |         3 |        24 |       213 |        22 |       133 |       412 | 
##              |     0.041 |     0.007 |     0.058 |     0.517 |     0.053 |     0.323 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## 
## 



### Behaviors on correct data format (stratified, 3-variable)
## Creation
catTable <- CreateCatTable(vars = vars, strata = strataThreeVars, data = dataFrame)
## print method
catTable
##                  Stratified by sex:ascites:hepato
##                   m:0:0      f:0:0       m:1:0 f:1:0      m:0:1      f:0:1       m:1:1      f:1:1       p    test
##   n               15         132         0     5          18         123         3          16                   
##   trt = 2 (%)      6 (40.0)   59 (44.7)  -     2 ( 40.0)   7 (38.9)   72 (58.5)  2 ( 66.7)   6 ( 37.5)   NaN     
##   ascites = 1 (%)  0 ( 0.0)    0 ( 0.0)  -     5 (100.0)   0 ( 0.0)    0 ( 0.0)  3 (100.0)  16 (100.0)   NaN     
##   spiders = 1 (%)  1 ( 6.7)   21 (15.9)  -     1 ( 20.0)   2 (11.1)   53 (43.1)  1 ( 33.3)  11 ( 68.8)   NaN     
##   edema (%)                              -                                                               NaN     
##      0            13 (86.7)  123 (93.2)  -     2 ( 40.0)  15 (83.3)  106 (86.2)  1 ( 33.3)   3 ( 18.8)           
##      0.5           1 ( 6.7)    8 ( 6.1)  -     0 (  0.0)   3 (16.7)   13 (10.6)  0 (  0.0)   4 ( 25.0)           
##      1             1 ( 6.7)    1 ( 0.8)  -     3 ( 60.0)   0 ( 0.0)    4 ( 3.3)  2 ( 66.7)   9 ( 56.2)           
##   stage (%)                              -                                                               NaN     
##      1             3 (20.0)   13 ( 9.8)  -     0 (  0.0)   0 ( 0.0)    0 ( 0.0)  0 (  0.0)   0 (  0.0)           
##      2             3 (20.0)   45 (34.1)  -     0 (  0.0)   3 (16.7)   14 (11.4)  0 (  0.0)   2 ( 12.5)           
##      3             7 (46.7)   59 (44.7)  -     1 ( 20.0)   5 (27.8)   48 (39.0)  0 (  0.0)   0 (  0.0)           
##      4             2 (13.3)   15 (11.4)  -     4 ( 80.0)  10 (55.6)   61 (49.6)  3 (100.0)  14 ( 87.5)
## summary method
summary(catTable)
## sex: m
## ascites: 0
## hepato: 0
##      var  n miss level freq percent cum.percent
##      trt 15    0     1    9    60.0        60.0
##                      2    6    40.0       100.0
##                                                
##  ascites 15    0     0   15   100.0       100.0
##                      1    0     0.0       100.0
##                                                
##  spiders 15    0     0   14    93.3        93.3
##                      1    1     6.7       100.0
##                                                
##    edema 15    0     0   13    86.7        86.7
##                    0.5    1     6.7        93.3
##                      1    1     6.7       100.0
##                                                
##    stage 15    0     1    3    20.0        20.0
##                      2    3    20.0        40.0
##                      3    7    46.7        86.7
##                      4    2    13.3       100.0
##                                                
## --------------------------------------------------------------------------------------- 
## sex: f
## ascites: 0
## hepato: 0
##      var   n miss level freq percent cum.percent
##      trt 132    0     1   73    55.3        55.3
##                       2   59    44.7       100.0
##                                                 
##  ascites 132    0     0  132   100.0       100.0
##                       1    0     0.0       100.0
##                                                 
##  spiders 132    0     0  111    84.1        84.1
##                       1   21    15.9       100.0
##                                                 
##    edema 132    0     0  123    93.2        93.2
##                     0.5    8     6.1        99.2
##                       1    1     0.8       100.0
##                                                 
##    stage 132    0     1   13     9.8         9.8
##                       2   45    34.1        43.9
##                       3   59    44.7        88.6
##                       4   15    11.4       100.0
##                                                 
## --------------------------------------------------------------------------------------- 
## sex: m
## ascites: 1
## hepato: 0
## NULL
## --------------------------------------------------------------------------------------- 
## sex: f
## ascites: 1
## hepato: 0
##      var n miss level freq percent cum.percent
##      trt 5    0     1    3    60.0        60.0
##                     2    2    40.0       100.0
##                                               
##  ascites 5    0     0    0     0.0         0.0
##                     1    5   100.0       100.0
##                                               
##  spiders 5    0     0    4    80.0        80.0
##                     1    1    20.0       100.0
##                                               
##    edema 5    0     0    2    40.0        40.0
##                   0.5    0     0.0        40.0
##                     1    3    60.0       100.0
##                                               
##    stage 5    0     1    0     0.0         0.0
##                     2    0     0.0         0.0
##                     3    1    20.0        20.0
##                     4    4    80.0       100.0
##                                               
## --------------------------------------------------------------------------------------- 
## sex: m
## ascites: 0
## hepato: 1
##      var  n miss level freq percent cum.percent
##      trt 18    0     1   11    61.1        61.1
##                      2    7    38.9       100.0
##                                                
##  ascites 18    0     0   18   100.0       100.0
##                      1    0     0.0       100.0
##                                                
##  spiders 18    0     0   16    88.9        88.9
##                      1    2    11.1       100.0
##                                                
##    edema 18    0     0   15    83.3        83.3
##                    0.5    3    16.7       100.0
##                      1    0     0.0       100.0
##                                                
##    stage 18    0     1    0     0.0         0.0
##                      2    3    16.7        16.7
##                      3    5    27.8        44.4
##                      4   10    55.6       100.0
##                                                
## --------------------------------------------------------------------------------------- 
## sex: f
## ascites: 0
## hepato: 1
##      var   n miss level freq percent cum.percent
##      trt 123    0     1   51    41.5        41.5
##                       2   72    58.5       100.0
##                                                 
##  ascites 123    0     0  123   100.0       100.0
##                       1    0     0.0       100.0
##                                                 
##  spiders 123    0     0   70    56.9        56.9
##                       1   53    43.1       100.0
##                                                 
##    edema 123    0     0  106    86.2        86.2
##                     0.5   13    10.6        96.7
##                       1    4     3.3       100.0
##                                                 
##    stage 123    0     1    0     0.0         0.0
##                       2   14    11.4        11.4
##                       3   48    39.0        50.4
##                       4   61    49.6       100.0
##                                                 
## --------------------------------------------------------------------------------------- 
## sex: m
## ascites: 1
## hepato: 1
##      var n miss level freq percent cum.percent
##      trt 3    0     1    1    33.3        33.3
##                     2    2    66.7       100.0
##                                               
##  ascites 3    0     0    0     0.0         0.0
##                     1    3   100.0       100.0
##                                               
##  spiders 3    0     0    2    66.7        66.7
##                     1    1    33.3       100.0
##                                               
##    edema 3    0     0    1    33.3        33.3
##                   0.5    0     0.0        33.3
##                     1    2    66.7       100.0
##                                               
##    stage 3    0     1    0     0.0         0.0
##                     2    0     0.0         0.0
##                     3    0     0.0         0.0
##                     4    3   100.0       100.0
##                                               
## --------------------------------------------------------------------------------------- 
## sex: f
## ascites: 1
## hepato: 1
##      var  n miss level freq percent cum.percent
##      trt 16    0     1   10    62.5        62.5
##                      2    6    37.5       100.0
##                                                
##  ascites 16    0     0    0     0.0         0.0
##                      1   16   100.0       100.0
##                                                
##  spiders 16    0     0    5    31.2        31.2
##                      1   11    68.8       100.0
##                                                
##    edema 16    0     0    3    18.8        18.8
##                    0.5    4    25.0        43.8
##                      1    9    56.2       100.0
##                                                
##    stage 16    0     1    0     0.0         0.0
##                      2    2    12.5        12.5
##                      3    0     0.0        12.5
##                      4   14    87.5       100.0
##                                                
## 
## p-values
##         pApprox    pExact
## trt         NaN 2.142e-01
## ascites     NaN 2.124e-36
## spiders     NaN        NA
## edema       NaN        NA
## stage       NaN        NA
## digits
summary(catTable, digits = 5)
## sex: m
## ascites: 0
## hepato: 0
##      var  n miss level freq   percent cum.percent
##      trt 15    0     1    9  60.00000    60.00000
##                      2    6  40.00000   100.00000
##                                                  
##  ascites 15    0     0   15 100.00000   100.00000
##                      1    0   0.00000   100.00000
##                                                  
##  spiders 15    0     0   14  93.33333    93.33333
##                      1    1   6.66667   100.00000
##                                                  
##    edema 15    0     0   13  86.66667    86.66667
##                    0.5    1   6.66667    93.33333
##                      1    1   6.66667   100.00000
##                                                  
##    stage 15    0     1    3  20.00000    20.00000
##                      2    3  20.00000    40.00000
##                      3    7  46.66667    86.66667
##                      4    2  13.33333   100.00000
##                                                  
## --------------------------------------------------------------------------------------- 
## sex: f
## ascites: 0
## hepato: 0
##      var   n miss level freq   percent cum.percent
##      trt 132    0     1   73  55.30303    55.30303
##                       2   59  44.69697   100.00000
##                                                   
##  ascites 132    0     0  132 100.00000   100.00000
##                       1    0   0.00000   100.00000
##                                                   
##  spiders 132    0     0  111  84.09091    84.09091
##                       1   21  15.90909   100.00000
##                                                   
##    edema 132    0     0  123  93.18182    93.18182
##                     0.5    8   6.06061    99.24242
##                       1    1   0.75758   100.00000
##                                                   
##    stage 132    0     1   13   9.84848     9.84848
##                       2   45  34.09091    43.93939
##                       3   59  44.69697    88.63636
##                       4   15  11.36364   100.00000
##                                                   
## --------------------------------------------------------------------------------------- 
## sex: m
## ascites: 1
## hepato: 0
## NULL
## --------------------------------------------------------------------------------------- 
## sex: f
## ascites: 1
## hepato: 0
##      var n miss level freq   percent cum.percent
##      trt 5    0     1    3  60.00000    60.00000
##                     2    2  40.00000   100.00000
##                                                 
##  ascites 5    0     0    0   0.00000     0.00000
##                     1    5 100.00000   100.00000
##                                                 
##  spiders 5    0     0    4  80.00000    80.00000
##                     1    1  20.00000   100.00000
##                                                 
##    edema 5    0     0    2  40.00000    40.00000
##                   0.5    0   0.00000    40.00000
##                     1    3  60.00000   100.00000
##                                                 
##    stage 5    0     1    0   0.00000     0.00000
##                     2    0   0.00000     0.00000
##                     3    1  20.00000    20.00000
##                     4    4  80.00000   100.00000
##                                                 
## --------------------------------------------------------------------------------------- 
## sex: m
## ascites: 0
## hepato: 1
##      var  n miss level freq   percent cum.percent
##      trt 18    0     1   11  61.11111    61.11111
##                      2    7  38.88889   100.00000
##                                                  
##  ascites 18    0     0   18 100.00000   100.00000
##                      1    0   0.00000   100.00000
##                                                  
##  spiders 18    0     0   16  88.88889    88.88889
##                      1    2  11.11111   100.00000
##                                                  
##    edema 18    0     0   15  83.33333    83.33333
##                    0.5    3  16.66667   100.00000
##                      1    0   0.00000   100.00000
##                                                  
##    stage 18    0     1    0   0.00000     0.00000
##                      2    3  16.66667    16.66667
##                      3    5  27.77778    44.44444
##                      4   10  55.55556   100.00000
##                                                  
## --------------------------------------------------------------------------------------- 
## sex: f
## ascites: 0
## hepato: 1
##      var   n miss level freq   percent cum.percent
##      trt 123    0     1   51  41.46341    41.46341
##                       2   72  58.53659   100.00000
##                                                   
##  ascites 123    0     0  123 100.00000   100.00000
##                       1    0   0.00000   100.00000
##                                                   
##  spiders 123    0     0   70  56.91057    56.91057
##                       1   53  43.08943   100.00000
##                                                   
##    edema 123    0     0  106  86.17886    86.17886
##                     0.5   13  10.56911    96.74797
##                       1    4   3.25203   100.00000
##                                                   
##    stage 123    0     1    0   0.00000     0.00000
##                       2   14  11.38211    11.38211
##                       3   48  39.02439    50.40650
##                       4   61  49.59350   100.00000
##                                                   
## --------------------------------------------------------------------------------------- 
## sex: m
## ascites: 1
## hepato: 1
##      var n miss level freq   percent cum.percent
##      trt 3    0     1    1  33.33333    33.33333
##                     2    2  66.66667   100.00000
##                                                 
##  ascites 3    0     0    0   0.00000     0.00000
##                     1    3 100.00000   100.00000
##                                                 
##  spiders 3    0     0    2  66.66667    66.66667
##                     1    1  33.33333   100.00000
##                                                 
##    edema 3    0     0    1  33.33333    33.33333
##                   0.5    0   0.00000    33.33333
##                     1    2  66.66667   100.00000
##                                                 
##    stage 3    0     1    0   0.00000     0.00000
##                     2    0   0.00000     0.00000
##                     3    0   0.00000     0.00000
##                     4    3 100.00000   100.00000
##                                                 
## --------------------------------------------------------------------------------------- 
## sex: f
## ascites: 1
## hepato: 1
##      var  n miss level freq   percent cum.percent
##      trt 16    0     1   10  62.50000    62.50000
##                      2    6  37.50000   100.00000
##                                                  
##  ascites 16    0     0    0   0.00000     0.00000
##                      1   16 100.00000   100.00000
##                                                  
##  spiders 16    0     0    5  31.25000    31.25000
##                      1   11  68.75000   100.00000
##                                                  
##    edema 16    0     0    3  18.75000    18.75000
##                    0.5    4  25.00000    43.75000
##                      1    9  56.25000   100.00000
##                                                  
##    stage 16    0     1    0   0.00000     0.00000
##                      2    2  12.50000    12.50000
##                      3    0   0.00000    12.50000
##                      4   14  87.50000   100.00000
##                                                  
## 
## p-values
##         pApprox    pExact
## trt         NaN 2.142e-01
## ascites     NaN 2.124e-36
## spiders     NaN        NA
## edema       NaN        NA
## stage       NaN        NA
## print method by default
print(catTable)
##                  Stratified by sex:ascites:hepato
##                   m:0:0      f:0:0       m:1:0 f:1:0      m:0:1      f:0:1       m:1:1      f:1:1       p    test
##   n               15         132         0     5          18         123         3          16                   
##   trt = 2 (%)      6 (40.0)   59 (44.7)  -     2 ( 40.0)   7 (38.9)   72 (58.5)  2 ( 66.7)   6 ( 37.5)   NaN     
##   ascites = 1 (%)  0 ( 0.0)    0 ( 0.0)  -     5 (100.0)   0 ( 0.0)    0 ( 0.0)  3 (100.0)  16 (100.0)   NaN     
##   spiders = 1 (%)  1 ( 6.7)   21 (15.9)  -     1 ( 20.0)   2 (11.1)   53 (43.1)  1 ( 33.3)  11 ( 68.8)   NaN     
##   edema (%)                              -                                                               NaN     
##      0            13 (86.7)  123 (93.2)  -     2 ( 40.0)  15 (83.3)  106 (86.2)  1 ( 33.3)   3 ( 18.8)           
##      0.5           1 ( 6.7)    8 ( 6.1)  -     0 (  0.0)   3 (16.7)   13 (10.6)  0 (  0.0)   4 ( 25.0)           
##      1             1 ( 6.7)    1 ( 0.8)  -     3 ( 60.0)   0 ( 0.0)    4 ( 3.3)  2 ( 66.7)   9 ( 56.2)           
##   stage (%)                              -                                                               NaN     
##      1             3 (20.0)   13 ( 9.8)  -     0 (  0.0)   0 ( 0.0)    0 ( 0.0)  0 (  0.0)   0 (  0.0)           
##      2             3 (20.0)   45 (34.1)  -     0 (  0.0)   3 (16.7)   14 (11.4)  0 (  0.0)   2 ( 12.5)           
##      3             7 (46.7)   59 (44.7)  -     1 ( 20.0)   5 (27.8)   48 (39.0)  0 (  0.0)   0 (  0.0)           
##      4             2 (13.3)   15 (11.4)  -     4 ( 80.0)  10 (55.6)   61 (49.6)  3 (100.0)  14 ( 87.5)
## format
print(catTable, format = "fp")
##                  Stratified by sex:ascites:hepato
##                   m:0:0      f:0:0       m:1:0 f:1:0      m:0:1      f:0:1       m:1:1      f:1:1       p    test
##   n               15         132         0     5          18         123         3          16                   
##   trt = 2 (%)      6 (40.0)   59 (44.7)  -     2 ( 40.0)   7 (38.9)   72 (58.5)  2 ( 66.7)   6 ( 37.5)   NaN     
##   ascites = 1 (%)  0 ( 0.0)    0 ( 0.0)  -     5 (100.0)   0 ( 0.0)    0 ( 0.0)  3 (100.0)  16 (100.0)   NaN     
##   spiders = 1 (%)  1 ( 6.7)   21 (15.9)  -     1 ( 20.0)   2 (11.1)   53 (43.1)  1 ( 33.3)  11 ( 68.8)   NaN     
##   edema (%)                              -                                                               NaN     
##      0            13 (86.7)  123 (93.2)  -     2 ( 40.0)  15 (83.3)  106 (86.2)  1 ( 33.3)   3 ( 18.8)           
##      0.5           1 ( 6.7)    8 ( 6.1)  -     0 (  0.0)   3 (16.7)   13 (10.6)  0 (  0.0)   4 ( 25.0)           
##      1             1 ( 6.7)    1 ( 0.8)  -     3 ( 60.0)   0 ( 0.0)    4 ( 3.3)  2 ( 66.7)   9 ( 56.2)           
##   stage (%)                              -                                                               NaN     
##      1             3 (20.0)   13 ( 9.8)  -     0 (  0.0)   0 ( 0.0)    0 ( 0.0)  0 (  0.0)   0 (  0.0)           
##      2             3 (20.0)   45 (34.1)  -     0 (  0.0)   3 (16.7)   14 (11.4)  0 (  0.0)   2 ( 12.5)           
##      3             7 (46.7)   59 (44.7)  -     1 ( 20.0)   5 (27.8)   48 (39.0)  0 (  0.0)   0 (  0.0)           
##      4             2 (13.3)   15 (11.4)  -     4 ( 80.0)  10 (55.6)   61 (49.6)  3 (100.0)  14 ( 87.5)
print(catTable, format = "f")
##              Stratified by sex:ascites:hepato
##               m:0:0 f:0:0 m:1:0 f:1:0 m:0:1 f:0:1 m:1:1 f:1:1 p    test
##   n           15    132   0     5     18    123   3     16             
##   trt = 2      6     59   -     2      7     72   2      6     NaN     
##   ascites = 1  0      0   -     5      0      0   3     16     NaN     
##   spiders = 1  1     21   -     1      2     53   1     11     NaN     
##   edema                   -                                    NaN     
##      0        13    123   -     2     15    106   1      3             
##      0.5       1      8   -     0      3     13   0      4             
##      1         1      1   -     3      0      4   2      9             
##   stage                   -                                    NaN     
##      1         3     13   -     0      0      0   0      0             
##      2         3     45   -     0      3     14   0      2             
##      3         7     59   -     1      5     48   0      0             
##      4         2     15   -     4     10     61   3     14
print(catTable, format = "p")
##                  Stratified by sex:ascites:hepato
##                   m:0:0 f:0:0 m:1:0 f:1:0 m:0:1 f:0:1 m:1:1 f:1:1 p    test
##   n               15    132   0     5     18    123   3     16             
##   trt = 2 (%)     40.0  44.7  -      40.0 38.9  58.5   66.7  37.5  NaN     
##   ascites = 1 (%)  0.0   0.0  -     100.0  0.0   0.0  100.0 100.0  NaN     
##   spiders = 1 (%)  6.7  15.9  -      20.0 11.1  43.1   33.3  68.8  NaN     
##   edema (%)                   -                                    NaN     
##      0            86.7  93.2  -      40.0 83.3  86.2   33.3  18.8          
##      0.5           6.7   6.1  -       0.0 16.7  10.6    0.0  25.0          
##      1             6.7   0.8  -      60.0  0.0   3.3   66.7  56.2          
##   stage (%)                   -                                    NaN     
##      1            20.0   9.8  -       0.0  0.0   0.0    0.0   0.0          
##      2            20.0  34.1  -       0.0 16.7  11.4    0.0  12.5          
##      3            46.7  44.7  -      20.0 27.8  39.0    0.0   0.0          
##      4            13.3  11.4  -      80.0 55.6  49.6  100.0  87.5
print(catTable, format = "pf")
##                       Stratified by sex:ascites:hepato
##                        m:0:0      f:0:0       m:1:0 f:1:0      m:0:1      f:0:1       m:1:1      f:1:1       p   
##   n                    15         132         0     5          18         123         3          16              
##   trt = 2 % (freq)     40.0 ( 6)  44.7 ( 59)  -      40.0 (2)  38.9 ( 7)  58.5 ( 72)   66.7 (2)   37.5 ( 6)   NaN
##   ascites = 1 % (freq)  0.0 ( 0)   0.0 (  0)  -     100.0 (5)   0.0 ( 0)   0.0 (  0)  100.0 (3)  100.0 (16)   NaN
##   spiders = 1 % (freq)  6.7 ( 1)  15.9 ( 21)  -      20.0 (1)  11.1 ( 2)  43.1 ( 53)   33.3 (1)   68.8 (11)   NaN
##   edema % (freq)                              -                                                               NaN
##      0                 86.7 (13)  93.2 (123)  -      40.0 (2)  83.3 (15)  86.2 (106)   33.3 (1)   18.8 ( 3)      
##      0.5                6.7 ( 1)   6.1 (  8)  -       0.0 (0)  16.7 ( 3)  10.6 ( 13)    0.0 (0)   25.0 ( 4)      
##      1                  6.7 ( 1)   0.8 (  1)  -      60.0 (3)   0.0 ( 0)   3.3 (  4)   66.7 (2)   56.2 ( 9)      
##   stage % (freq)                              -                                                               NaN
##      1                 20.0 ( 3)   9.8 ( 13)  -       0.0 (0)   0.0 ( 0)   0.0 (  0)    0.0 (0)    0.0 ( 0)      
##      2                 20.0 ( 3)  34.1 ( 45)  -       0.0 (0)  16.7 ( 3)  11.4 ( 14)    0.0 (0)   12.5 ( 2)      
##      3                 46.7 ( 7)  44.7 ( 59)  -      20.0 (1)  27.8 ( 5)  39.0 ( 48)    0.0 (0)    0.0 ( 0)      
##      4                 13.3 ( 2)  11.4 ( 15)  -      80.0 (4)  55.6 (10)  49.6 ( 61)  100.0 (3)   87.5 (14)      
##                       Stratified by sex:ascites:hepato
##                        test
##   n                        
##   trt = 2 % (freq)         
##   ascites = 1 % (freq)     
##   spiders = 1 % (freq)     
##   edema % (freq)           
##      0                     
##      0.5                   
##      1                     
##   stage % (freq)           
##      1                     
##      2                     
##      3                     
##      4
## digits
print(catTable, digits = 5)
##                  Stratified by sex:ascites:hepato
##                   m:0:0          f:0:0           m:1:0 f:1:0          m:0:1          f:0:1           m:1:1         
##   n               15             132             0     5              18             123             3             
##   trt = 2 (%)      6 (40.00000)   59 (44.69697)  -     2 ( 40.00000)   7 (38.88889)   72 (58.53659)  2 ( 66.66667) 
##   ascites = 1 (%)  0 ( 0.00000)    0 ( 0.00000)  -     5 (100.00000)   0 ( 0.00000)    0 ( 0.00000)  3 (100.00000) 
##   spiders = 1 (%)  1 ( 6.66667)   21 (15.90909)  -     1 ( 20.00000)   2 (11.11111)   53 (43.08943)  1 ( 33.33333) 
##   edema (%)                                      -                                                                 
##      0            13 (86.66667)  123 (93.18182)  -     2 ( 40.00000)  15 (83.33333)  106 (86.17886)  1 ( 33.33333) 
##      0.5           1 ( 6.66667)    8 ( 6.06061)  -     0 (  0.00000)   3 (16.66667)   13 (10.56911)  0 (  0.00000) 
##      1             1 ( 6.66667)    1 ( 0.75758)  -     3 ( 60.00000)   0 ( 0.00000)    4 ( 3.25203)  2 ( 66.66667) 
##   stage (%)                                      -                                                                 
##      1             3 (20.00000)   13 ( 9.84848)  -     0 (  0.00000)   0 ( 0.00000)    0 ( 0.00000)  0 (  0.00000) 
##      2             3 (20.00000)   45 (34.09091)  -     0 (  0.00000)   3 (16.66667)   14 (11.38211)  0 (  0.00000) 
##      3             7 (46.66667)   59 (44.69697)  -     1 ( 20.00000)   5 (27.77778)   48 (39.02439)  0 (  0.00000) 
##      4             2 (13.33333)   15 (11.36364)  -     4 ( 80.00000)  10 (55.55556)   61 (49.59350)  3 (100.00000) 
##                  Stratified by sex:ascites:hepato
##                   f:1:1           p    test
##   n               16                       
##   trt = 2 (%)      6 ( 37.50000)   NaN     
##   ascites = 1 (%) 16 (100.00000)   NaN     
##   spiders = 1 (%) 11 ( 68.75000)   NaN     
##   edema (%)                        NaN     
##      0             3 ( 18.75000)           
##      0.5           4 ( 25.00000)           
##      1             9 ( 56.25000)           
##   stage (%)                        NaN     
##      1             0 (  0.00000)           
##      2             2 ( 12.50000)           
##      3             0 (  0.00000)           
##      4            14 ( 87.50000)
## exact
print(catTable, exact = TRUE)
##                  Stratified by sex:ascites:hepato
##                   m:0:0      f:0:0       m:1:0 f:1:0      m:0:1      f:0:1       m:1:1      f:1:1       p     
##   n               15         132         0     5          18         123         3          16                
##   trt = 2 (%)      6 (40.0)   59 (44.7)  -     2 ( 40.0)   7 (38.9)   72 (58.5)  2 ( 66.7)   6 ( 37.5)   0.214
##   ascites = 1 (%)  0 ( 0.0)    0 ( 0.0)  -     5 (100.0)   0 ( 0.0)    0 ( 0.0)  3 (100.0)  16 (100.0)  <0.001
##   spiders = 1 (%)  1 ( 6.7)   21 (15.9)  -     1 ( 20.0)   2 (11.1)   53 (43.1)  1 ( 33.3)  11 ( 68.8)   NA   
##   edema (%)                              -                                                               NA   
##      0            13 (86.7)  123 (93.2)  -     2 ( 40.0)  15 (83.3)  106 (86.2)  1 ( 33.3)   3 ( 18.8)        
##      0.5           1 ( 6.7)    8 ( 6.1)  -     0 (  0.0)   3 (16.7)   13 (10.6)  0 (  0.0)   4 ( 25.0)        
##      1             1 ( 6.7)    1 ( 0.8)  -     3 ( 60.0)   0 ( 0.0)    4 ( 3.3)  2 ( 66.7)   9 ( 56.2)        
##   stage (%)                              -                                                               NA   
##      1             3 (20.0)   13 ( 9.8)  -     0 (  0.0)   0 ( 0.0)    0 ( 0.0)  0 (  0.0)   0 (  0.0)        
##      2             3 (20.0)   45 (34.1)  -     0 (  0.0)   3 (16.7)   14 (11.4)  0 (  0.0)   2 ( 12.5)        
##      3             7 (46.7)   59 (44.7)  -     1 ( 20.0)   5 (27.8)   48 (39.0)  0 (  0.0)   0 (  0.0)        
##      4             2 (13.3)   15 (11.4)  -     4 ( 80.0)  10 (55.6)   61 (49.6)  3 (100.0)  14 ( 87.5)        
##                  Stratified by sex:ascites:hepato
##                   test 
##   n                    
##   trt = 2 (%)     exact
##   ascites = 1 (%) exact
##   spiders = 1 (%) exact
##   edema (%)       exact
##      0                 
##      0.5               
##      1                 
##   stage (%)       exact
##      1                 
##      2                 
##      3                 
##      4
## Partially exact
print(catTable, exact = exactlVars)
##                  Stratified by sex:ascites:hepato
##                   m:0:0      f:0:0       m:1:0 f:1:0      m:0:1      f:0:1       m:1:1      f:1:1       p     
##   n               15         132         0     5          18         123         3          16                
##   trt = 2 (%)      6 (40.0)   59 (44.7)  -     2 ( 40.0)   7 (38.9)   72 (58.5)  2 ( 66.7)   6 ( 37.5)   NaN  
##   ascites = 1 (%)  0 ( 0.0)    0 ( 0.0)  -     5 (100.0)   0 ( 0.0)    0 ( 0.0)  3 (100.0)  16 (100.0)  <0.001
##   spiders = 1 (%)  1 ( 6.7)   21 (15.9)  -     1 ( 20.0)   2 (11.1)   53 (43.1)  1 ( 33.3)  11 ( 68.8)   NaN  
##   edema (%)                              -                                                               NA   
##      0            13 (86.7)  123 (93.2)  -     2 ( 40.0)  15 (83.3)  106 (86.2)  1 ( 33.3)   3 ( 18.8)        
##      0.5           1 ( 6.7)    8 ( 6.1)  -     0 (  0.0)   3 (16.7)   13 (10.6)  0 (  0.0)   4 ( 25.0)        
##      1             1 ( 6.7)    1 ( 0.8)  -     3 ( 60.0)   0 ( 0.0)    4 ( 3.3)  2 ( 66.7)   9 ( 56.2)        
##   stage (%)                              -                                                               NaN  
##      1             3 (20.0)   13 ( 9.8)  -     0 (  0.0)   0 ( 0.0)    0 ( 0.0)  0 (  0.0)   0 (  0.0)        
##      2             3 (20.0)   45 (34.1)  -     0 (  0.0)   3 (16.7)   14 (11.4)  0 (  0.0)   2 ( 12.5)        
##      3             7 (46.7)   59 (44.7)  -     1 ( 20.0)   5 (27.8)   48 (39.0)  0 (  0.0)   0 (  0.0)        
##      4             2 (13.3)   15 (11.4)  -     4 ( 80.0)  10 (55.6)   61 (49.6)  3 (100.0)  14 ( 87.5)        
##                  Stratified by sex:ascites:hepato
##                   test 
##   n                    
##   trt = 2 (%)          
##   ascites = 1 (%) exact
##   spiders = 1 (%)      
##   edema (%)       exact
##      0                 
##      0.5               
##      1                 
##   stage (%)            
##      1                 
##      2                 
##      3                 
##      4
## quote
print(catTable, quote = TRUE)
##                    "Stratified by sex:ascites:hepato"
##  ""                 "m:0:0"      "f:0:0"       "m:1:0" "f:1:0"      "m:0:1"      "f:0:1"       "m:1:1"     
##   "n"               "15"         "132"         "0"     "5"          "18"         "123"         "3"         
##   "trt = 2 (%)"     " 6 (40.0) " " 59 (44.7) " "-"     "2 ( 40.0) " " 7 (38.9) " " 72 (58.5) " "2 ( 66.7) "
##   "ascites = 1 (%)" " 0 ( 0.0) " "  0 ( 0.0) " "-"     "5 (100.0) " " 0 ( 0.0) " "  0 ( 0.0) " "3 (100.0) "
##   "spiders = 1 (%)" " 1 ( 6.7) " " 21 (15.9) " "-"     "1 ( 20.0) " " 2 (11.1) " " 53 (43.1) " "1 ( 33.3) "
##   "edema (%)"       ""           ""            "-"     ""           ""           ""            ""          
##   "   0"            "13 (86.7) " "123 (93.2) " "-"     "2 ( 40.0) " "15 (83.3) " "106 (86.2) " "1 ( 33.3) "
##   "   0.5"          " 1 ( 6.7) " "  8 ( 6.1) " "-"     "0 (  0.0) " " 3 (16.7) " " 13 (10.6) " "0 (  0.0) "
##   "   1"            " 1 ( 6.7) " "  1 ( 0.8) " "-"     "3 ( 60.0) " " 0 ( 0.0) " "  4 ( 3.3) " "2 ( 66.7) "
##   "stage (%)"       ""           ""            "-"     ""           ""           ""            ""          
##   "   1"            " 3 (20.0) " " 13 ( 9.8) " "-"     "0 (  0.0) " " 0 ( 0.0) " "  0 ( 0.0) " "0 (  0.0) "
##   "   2"            " 3 (20.0) " " 45 (34.1) " "-"     "0 (  0.0) " " 3 (16.7) " " 14 (11.4) " "0 (  0.0) "
##   "   3"            " 7 (46.7) " " 59 (44.7) " "-"     "1 ( 20.0) " " 5 (27.8) " " 48 (39.0) " "0 (  0.0) "
##   "   4"            " 2 (13.3) " " 15 (11.4) " "-"     "4 ( 80.0) " "10 (55.6) " " 61 (49.6) " "3 (100.0) "
##                    "Stratified by sex:ascites:hepato"
##  ""                 "f:1:1"       "p"    "test"
##   "n"               "16"          ""     ""    
##   "trt = 2 (%)"     " 6 ( 37.5) " " NaN" ""    
##   "ascites = 1 (%)" "16 (100.0) " " NaN" ""    
##   "spiders = 1 (%)" "11 ( 68.8) " " NaN" ""    
##   "edema (%)"       ""            " NaN" ""    
##   "   0"            " 3 ( 18.8) " ""     ""    
##   "   0.5"          " 4 ( 25.0) " ""     ""    
##   "   1"            " 9 ( 56.2) " ""     ""    
##   "stage (%)"       ""            " NaN" ""    
##   "   1"            " 0 (  0.0) " ""     ""    
##   "   2"            " 2 ( 12.5) " ""     ""    
##   "   3"            " 0 (  0.0) " ""     ""    
##   "   4"            "14 ( 87.5) " ""     ""
## No test
print(catTable, test = TRUE)
##                  Stratified by sex:ascites:hepato
##                   m:0:0      f:0:0       m:1:0 f:1:0      m:0:1      f:0:1       m:1:1      f:1:1       p    test
##   n               15         132         0     5          18         123         3          16                   
##   trt = 2 (%)      6 (40.0)   59 (44.7)  -     2 ( 40.0)   7 (38.9)   72 (58.5)  2 ( 66.7)   6 ( 37.5)   NaN     
##   ascites = 1 (%)  0 ( 0.0)    0 ( 0.0)  -     5 (100.0)   0 ( 0.0)    0 ( 0.0)  3 (100.0)  16 (100.0)   NaN     
##   spiders = 1 (%)  1 ( 6.7)   21 (15.9)  -     1 ( 20.0)   2 (11.1)   53 (43.1)  1 ( 33.3)  11 ( 68.8)   NaN     
##   edema (%)                              -                                                               NaN     
##      0            13 (86.7)  123 (93.2)  -     2 ( 40.0)  15 (83.3)  106 (86.2)  1 ( 33.3)   3 ( 18.8)           
##      0.5           1 ( 6.7)    8 ( 6.1)  -     0 (  0.0)   3 (16.7)   13 (10.6)  0 (  0.0)   4 ( 25.0)           
##      1             1 ( 6.7)    1 ( 0.8)  -     3 ( 60.0)   0 ( 0.0)    4 ( 3.3)  2 ( 66.7)   9 ( 56.2)           
##   stage (%)                              -                                                               NaN     
##      1             3 (20.0)   13 ( 9.8)  -     0 (  0.0)   0 ( 0.0)    0 ( 0.0)  0 (  0.0)   0 (  0.0)           
##      2             3 (20.0)   45 (34.1)  -     0 (  0.0)   3 (16.7)   14 (11.4)  0 (  0.0)   2 ( 12.5)           
##      3             7 (46.7)   59 (44.7)  -     1 ( 20.0)   5 (27.8)   48 (39.0)  0 (  0.0)   0 (  0.0)           
##      4             2 (13.3)   15 (11.4)  -     4 ( 80.0)  10 (55.6)   61 (49.6)  3 (100.0)  14 ( 87.5)
## pDigits
print(catTable, pDigits = 5)
##                  Stratified by sex:ascites:hepato
##                   m:0:0      f:0:0       m:1:0 f:1:0      m:0:1      f:0:1       m:1:1      f:1:1       p    test
##   n               15         132         0     5          18         123         3          16                   
##   trt = 2 (%)      6 (40.0)   59 (44.7)  -     2 ( 40.0)   7 (38.9)   72 (58.5)  2 ( 66.7)   6 ( 37.5)   NaN     
##   ascites = 1 (%)  0 ( 0.0)    0 ( 0.0)  -     5 (100.0)   0 ( 0.0)    0 ( 0.0)  3 (100.0)  16 (100.0)   NaN     
##   spiders = 1 (%)  1 ( 6.7)   21 (15.9)  -     1 ( 20.0)   2 (11.1)   53 (43.1)  1 ( 33.3)  11 ( 68.8)   NaN     
##   edema (%)                              -                                                               NaN     
##      0            13 (86.7)  123 (93.2)  -     2 ( 40.0)  15 (83.3)  106 (86.2)  1 ( 33.3)   3 ( 18.8)           
##      0.5           1 ( 6.7)    8 ( 6.1)  -     0 (  0.0)   3 (16.7)   13 (10.6)  0 (  0.0)   4 ( 25.0)           
##      1             1 ( 6.7)    1 ( 0.8)  -     3 ( 60.0)   0 ( 0.0)    4 ( 3.3)  2 ( 66.7)   9 ( 56.2)           
##   stage (%)                              -                                                               NaN     
##      1             3 (20.0)   13 ( 9.8)  -     0 (  0.0)   0 ( 0.0)    0 ( 0.0)  0 (  0.0)   0 (  0.0)           
##      2             3 (20.0)   45 (34.1)  -     0 (  0.0)   3 (16.7)   14 (11.4)  0 (  0.0)   2 ( 12.5)           
##      3             7 (46.7)   59 (44.7)  -     1 ( 20.0)   5 (27.8)   48 (39.0)  0 (  0.0)   0 (  0.0)           
##      4             2 (13.3)   15 (11.4)  -     4 ( 80.0)  10 (55.6)   61 (49.6)  3 (100.0)  14 ( 87.5)
## showAllLevel
print(catTable, showAllLevels = TRUE)
##              Stratified by sex:ascites:hepato
##               level m:0:0       f:0:0        m:1:0 f:1:0      m:0:1       f:0:1        m:1:1      f:1:1       p   
##   n                 15          132          0     5          18          123          3          16              
##   trt (%)     1      9 ( 60.0)   73 ( 55.3)  -     3 ( 60.0)  11 ( 61.1)   51 ( 41.5)  1 ( 33.3)  10 ( 62.5)   NaN
##               2      6 ( 40.0)   59 ( 44.7)  -     2 ( 40.0)   7 ( 38.9)   72 ( 58.5)  2 ( 66.7)   6 ( 37.5)      
##   ascites (%) 0     15 (100.0)  132 (100.0)  -     0 (  0.0)  18 (100.0)  123 (100.0)  0 (  0.0)   0 (  0.0)   NaN
##               1      0 (  0.0)    0 (  0.0)  -     5 (100.0)   0 (  0.0)    0 (  0.0)  3 (100.0)  16 (100.0)      
##   spiders (%) 0     14 ( 93.3)  111 ( 84.1)  -     4 ( 80.0)  16 ( 88.9)   70 ( 56.9)  2 ( 66.7)   5 ( 31.2)   NaN
##               1      1 (  6.7)   21 ( 15.9)  -     1 ( 20.0)   2 ( 11.1)   53 ( 43.1)  1 ( 33.3)  11 ( 68.8)      
##   edema (%)   0     13 ( 86.7)  123 ( 93.2)  -     2 ( 40.0)  15 ( 83.3)  106 ( 86.2)  1 ( 33.3)   3 ( 18.8)   NaN
##               0.5    1 (  6.7)    8 (  6.1)  -     0 (  0.0)   3 ( 16.7)   13 ( 10.6)  0 (  0.0)   4 ( 25.0)      
##               1      1 (  6.7)    1 (  0.8)  -     3 ( 60.0)   0 (  0.0)    4 (  3.3)  2 ( 66.7)   9 ( 56.2)      
##   stage (%)   1      3 ( 20.0)   13 (  9.8)  -     0 (  0.0)   0 (  0.0)    0 (  0.0)  0 (  0.0)   0 (  0.0)   NaN
##               2      3 ( 20.0)   45 ( 34.1)  -     0 (  0.0)   3 ( 16.7)   14 ( 11.4)  0 (  0.0)   2 ( 12.5)      
##               3      7 ( 46.7)   59 ( 44.7)  -     1 ( 20.0)   5 ( 27.8)   48 ( 39.0)  0 (  0.0)   0 (  0.0)      
##               4      2 ( 13.3)   15 ( 11.4)  -     4 ( 80.0)  10 ( 55.6)   61 ( 49.6)  3 (100.0)  14 ( 87.5)      
##              Stratified by sex:ascites:hepato
##               test
##   n               
##   trt (%)         
##                   
##   ascites (%)     
##                   
##   spiders (%)     
##                   
##   edema (%)       
##                   
##                   
##   stage (%)       
##                   
##                   
## 
## explain
print(catTable, explain = FALSE)
##              Stratified by sex:ascites:hepato
##               m:0:0      f:0:0       m:1:0 f:1:0      m:0:1      f:0:1       m:1:1      f:1:1       p    test
##   n           15         132         0     5          18         123         3          16                   
##   trt = 2      6 (40.0)   59 (44.7)  -     2 ( 40.0)   7 (38.9)   72 (58.5)  2 ( 66.7)   6 ( 37.5)   NaN     
##   ascites = 1  0 ( 0.0)    0 ( 0.0)  -     5 (100.0)   0 ( 0.0)    0 ( 0.0)  3 (100.0)  16 (100.0)   NaN     
##   spiders = 1  1 ( 6.7)   21 (15.9)  -     1 ( 20.0)   2 (11.1)   53 (43.1)  1 ( 33.3)  11 ( 68.8)   NaN     
##   edema                              -                                                               NaN     
##      0        13 (86.7)  123 (93.2)  -     2 ( 40.0)  15 (83.3)  106 (86.2)  1 ( 33.3)   3 ( 18.8)           
##      0.5       1 ( 6.7)    8 ( 6.1)  -     0 (  0.0)   3 (16.7)   13 (10.6)  0 (  0.0)   4 ( 25.0)           
##      1         1 ( 6.7)    1 ( 0.8)  -     3 ( 60.0)   0 ( 0.0)    4 ( 3.3)  2 ( 66.7)   9 ( 56.2)           
##   stage                              -                                                               NaN     
##      1         3 (20.0)   13 ( 9.8)  -     0 (  0.0)   0 ( 0.0)    0 ( 0.0)  0 (  0.0)   0 (  0.0)           
##      2         3 (20.0)   45 (34.1)  -     0 (  0.0)   3 (16.7)   14 (11.4)  0 (  0.0)   2 ( 12.5)           
##      3         7 (46.7)   59 (44.7)  -     1 ( 20.0)   5 (27.8)   48 (39.0)  0 (  0.0)   0 (  0.0)           
##      4         2 (13.3)   15 (11.4)  -     4 ( 80.0)  10 (55.6)   61 (49.6)  3 (100.0)  14 ( 87.5)
## CrossTable
print(catTable, CrossTable = TRUE)
##                  Stratified by sex:ascites:hepato
##                   m:0:0      f:0:0       m:1:0 f:1:0      m:0:1      f:0:1       m:1:1      f:1:1       p    test
##   n               15         132         0     5          18         123         3          16                   
##   trt = 2 (%)      6 (40.0)   59 (44.7)  -     2 ( 40.0)   7 (38.9)   72 (58.5)  2 ( 66.7)   6 ( 37.5)   NaN     
##   ascites = 1 (%)  0 ( 0.0)    0 ( 0.0)  -     5 (100.0)   0 ( 0.0)    0 ( 0.0)  3 (100.0)  16 (100.0)   NaN     
##   spiders = 1 (%)  1 ( 6.7)   21 (15.9)  -     1 ( 20.0)   2 (11.1)   53 (43.1)  1 ( 33.3)  11 ( 68.8)   NaN     
##   edema (%)                              -                                                               NaN     
##      0            13 (86.7)  123 (93.2)  -     2 ( 40.0)  15 (83.3)  106 (86.2)  1 ( 33.3)   3 ( 18.8)           
##      0.5           1 ( 6.7)    8 ( 6.1)  -     0 (  0.0)   3 (16.7)   13 (10.6)  0 (  0.0)   4 ( 25.0)           
##      1             1 ( 6.7)    1 ( 0.8)  -     3 ( 60.0)   0 ( 0.0)    4 ( 3.3)  2 ( 66.7)   9 ( 56.2)           
##   stage (%)                              -                                                               NaN     
##      1             3 (20.0)   13 ( 9.8)  -     0 (  0.0)   0 ( 0.0)    0 ( 0.0)  0 (  0.0)   0 (  0.0)           
##      2             3 (20.0)   45 (34.1)  -     0 (  0.0)   3 (16.7)   14 (11.4)  0 (  0.0)   2 ( 12.5)           
##      3             7 (46.7)   59 (44.7)  -     1 ( 20.0)   5 (27.8)   48 (39.0)  0 (  0.0)   0 (  0.0)           
##      4             2 (13.3)   15 (11.4)  -     4 ( 80.0)  10 (55.6)   61 (49.6)  3 (100.0)  14 ( 87.5)           
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  312 
## 
##  
##              | sex:ascites:hepato 
##          trt |     m:0:0 |     f:0:0 |     m:1:0 |     f:1:0 |     m:0:1 |     f:0:1 |     m:1:1 |     f:1:1 | Row Total | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            1 |         9 |        73 |         0 |         3 |        11 |        51 |         1 |        10 |       158 | 
##              |     0.259 |     0.567 |       NaN |     0.086 |     0.390 |     2.046 |     0.177 |     0.444 |           | 
##              |     0.057 |     0.462 |     0.000 |     0.019 |     0.070 |     0.323 |     0.006 |     0.063 |     0.506 | 
##              |     0.600 |     0.553 |       NaN |     0.600 |     0.611 |     0.415 |     0.333 |     0.625 |           | 
##              |     0.029 |     0.234 |     0.000 |     0.010 |     0.035 |     0.163 |     0.003 |     0.032 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            2 |         6 |        59 |         0 |         2 |         7 |        72 |         2 |         6 |       154 | 
##              |     0.266 |     0.581 |       NaN |     0.089 |     0.400 |     2.099 |     0.182 |     0.456 |           | 
##              |     0.039 |     0.383 |     0.000 |     0.013 |     0.045 |     0.468 |     0.013 |     0.039 |     0.494 | 
##              |     0.400 |     0.447 |       NaN |     0.400 |     0.389 |     0.585 |     0.667 |     0.375 |           | 
##              |     0.019 |     0.189 |     0.000 |     0.006 |     0.022 |     0.231 |     0.006 |     0.019 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## Column Total |        15 |       132 |         0 |         5 |        18 |       123 |         3 |        16 |       312 | 
##              |     0.048 |     0.423 |     0.000 |     0.016 |     0.058 |     0.394 |     0.010 |     0.051 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## 
##  
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  312 
## 
##  
##              | sex:ascites:hepato 
##      ascites |     m:0:0 |     f:0:0 |     m:1:0 |     f:1:0 |     m:0:1 |     f:0:1 |     m:1:1 |     f:1:1 | Row Total | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            0 |        15 |       132 |         0 |         0 |        18 |       123 |         0 |         0 |       288 | 
##              |     0.096 |     0.846 |       NaN |     4.615 |     0.115 |     0.788 |     2.769 |    14.769 |           | 
##              |     0.052 |     0.458 |     0.000 |     0.000 |     0.062 |     0.427 |     0.000 |     0.000 |     0.923 | 
##              |     1.000 |     1.000 |       NaN |     0.000 |     1.000 |     1.000 |     0.000 |     0.000 |           | 
##              |     0.048 |     0.423 |     0.000 |     0.000 |     0.058 |     0.394 |     0.000 |     0.000 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            1 |         0 |         0 |         0 |         5 |         0 |         0 |         3 |        16 |        24 | 
##              |     1.154 |    10.154 |       NaN |    55.385 |     1.385 |     9.462 |    33.231 |   177.231 |           | 
##              |     0.000 |     0.000 |     0.000 |     0.208 |     0.000 |     0.000 |     0.125 |     0.667 |     0.077 | 
##              |     0.000 |     0.000 |       NaN |     1.000 |     0.000 |     0.000 |     1.000 |     1.000 |           | 
##              |     0.000 |     0.000 |     0.000 |     0.016 |     0.000 |     0.000 |     0.010 |     0.051 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## Column Total |        15 |       132 |         0 |         5 |        18 |       123 |         3 |        16 |       312 | 
##              |     0.048 |     0.423 |     0.000 |     0.016 |     0.058 |     0.394 |     0.010 |     0.051 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## 
##  
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  312 
## 
##  
##              | sex:ascites:hepato 
##      spiders |     m:0:0 |     f:0:0 |     m:1:0 |     f:1:0 |     m:0:1 |     f:0:1 |     m:1:1 |     f:1:1 | Row Total | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            0 |        14 |       111 |         0 |         4 |        16 |        70 |         2 |         5 |       222 | 
##              |     1.037 |     3.105 |       NaN |     0.055 |     0.796 |     3.507 |     0.008 |     3.581 |           | 
##              |     0.063 |     0.500 |     0.000 |     0.018 |     0.072 |     0.315 |     0.009 |     0.023 |     0.712 | 
##              |     0.933 |     0.841 |       NaN |     0.800 |     0.889 |     0.569 |     0.667 |     0.312 |           | 
##              |     0.045 |     0.356 |     0.000 |     0.013 |     0.051 |     0.224 |     0.006 |     0.016 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            1 |         1 |        21 |         0 |         1 |         2 |        53 |         1 |        11 |        90 | 
##              |     2.558 |     7.659 |       NaN |     0.136 |     1.963 |     8.650 |     0.021 |     8.832 |           | 
##              |     0.011 |     0.233 |     0.000 |     0.011 |     0.022 |     0.589 |     0.011 |     0.122 |     0.288 | 
##              |     0.067 |     0.159 |       NaN |     0.200 |     0.111 |     0.431 |     0.333 |     0.688 |           | 
##              |     0.003 |     0.067 |     0.000 |     0.003 |     0.006 |     0.170 |     0.003 |     0.035 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## Column Total |        15 |       132 |         0 |         5 |        18 |       123 |         3 |        16 |       312 | 
##              |     0.048 |     0.423 |     0.000 |     0.016 |     0.058 |     0.394 |     0.010 |     0.051 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## 
##  
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  312 
## 
##  
##              | sex:ascites:hepato 
##        edema |     m:0:0 |     f:0:0 |     m:1:0 |     f:1:0 |     m:0:1 |     f:0:1 |     m:1:1 |     f:1:1 | Row Total | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            0 |        13 |       123 |         0 |         2 |        15 |       106 |         1 |         3 |       263 | 
##              |     0.010 |     1.237 |       NaN |     1.164 |     0.002 |     0.052 |     0.924 |     8.154 |           | 
##              |     0.049 |     0.468 |     0.000 |     0.008 |     0.057 |     0.403 |     0.004 |     0.011 |     0.843 | 
##              |     0.867 |     0.932 |       NaN |     0.400 |     0.833 |     0.862 |     0.333 |     0.188 |           | 
##              |     0.042 |     0.394 |     0.000 |     0.006 |     0.048 |     0.340 |     0.003 |     0.010 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##          0.5 |         1 |         8 |         0 |         0 |         3 |        13 |         0 |         4 |        29 | 
##              |     0.111 |     1.486 |       NaN |     0.465 |     1.052 |     0.215 |     0.279 |     4.246 |           | 
##              |     0.034 |     0.276 |     0.000 |     0.000 |     0.103 |     0.448 |     0.000 |     0.138 |     0.093 | 
##              |     0.067 |     0.061 |       NaN |     0.000 |     0.167 |     0.106 |     0.000 |     0.250 |           | 
##              |     0.003 |     0.026 |     0.000 |     0.000 |     0.010 |     0.042 |     0.000 |     0.013 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            1 |         1 |         1 |         0 |         3 |         0 |         4 |         2 |         9 |        20 | 
##              |     0.002 |     6.580 |       NaN |    22.401 |     1.154 |     1.914 |    16.992 |    62.001 |           | 
##              |     0.050 |     0.050 |     0.000 |     0.150 |     0.000 |     0.200 |     0.100 |     0.450 |     0.064 | 
##              |     0.067 |     0.008 |       NaN |     0.600 |     0.000 |     0.033 |     0.667 |     0.562 |           | 
##              |     0.003 |     0.003 |     0.000 |     0.010 |     0.000 |     0.013 |     0.006 |     0.029 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## Column Total |        15 |       132 |         0 |         5 |        18 |       123 |         3 |        16 |       312 | 
##              |     0.048 |     0.423 |     0.000 |     0.016 |     0.058 |     0.394 |     0.010 |     0.051 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## 
##  
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  312 
## 
##  
##              | sex:ascites:hepato 
##        stage |     m:0:0 |     f:0:0 |     m:1:0 |     f:1:0 |     m:0:1 |     f:0:1 |     m:1:1 |     f:1:1 | Row Total | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            1 |         3 |        13 |         0 |         0 |         0 |         0 |         0 |         0 |        16 | 
##              |     6.469 |     5.735 |       NaN |     0.256 |     0.923 |     6.308 |     0.154 |     0.821 |           | 
##              |     0.188 |     0.812 |     0.000 |     0.000 |     0.000 |     0.000 |     0.000 |     0.000 |     0.051 | 
##              |     0.200 |     0.098 |       NaN |     0.000 |     0.000 |     0.000 |     0.000 |     0.000 |           | 
##              |     0.010 |     0.042 |     0.000 |     0.000 |     0.000 |     0.000 |     0.000 |     0.000 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            2 |         3 |        45 |         0 |         0 |         3 |        14 |         0 |         2 |        67 | 
##              |     0.015 |     9.784 |       NaN |     1.074 |     0.194 |     5.834 |     0.644 |     0.600 |           | 
##              |     0.045 |     0.672 |     0.000 |     0.000 |     0.045 |     0.209 |     0.000 |     0.030 |     0.215 | 
##              |     0.200 |     0.341 |       NaN |     0.000 |     0.167 |     0.114 |     0.000 |     0.125 |           | 
##              |     0.010 |     0.144 |     0.000 |     0.000 |     0.010 |     0.045 |     0.000 |     0.006 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            3 |         7 |        59 |         0 |         1 |         5 |        48 |         0 |         0 |       120 | 
##              |     0.263 |     1.334 |       NaN |     0.443 |     0.534 |     0.010 |     1.154 |     6.154 |           | 
##              |     0.058 |     0.492 |     0.000 |     0.008 |     0.042 |     0.400 |     0.000 |     0.000 |     0.385 | 
##              |     0.467 |     0.447 |       NaN |     0.200 |     0.278 |     0.390 |     0.000 |     0.000 |           | 
##              |     0.022 |     0.189 |     0.000 |     0.003 |     0.016 |     0.154 |     0.000 |     0.000 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##            4 |         2 |        15 |         0 |         4 |        10 |        61 |         3 |        14 |       109 | 
##              |     2.004 |    20.994 |       NaN |     2.906 |     2.191 |     7.564 |     3.635 |    12.654 |           | 
##              |     0.018 |     0.138 |     0.000 |     0.037 |     0.092 |     0.560 |     0.028 |     0.128 |     0.349 | 
##              |     0.133 |     0.114 |       NaN |     0.800 |     0.556 |     0.496 |     1.000 |     0.875 |           | 
##              |     0.006 |     0.048 |     0.000 |     0.013 |     0.032 |     0.196 |     0.010 |     0.045 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## Column Total |        15 |       132 |         0 |         5 |        18 |       123 |         3 |        16 |       312 | 
##              |     0.048 |     0.423 |     0.000 |     0.016 |     0.058 |     0.394 |     0.010 |     0.051 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## 
## 

Continuous: Behaviors on wrong data format

### Behaviors on wrong data format
## Not a data frame
contTable <- CreateContTable(vars = vars, strata = strata, data = "dataFrame")
## Error: The data argument needs to be a data frame (no quote).
## Invalid variables
contTable <- CreateContTable(vars = c(vars,"wrong_var1","wrong_var2"), strata = strata, data = dataFrame)
## Warning: The data frame does not have wrong_var1 wrong_var2 Dropped
contTable
##                      Stratified by status
##                       0           1           2           p      test
##   n                   232         25          161                    
##   trt (mean (sd))     1.51 (0.50) 1.47 (0.51) 1.48 (0.50)  0.894     
##   ascites (mean (sd)) 0.01 (0.08) 0.00 (0.00) 0.18 (0.39) <0.001     
##   spiders (mean (sd)) 0.20 (0.40) 0.26 (0.45) 0.42 (0.49) <0.001     
##   edema (mean (sd))   0.04 (0.14) 0.06 (0.17) 0.20 (0.35) <0.001     
##   stage (mean (sd))   2.77 (0.88) 3.20 (0.76) 3.36 (0.78) <0.001
## Invalid variables only
contTable <- CreateContTable(vars = c("wrong_var1","wrong_var2"), strata = strata, data = dataFrame)
## Warning: The data frame does not have wrong_var1 wrong_var2 Dropped
## Error: No valid variables.
## Duplication
contTable <- CreateContTable(vars = c(vars,"time","age"), strata = strata, data = dataFrame)
contTable
##                      Stratified by status
##                       0                1                2                 p      test
##   n                   232              25               161                          
##   trt (mean (sd))        1.51 (0.50)      1.47 (0.51)      1.48 (0.50)     0.894     
##   ascites (mean (sd))    0.01 (0.08)      0.00 (0.00)      0.18 (0.39)    <0.001     
##   spiders (mean (sd))    0.20 (0.40)      0.26 (0.45)      0.42 (0.49)    <0.001     
##   edema (mean (sd))      0.04 (0.14)      0.06 (0.17)      0.20 (0.35)    <0.001     
##   stage (mean (sd))      2.77 (0.88)      3.20 (0.76)      3.36 (0.78)    <0.001     
##   time (mean (sd))    2333.16 (994.66) 1546.20 (753.07) 1376.93 (1049.23) <0.001     
##   age (mean (sd))       49.51 (10.43)    41.69 (6.33)     53.92 (9.81)    <0.001
## No stratifying variables
contTable <- CreateContTable(vars = vars, strata = "status3", data = dataFrame)
## Error: None of the stratifying variables are present in the data frame
## Only mean in the object
contTable <- CreateContTable(vars = vars, strata = strata, data = dataFrame, func.names = "mean")
contTable
## Error: The object does not contain all necessary statistics. Use summary() method.
## Very small strata
contTable <- CreateContTable(vars = vars, strata = smallStrata, data = smallDataFrame)
summary(contTable)
## edema: 0
##         n miss mean sd median p25 p75 min max skew kurt
## trt     1    0    1 NA      1   1   1   1   1  NaN  NaN
## ascites 1    0    0 NA      0   0   0   0   0  NaN  NaN
## spiders 1    0    1 NA      1   1   1   1   1  NaN  NaN
## edema   1    0    0 NA      0   0   0   0   0  NaN  NaN
## stage   1    0    3 NA      3   3   3   3   3  NaN  NaN
## --------------------------------------------------------------------------------------- 
## edema: 0.5
##         n miss mean   sd median  p25  p75 min max skew kurt
## trt     2    0  1.0 0.00    1.0 1.00 1.00 1.0 1.0  NaN  NaN
## ascites 2    0  0.0 0.00    0.0 0.00 0.00 0.0 0.0  NaN  NaN
## spiders 2    0  0.5 0.71    0.5 0.25 0.75 0.0 1.0  NaN  NaN
## edema   2    0  0.5 0.00    0.5 0.50 0.50 0.5 0.5  NaN  NaN
## stage   2    0  4.0 0.00    4.0 4.00 4.00 4.0 4.0  NaN  NaN
## --------------------------------------------------------------------------------------- 
## edema: 1
##         n miss mean   sd median p25 p75 min max skew kurt
## trt     3    0 1.67 0.58      2 1.5   2   1   2 -1.7  NaN
## ascites 3    0 1.00 0.00      1 1.0   1   1   1  NaN  NaN
## spiders 3    0 0.67 0.58      1 0.5   1   0   1 -1.7  NaN
## edema   3    0 1.00 0.00      1 1.0   1   1   1  NaN  NaN
## stage   3    0 4.00 0.00      4 4.0   4   4   4  NaN  NaN
## 
## p-values
##         pNormal pNonNormal
## trt          NA    0.28650
## ascites      NA    0.08208
## spiders      NA    0.73162
## edema        NA    0.08208
## stage        NA    0.08208
contTable
##                      Stratified by edema
##                       0         0.5         1           p   test
##   n                   1         2           3                   
##   trt (mean (sd))     1.00 (NA) 1.00 (0.00) 1.67 (0.58)  NA     
##   ascites (mean (sd)) 0.00 (NA) 0.00 (0.00) 1.00 (0.00)  NA     
##   spiders (mean (sd)) 1.00 (NA) 0.50 (0.71) 0.67 (0.58)  NA     
##   edema (mean (sd))   0.00 (NA) 0.50 (0.00) 1.00 (0.00)  NA     
##   stage (mean (sd))   3.00 (NA) 4.00 (0.00) 4.00 (0.00)  NA

Categorical: Behaviors on wrong data format

### Behaviors on wrong data format
## Not a data frame
catTable <- CreateCatTable(vars = vars, strata = strata, data = "dataFrame")
## Error: The data argument needs to be a data frame (no quote).
## Invalid variables
catTable <- CreateCatTable(vars = c(vars,"wrong_var1","wrong_var2"), strata = strata, data = dataFrame)
## Warning: The data frame does not have wrong_var1 wrong_var2 Dropped
catTable
##                  Stratified by status
##                   0           1          2           p      test
##   n               232         25         161                    
##   trt = 2 (%)      85 (50.6)   9 (47.4)   60 (48.0)   0.894     
##   ascites = 1 (%)   1 ( 0.6)   0 ( 0.0)   23 (18.4)  <0.001     
##   spiders = 1 (%)  33 (19.6)   5 (26.3)   52 (41.6)  <0.001     
##   edema (%)                                          <0.001     
##      0            216 (93.1)  22 (88.0)  116 (72.0)             
##      0.5           15 ( 6.5)   3 (12.0)   26 (16.1)             
##      1              1 ( 0.4)   0 ( 0.0)   19 (11.8)             
##   stage (%)                                          <0.001     
##      1             19 ( 8.3)   0 ( 0.0)    2 ( 1.3)             
##      2             64 (27.8)   5 (20.0)   23 (14.6)             
##      3             97 (42.2)  10 (40.0)   48 (30.6)             
##      4             50 (21.7)  10 (40.0)   84 (53.5)
## Invalid variables only
catTable <- CreateCatTable(vars = c("wrong_var1","wrong_var2"), strata = strata, data = dataFrame)
## Warning: The data frame does not have wrong_var1 wrong_var2 Dropped
## Error: No valid variables.
## Duplication
catTable <- CreateCatTable(vars = c(vars,"stage","edema"), strata = strata, data = dataFrame)
## No stratifying variables
catTable <- CreateCatTable(vars = vars, strata = "status3", data = dataFrame)
## Error: None of the stratifying variables are present in the data frame
## Very small strata
catTable <- CreateCatTable(vars = vars, strata = smallStrata, data = smallDataFrame)
summary(catTable)
## edema: 0
##      var n miss level freq percent cum.percent
##      trt 1    0     1    1   100.0       100.0
##                     2    0     0.0       100.0
##                                               
##  ascites 1    0     0    1   100.0       100.0
##                     1    0     0.0       100.0
##                                               
##  spiders 1    0     0    0     0.0         0.0
##                     1    1   100.0       100.0
##                                               
##    edema 1    0     0    1   100.0       100.0
##                   0.5    0     0.0       100.0
##                     1    0     0.0       100.0
##                                               
##    stage 1    0     3    1   100.0       100.0
##                     4    0     0.0       100.0
##                                               
## --------------------------------------------------------------------------------------- 
## edema: 0.5
##      var n miss level freq percent cum.percent
##      trt 2    0     1    2   100.0       100.0
##                     2    0     0.0       100.0
##                                               
##  ascites 2    0     0    2   100.0       100.0
##                     1    0     0.0       100.0
##                                               
##  spiders 2    0     0    1    50.0        50.0
##                     1    1    50.0       100.0
##                                               
##    edema 2    0     0    0     0.0         0.0
##                   0.5    2   100.0       100.0
##                     1    0     0.0       100.0
##                                               
##    stage 2    0     3    0     0.0         0.0
##                     4    2   100.0       100.0
##                                               
## --------------------------------------------------------------------------------------- 
## edema: 1
##      var n miss level freq percent cum.percent
##      trt 3    0     1    1    33.3        33.3
##                     2    2    66.7       100.0
##                                               
##  ascites 3    0     0    0     0.0         0.0
##                     1    3   100.0       100.0
##                                               
##  spiders 3    0     0    1    33.3        33.3
##                     1    2    66.7       100.0
##                                               
##    edema 3    0     0    0     0.0         0.0
##                   0.5    0     0.0         0.0
##                     1    3   100.0       100.0
##                                               
##    stage 3    0     3    0     0.0         0.0
##                     4    3   100.0       100.0
##                                               
## 
## p-values
##         pApprox  pExact
## trt     0.22313 0.60000
## ascites 0.04979 0.10000
## spiders 0.68729 1.00000
## edema   0.01735 0.01667
## stage   0.04979 0.16667
catTable
##                  Stratified by edema
##                   0          0.5        1          p      test
##   n               1          2          3                     
##   trt = 2 (%)     0 (  0.0)  0 (  0.0)  2 ( 66.7)   0.223     
##   ascites = 1 (%) 0 (  0.0)  0 (  0.0)  3 (100.0)   0.050     
##   spiders = 1 (%) 1 (100.0)  1 ( 50.0)  2 ( 66.7)   0.687     
##   edema (%)                                         0.017     
##      0            1 (100.0)  0 (  0.0)  0 (  0.0)             
##      0.5          0 (  0.0)  2 (100.0)  0 (  0.0)             
##      1            0 (  0.0)  0 (  0.0)  3 (100.0)             
##   stage = 4 (%)   0 (  0.0)  2 (100.0)  3 (100.0)   0.050

Check environment

## List objects
ls()
##  [1] "catTable"        "contTable"       "dataFrame"       "exactlVars"      "matObj"          "nonNormalVars"  
##  [7] "pbc"             "pbcseq"          "showMessage"     "showWarning"     "smallDataFrame"  "smallStrata"    
## [13] "strata"          "strataThreeVars" "strataTwoVars"   "vars"
## Exported objects
getNamespaceExports("tableone")
##  [1] "CreateCatTable"              "CreateContTable"             "CreateTableOne"             
##  [4] "ModuleConvertNonNormal"      "ModuleConvertNormal"         "ModuleCreateStrataVarName"  
##  [7] "ModuleCreateTableForOneVar"  "ModuleQuoteAndPrintMat"      "ModuleReturnFalseIfNoStrata"
## [10] "ModuleReturnStrata"          "ModuleReturnVarsExist"       "ModuleStopIfNotDataFrame"   
## [13] "ModuleStopIfNoVarsLeft"      "ModuleTestSafe"              "print.CatTable"             
## [16] "print.ContTable"             "print.TableOne"              "sasKurtosis"                
## [19] "sasSkewness"                 "ShowRegTable"                "summary.CatTable"           
## [22] "summary.ContTable"           "summary.TableOne"            "tryCatch.W.E"
## List packages
sessionInfo()
## R version 3.0.2 (2013-09-25)
## Platform: x86_64-apple-darwin10.8.0 (64-bit)
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## attached base packages:
## [1] splines   stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] tableone_0.2.1    survival_2.37-7   gmodels_2.15.4.1  e1071_1.6-2       class_7.3-9       testthat_0.7.1   
##  [7] devtools_1.4.1    knitr_1.5         R.utils_1.29.8    R.oo_1.17.0       R.methodsS3_1.6.1
## 
## loaded via a namespace (and not attached):
##  [1] digest_0.6.4   evaluate_0.5.1 formatR_0.10   gdata_2.13.2   gtools_3.3.0   httr_0.2       MASS_7.3-29   
##  [8] memoise_0.1    parallel_3.0.2 RCurl_1.95-4.1 stringr_0.6.2  tools_3.0.2    whisker_0.3-2