tableStack: Tabulation of variables in a stack form

Description Usage Arguments Details Value Author(s) References Examples

Description

There are two functionalities: Tabulation of variables with the same possible range of distribution and stack into a new table with or without other descriptive statistics or to breakdown distribution of more than one row variables against a column variable

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
tableStack(
  vars,
  dataFrame,
  minlevel = "auto",
  maxlevel = "auto",
  count = TRUE,
  na.rm = FALSE,
  means = TRUE,
  medians = FALSE,
  sds = TRUE,
  decimal = 2,
  total = TRUE,
  var.labels = TRUE,
  var.labels.trunc = 150,
  reverse = FALSE,
  vars.to.reverse = NULL,
  by = NULL,
  vars.to.factor = NULL,
  iqr = "auto",
  prevalence = FALSE,
  percent = c("column", "row", "none"),
  frequency = TRUE,
  test = TRUE,
  name.test = TRUE,
  total.column = FALSE,
  simulate.p.value = FALSE,
  sample.size = TRUE,
  assumption.p.value = 0.01,
  NAcol = FALSE,
  NArow = FALSE,
  drplvls = FALSE
)

Arguments

vars

a vector of variables in the data frame. The imput may be given with or without quotes.

dataFrame

source data frame of the variables

minlevel

possible minimum value of items specified by user

maxlevel

possible maximum value of items specified by user

count

whether number of valid records for each item will be displayed

na.rm

whether missing value would be removed during calculation mean score of each person

means

whether means of all selected items will be displayed

medians

whether medians of all selected items will be displayed

sds

whether standard deviations of all selected items will be displayed

decimal

number of decimals displayed

total

display of means and standard deviations of total and average scores

var.labels

presence of descriptions of variables on the last column of output

var.labels.trunc

number of characters used for variable description

reverse

whether item(s) negatively correlated with other majority will be reversed

vars.to.reverse

variable(s) to reverse

by

a variable for column breakdown. If NONE is given, only the 'total column' will be displayed. More on Details.

vars.to.factor

variable(s) to be converted to factor for tabulaton

iqr

variable(s) to display median and inter-quartile range

prevalence

for logical or dichotomous variables, whether prevalence of the dichotomous row variable in each column subgroup will be displayed

percent

type of percentage displayed when the variable is categorical and for NArow when activated. Default is column

frequency

whether to display frequency in the cells when the variable is categorical and for NArow when activated

test

whether statistical test(s) will be computed

name.test

display name of the test and relevant degrees of freedom

total.column

whether to add 'total column' to the output or not

simulate.p.value

simulate P value for Fisher's exact test

sample.size

whether to display non-missing sample size of each column

assumption.p.value

level of Bartlett's test P value to judge whether the comparison and the test should be parametric

NAcol

whether to add 'NA column' to the output or not

NArow

whether to add 'NA rows' for each variable to the output or not

drplvls

whether to hide non used levels on factor and character variables or not

Details

This function is a clone of tableStack from the epiDisplay package. Comparing to the original, tt adds options to show the NA in the variables as categories, similar to the option useNA in the table function, and it also fix few bugs, such as showing the total.column without the need to test = TRUE, and to show or hide levels with zero counts without returning error.

This function simultaneously explores several variables with a fixed integer rating scale. For non-factor variables, the default values for tabulation are the minimum and the maximum of all variables but can be specified by the user.

When 'by' is omitted, all variables must be of the same class, and must be 'integer', 'factor' or 'logical. Some parameters are only used if by is omitted, others are only used if by is available. The by-omitted dependent variable are minlevel, maxlevel, count, na.rm, means, medians, sds, total, reverse, vars.to.reverse. The by-available dependent variables are iqr, prevalence, percent, frequency, test, name.test, total.column, simulate.p.value, sample.size, assumption.p.value, NArow, NAcol, drplvls. Unlike function 'alpha', the argument 'reverse' has a default value of FALSE. This argument is ignored if 'vars.to.reverse' is specified.

Options for 'reverse', 'vars.to.reverse' and statistics of 'means', 'medians', 'sds' and 'total' are available only if the items are not factor. To obtain statistics of factor items, users need to use 'unclassDataframe' to convert them into integer.

When the 'by' argument is given, 'reverse' and 'vars.to.reverse' do not apply, as mentioned before. Instead, columns of the 'by' variable will be formed. A table will be created against each selected variable. If the variable is a factor or coerced to factor with 'vars.to.factor', cross-tabulation will result with percents as specified, ie. "column", "row", or "none" (FALSE). For a dichotomous row variable, if set to 'TRUE', the prevalence of row variable in the form of a fraction is displayed in each subgroup column. For objects of class 'numeric' or 'integer', means with standard deviations will be displayed. For variables with residuals that are not normally distributed or where the variance of subgroups are significantly not normally distributed (using a significance level of 0.01), medians and inter-quartile ranges will be presented if the argument 'iqr' is set to "auto" (by default). Users may specify a subset of the selected variables (from the 'vars' argument) to be presented in such a form. Otherwise, the argument could be set as any other character string, except the variables names, to insist to present means and standard deviations.

When 'test = TRUE' (default), Pearson's chi-squared test (or a two-sided Fisher's exact test, if the sample size is small) will be carried out for a categorical variable or a factor. Parametric or non-parametric comparison and test will be carried out for a object of class 'numeric' or 'integer' (See 'iqr' and 'assumption.p.value' below). If the sample size of the numeric variable is too small in any group, the test is omitted and the problem reported.

For Fisher's exact test, the default method employs 'simulate.p.value = FALSE'. See further explanation in 'fisher.test' procedure. If the dataset is extraordinarily large, the option may be manually set to TRUE.

When 'by' is specified as a single character object (such as 'by="none"') or when 'by = NONE' there will be no column breakdown and all tests will be omitted. Only the total column is displayed. Only the 'total' column is shown.

If this 'total column' is to accompany the 'by' breakdown, the argument 'total.column=TRUE' should be specified. The 'sample.size' is TRUE by default. The total number of records for each group is displayed in the first row of the output. However, the variable in each row may have some missing records, the information on which is reported by NArow for each variable on 'vars' and by NAcol for the variable on 'by'.

By default, Epicalc sets 'var.labels=TRUE' in order to give nice output. However, 'var.labels=FALSE' can sometimes be more useful during data exploration. Variable numbers as well as variable names are displayed instead of variable labels. Names and numbers of abnormally distributed variables, especially factors with too many levels, can be easily identified for further relevelling or recoding.

The argument 'iqr' has a default value being "auto". Non-parametric comparison and test will be automatically chosen if Bartlett's test P value is below the 'assumption.p.value'.

The test can be forced to parametric by setting 'iqr=NULL' and to non-parametric by if iqr is set to the variable number of cont.var (See examples.).

Value

an object of class 'tableStack' and 'list' when by=NULL

results an object of class 'noquote' which is used for print out
items.reversed name(s) of variable(s) reversed
total.score a vector from 'rowSums' of the columns of variables specified in 'vars'
mean.score a vector from 'rowMeans' of the columns of variables specified in 'vars'
mean.of.total.scores mean of total scores
sd.of.total.scores standard deviation of total scores
mean.of.average.scores mean of mean scores
sd.of.average.scores standard deviation of mean scores

When 'by' is specified, an object of class 'tableStack' and 'table is returned.

Author(s)

Virasakdi Chongsuvivatwong <cvirasak@medicine.psu.ac.th>

Caio Ferreira <caio.ferreira@epimedsolutions.com>

Lunna Borges <caio.ferreira@epimedsolutions.com>

Pedro Brasil <pedro.brasil@epimedsolutions.com>

References

'table', 'tab1', 'summ', 'alpha', 'unclassDataframe'

Examples

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
set.seed(1)
data <- data.frame(sex = sample(c("M","F"), 50, rep = TRUE),
age = sample(c(NA,20:70), 50, rep = TRUE),
admissionType = sample(c(NA,"urgency", "clinical", "scheduled"), 50, rep = TRUE),
hospitalizationTime = sample(c(0:10), 50, rep = TRUE),
numberOfChildren = sample(c(NA,0:3), 50, rep = TRUE),
cancerInFamily = sample(c(NA,TRUE,FALSE), 50, rep = TRUE),
diabetesInFamily = sample(c(TRUE,FALSE), 50, rep = TRUE),
thrombosisInFamily = sample(c(TRUE,FALSE), 50, rep = TRUE),
mentaldiseasesInFamily = sample(c(TRUE,FALSE), 50, rep = TRUE),
cardiadicdiseaseInFamily = sample(c(NA,TRUE,FALSE), 50, rep = TRUE),
readmission = sample(c(NA,TRUE,FALSE), 50, rep = TRUE))

attach(data)
tableStack(cancerInFamily:cardiadicdiseaseInFamily, dataFrame = data)
detach(data)
tableStack(cancerInFamily:cardiadicdiseaseInFamily, data) # Default data frame is data
# "by" compares variables
tableStack(cancerInFamily:cardiadicdiseaseInFamily, data, by= readmission)
# "prevalence" returns the prevalence instead of the absolute values
tableStack(cancerInFamily:cardiadicdiseaseInFamily, data,
by= readmission, prevalence=TRUE)
# "percent" as FALSE hides the percentage in parenthesis
tableStack(cancerInFamily:cardiadicdiseaseInFamily, data,
by= readmission, percent=FALSE)
# "name.test" as FALSE hides the column that shows the tests names
tableStack(cancerInFamily:cardiadicdiseaseInFamily, data,
by= readmission, percent=FALSE, name.test=FALSE)
# "NAcol" displays a column of NA values on the variable on "by"
tableStack(cancerInFamily:cardiadicdiseaseInFamily, data,
by= readmission, NAcol = TRUE)
# "NArow" displays rows of NA values on the variables on "vars"
tableStack(cancerInFamily:cardiadicdiseaseInFamily, data,
by= readmission, NAcol = TRUE, NArow = TRUE)

# the specification of the vars may be done as the range
tableStack(vars=2:7, data, by=sex)
# "by" var may be specified as "none" and the selected vars will be crossed only against the total
tableStack(vars=2:7, data, by="none")
# by = NONE works just as by = "none"
tableStack(vars=2:7, data, by = NONE)
# total.column displays a column of totals in adition to the variable on by
tableStack(vars=2:7, data, by=sex, total.column=TRUE)

var.labels <- c("sex", "Type of admission for each patient",
"age", "Duration time in days of the patient's hospitalization",
"Number of children that the patient have",
"whether or not the patient has cancer in family",
"whether or not the patient has diabetes in family",
"whether or not the patient has thrombosis in family",
"whether or not the patient has mental diseases in family",
"whether or not the patient has cardiac diseases in family",
"whether or not the patient is on a relapse admission")
#setting the attribute var.labels
attr(data, "var.labels") <- var.labels
rm(var.labels)

# May need full screen of Rconsole
tableStack(vars=c(numberOfChildren,hospitalizationTime), data)
# Fits in with default R console screen
tableStack(vars=c(numberOfChildren,hospitalizationTime), data,
var.labels.trunc=35)
tableStack(vars=c(age,numberOfChildren,hospitalizationTime),
data, reverse=TRUE) -> a
a
## Components of 'a' have appropriate items reversed
a$mean.score -> mean.score
a$total.score -> total.score
data$mean.score <- mean.score
data$total.score <- total.score

# hiding the test column
tableStack(c(age, numberOfChildren,hospitalizationTime,
mean.score,total.score), data, by=sex, test=FALSE)
# variables specified on iqr will not display SD but IQR instead
tableStack(3:5, data, by=sex, iqr=hospitalizationTime)
## 'vars' can be mixture of variables of different classes
tableStack(3:5, data, by=admissionType,
iqr=c(hospitalizationTime, total.score))

data$highscore <- mean.score > 4
# a variable with some comparison may be created easily
tableStack(mean.score:highscore, data,
by=sex, iqr=total.score)

# the percentage information may be hidden
tableStack(vars=c(readmission,admissionType),
data, by=sex, percent="none")
# it may be shown the prevalende of the
# variable instead of the values themselves
tableStack(vars=c(readmission,admissionType), data,
by=sex, prevalence = TRUE)
# the name of the tests may be hidden
# while the test itself still shows
tableStack(vars=c(readmission,admissionType), data,
by=sex, name.test = FALSE)

## Variable in numeric or factor
# as continuous varaibles
tableStack(vars=3:5, data, by=sex)
# as factors
tableStack(vars=3:5, data, by=sex, vars.to.factor = 3:5)

## Using drplvls
# a dataframe will be created containing a factor with an unused level
bloodbank <- data.frame(AgeInDays =
    sample(0:15,200, replace = TRUE), Type =
    factor(sample(c("A","B","0"), 200, replace = TRUE),
      levels = c("A","B","AB","0")), Origin =
    sample(c("US","CA"), 200, replace = TRUE))

# by using drplvls the row of the unused fator is hidden
tableStack(vars = c(AgeInDays, Type),
bloodbank, by = Origin) #usual
tableStack(vars = c(AgeInDays, Type),
bloodbank, by = Origin,
drplvls = TRUE) # with drplvls

rm(total.score, mean.score, a, data, bloodbank)

Example output

$results
                         FALSE TRUE count mean sd  
cancerInFamily           16    15   31    0.48 0.51
diabetesInFamily         21    29   50    0.58 0.50
thrombosisInFamily       25    25   50    0.50 0.51
mentaldiseasesInFamily   16    34   50    0.68 0.47
cardiadicdiseaseInFamily 8     19   27    0.70 0.47
 Total score                        18    2.44 1.20
 Average score                      18    0.49 0.24

attr(,"class")
[1] "tableStack" "list"      
$results
                         FALSE TRUE count mean sd  
cancerInFamily           16    15   31    0.48 0.51
diabetesInFamily         21    29   50    0.58 0.50
thrombosisInFamily       25    25   50    0.50 0.51
mentaldiseasesInFamily   16    34   50    0.68 0.47
cardiadicdiseaseInFamily 8     19   27    0.70 0.47
 Total score                        18    2.44 1.20
 Average score                      18    0.49 0.24

attr(,"class")
[1] "tableStack" "list"      
                         FALSE      TRUE       Test stat.            P.Value
Total                    18         19                                      
                                                                            
cancerInFamily                                 Fisher's exact test   0.6882 
   FALSE                 7 (43.75)  5 (55.56)                               
   TRUE                  9 (56.25)  4 (44.44)                               
                                                                            
diabetesInFamily                               Chisq. (1 df) = 0.029 0.8658 
   FALSE                 8 (44.44)  10 (52.63)                              
   TRUE                  10 (55.56) 9 (47.37)                               
                                                                            
thrombosisInFamily                             Chisq. (1 df) = 0.029 0.8658 
   FALSE                 10 (55.56) 9 (47.37)                               
   TRUE                  8 (44.44)  10 (52.63)                              
                                                                            
mentaldiseasesInFamily                         Chisq. (1 df) = 0.015 0.9037 
   FALSE                 7 (38.89)  6 (31.58)                               
   TRUE                  11 (61.11) 13 (68.42)                              
                                                                            
cardiadicdiseaseInFamily                       Fisher's exact test   0.6424 
   No                    4 (36.36)  2 (22.22)                               
   Yes                   7 (63.64)  7 (77.78)                               
                                                                            
                               FALSE          TRUE          
Total                          18             19            
                                                            
cancerInFamily                                              
  prevalence                   9/16 (56.25%)  4/9 (44.44%)  
                                                            
diabetesInFamily                                            
  prevalence                   10/18 (55.56%) 9/19 (47.37%) 
                                                            
thrombosisInFamily                                          
  prevalence                   8/18 (44.44%)  10/19 (52.63%)
                                                            
mentaldiseasesInFamily                                      
  prevalence                   11/18 (61.11%) 13/19 (68.42%)
                                                            
cardiadicdiseaseInFamily = Yes                              
  prevalence                   7/11 (63.64%)  7/9 (77.78%)  
                                                            
                               Test stat.            P.Value
Total                                                       
                                                            
cancerInFamily                 Fisher's exact test   0.6882 
  prevalence                                                
                                                            
diabetesInFamily               Chisq. (1 df) = 0.029 0.8658 
  prevalence                                                
                                                            
thrombosisInFamily             Chisq. (1 df) = 0.029 0.8658 
  prevalence                                                
                                                            
mentaldiseasesInFamily         Chisq. (1 df) = 0.015 0.9037 
  prevalence                                                
                                                            
cardiadicdiseaseInFamily = Yes Fisher's exact test   0.6424 
  prevalence                                                
                                                            
                         FALSE TRUE Test stat.            P.Value
Total                    18    19                                
                                                                 
cancerInFamily                      Fisher's exact test   0.6882 
   FALSE                 7     5                                 
   TRUE                  9     4                                 
                                                                 
diabetesInFamily                    Chisq. (1 df) = 0.029 0.8658 
   FALSE                 8     10                                
   TRUE                  10    9                                 
                                                                 
thrombosisInFamily                  Chisq. (1 df) = 0.029 0.8658 
   FALSE                 10    9                                 
   TRUE                  8     10                                
                                                                 
mentaldiseasesInFamily              Chisq. (1 df) = 0.015 0.9037 
   FALSE                 7     6                                 
   TRUE                  11    13                                
                                                                 
cardiadicdiseaseInFamily            Fisher's exact test   0.6424 
   No                    4     2                                 
   Yes                   7     7                                 
                                                                 
                         FALSE TRUE P.Value
Total                    18    19          
                                           
cancerInFamily                      0.6882 
   FALSE                 7     5           
   TRUE                  9     4           
                                           
diabetesInFamily                    0.8658 
   FALSE                 8     10          
   TRUE                  10    9           
                                           
thrombosisInFamily                  0.8658 
   FALSE                 10    9           
   TRUE                  8     10          
                                           
mentaldiseasesInFamily              0.9037 
   FALSE                 7     6           
   TRUE                  11    13          
                                           
cardiadicdiseaseInFamily            0.6424 
   No                    4     2           
   Yes                   7     7           
                                           
                         FALSE      TRUE       NA         Test stat.           
Total                    18         19         13                              
                                                                               
cancerInFamily                                            Fisher's exact test  
   FALSE                 7 (43.75)  5 (55.56)  4 (66.67)                       
   TRUE                  9 (56.25)  4 (44.44)  2 (33.33)                       
                                                                               
diabetesInFamily                                          Chisq. (1 df) = 0.029
   FALSE                 8 (44.44)  10 (52.63) 3 (23.08)                       
   TRUE                  10 (55.56) 9 (47.37)  10 (76.92)                      
                                                                               
thrombosisInFamily                                        Chisq. (1 df) = 0.029
   FALSE                 10 (55.56) 9 (47.37)  6 (46.15)                       
   TRUE                  8 (44.44)  10 (52.63) 7 (53.85)                       
                                                                               
mentaldiseasesInFamily                                    Chisq. (1 df) = 0.015
   FALSE                 7 (38.89)  6 (31.58)  3 (23.08)                       
   TRUE                  11 (61.11) 13 (68.42) 10 (76.92)                      
                                                                               
cardiadicdiseaseInFamily                                  Fisher's exact test  
   No                    4 (36.36)  2 (22.22)  2 (28.57)                       
   Yes                   7 (63.64)  7 (77.78)  5 (71.43)                       
                                                                               
                         P.Value
Total                           
                                
cancerInFamily           0.6882 
   FALSE                        
   TRUE                         
                                
diabetesInFamily         0.8658 
   FALSE                        
   TRUE                         
                                
thrombosisInFamily       0.8658 
   FALSE                        
   TRUE                         
                                
mentaldiseasesInFamily   0.9037 
   FALSE                        
   TRUE                         
                                
cardiadicdiseaseInFamily 0.6424 
   No                           
   Yes                          
                                
                         FALSE      TRUE       NA         Test stat.           
Total                    18         19         13                              
                                                                               
cancerInFamily                                            Chisq. (1 df) = 0.023
   FALSE                 7 (38.89)  5 (26.32)  4 (30.77)                       
   TRUE                  9 (50.00)  4 (21.05)  2 (15.38)                       
   NA                    2 (11.11)  10 (52.63) 7 (53.85)                       
                                                                               
diabetesInFamily                                          Fisher's exact test  
   FALSE                 8 (44.44)  10 (52.63) 3 (23.08)                       
   TRUE                  10 (55.56) 9 (47.37)  10 (76.92)                      
   NA                    0 (0.00)   0 (0.00)   0 (0.00)                        
                                                                               
thrombosisInFamily                                        Fisher's exact test  
   FALSE                 10 (55.56) 9 (47.37)  6 (46.15)                       
   TRUE                  8 (44.44)  10 (52.63) 7 (53.85)                       
   NA                    0 (0.00)   0 (0.00)   0 (0.00)                        
                                                                               
mentaldiseasesInFamily                                    Fisher's exact test  
   FALSE                 7 (38.89)  6 (31.58)  3 (23.08)                       
   TRUE                  11 (61.11) 13 (68.42) 10 (76.92)                      
   NA                    0 (0.00)   0 (0.00)   0 (0.00)                        
                                                                               
cardiadicdiseaseInFamily                                  Chisq. (1 df) = 0.038
   No                    4 (22.22)  2 (10.53)  2 (15.38)                       
   Yes                   7 (38.89)  7 (36.84)  5 (38.46)                       
   NA                    7 (38.89)  10 (52.63) 6 (46.15)                       
                                                                               
                         P.Value
Total                           
                                
cancerInFamily           0.8807 
   FALSE                        
   TRUE                         
   NA                           
                                
diabetesInFamily         0.7459 
   FALSE                        
   TRUE                         
   NA                           
                                
thrombosisInFamily       0.7459 
   FALSE                        
   TRUE                         
   NA                           
                                
mentaldiseasesInFamily   0.7374 
   FALSE                        
   TRUE                         
   NA                           
                                
cardiadicdiseaseInFamily 0.8445 
   No                           
   Yes                          
   NA                           
                                
                    F                  M                 
Total               23                 27                
                                                         
age                                                      
  mean (SD)         44.68 (12.16)      48.96 (16.11)     
                                                         
admissionType                                            
   clinical         7 (36.84)          9 (42.86)         
   scheduled        5 (26.32)          5 (23.81)         
   urgency          7 (36.84)          7 (33.33)         
                                                         
hospitalizationTime                                      
  median (IQR)      4.00 (1.00 - 6.50) 3.00 (2.00 - 7.50)
                                                         
numberOfChildren                                         
  median (IQR)      2.00 (0.00 - 3.00) 2.00 (1.75 - 3.00)
                                                         
cancerInFamily                                           
   FALSE            8 (57.14)          8 (47.06)         
   TRUE             6 (42.86)          9 (52.94)         
                                                         
diabetesInFamily                                         
   No               9 (39.13)          12 (44.44)        
   Yes              14 (60.87)         15 (55.56)        
                                                         
                    Test stat.              P.Value
Total                                              
                                                   
age                 t-test  (47 df) = 1.030 0.3084 
  mean (SD)                                        
                                                   
admissionType       Chisq. (2 df) = 0.150   0.9276 
   clinical                                        
   scheduled                                       
   urgency                                         
                                                   
hospitalizationTime Ranksum test            0.4386 
  median (IQR)                                     
                                                   
numberOfChildren    Ranksum test            0.2969 
  median (IQR)                                     
                                                   
cancerInFamily      Chisq. (1 df) = 0.039   0.8430 
   FALSE                                           
   TRUE                                            
                                                   
diabetesInFamily    Chisq. (1 df) = 0.008   0.9267 
   No                                              
   Yes                                             
                                                   
                    Total        
Total               50           
                                 
age                              
  mean (SD)         47.04 (14.49)
                                 
admissionType                    
   clinical         16 (40.00)   
   scheduled        10 (25.00)   
   urgency          14 (35.00)   
                                 
hospitalizationTime              
  mean (SD)         4.26 (3.20)  
                                 
numberOfChildren                 
  mean (SD)         1.86 (1.16)  
                                 
cancerInFamily                   
   FALSE            16 (51.61)   
   TRUE             15 (48.39)   
                                 
diabetesInFamily                 
   No               21 (42.00)   
   Yes              29 (58.00)   
                                 
                    Total        
Total               50           
                                 
age                              
  mean (SD)         47.04 (14.49)
                                 
admissionType                    
   clinical         16 (40.00)   
   scheduled        10 (25.00)   
   urgency          14 (35.00)   
                                 
hospitalizationTime              
  mean (SD)         4.26 (3.20)  
                                 
numberOfChildren                 
  mean (SD)         1.86 (1.16)  
                                 
cancerInFamily                   
   FALSE            16 (51.61)   
   TRUE             15 (48.39)   
                                 
diabetesInFamily                 
   No               21 (42.00)   
   Yes              29 (58.00)   
                                 
                    F                  M                  Total             
Total               23                 27                 50                
                                                                            
age                                                                         
  mean (SD)         44.68 (12.16)      48.96 (16.11)      47.04 (14.49)     
                                                                            
admissionType                                                               
   clinical         7 (36.84)          9 (42.86)          16 (40.00)        
   scheduled        5 (26.32)          5 (23.81)          10 (25.00)        
   urgency          7 (36.84)          7 (33.33)          14 (35.00)        
                                                                            
hospitalizationTime                                                         
  median (IQR)      4.00 (1.00 - 6.50) 3.00 (2.00 - 7.50) 3.50 (2.00 - 7.00)
                                                                            
numberOfChildren                                                            
  median (IQR)      2.00 (0.00 - 3.00) 2.00 (1.75 - 3.00) 2.00 (1.00 - 3.00)
                                                                            
cancerInFamily                                                              
   FALSE            8 (57.14)          8 (47.06)          16 (51.61)        
   TRUE             6 (42.86)          9 (52.94)          15 (48.39)        
                                                                            
diabetesInFamily                                                            
   No               9 (39.13)          12 (44.44)         21 (42.00)        
   Yes              14 (60.87)         15 (55.56)         29 (58.00)        
                                                                            
                    Test stat.              P.Value
Total                                              
                                                   
age                 t-test  (47 df) = 1.030 0.3084 
  mean (SD)                                        
                                                   
admissionType       Chisq. (2 df) = 0.150   0.9276 
   clinical                                        
   scheduled                                       
   urgency                                         
                                                   
hospitalizationTime Ranksum test            0.4386 
  median (IQR)                                     
                                                   
numberOfChildren    Ranksum test            0.2969 
  median (IQR)                                     
                                                   
cancerInFamily      Chisq. (1 df) = 0.039   0.8430 
   FALSE                                           
   TRUE                                            
                                                   
diabetesInFamily    Chisq. (1 df) = 0.008   0.9267 
   No                                              
   Yes                                             
                                                   
$results
                    0 1 2  3  4 5 6 7 8 9 10 count mean sd  
numberOfChildren    8 3 12 14 0 0 0 0 0 0 0  37    1.86 1.16
hospitalizationTime 5 7 10 3  2 4 4 4 5 3 3  50    4.26 3.20
 Total score                                 37    6.05 3.61
 Average score                               37    3.03 1.81
                    description                                           
numberOfChildren    Number of children that the patient have              
hospitalizationTime Duration time in days of the patient's hospitalization
 Total score                                                              
 Average score                                                            

$item.labels
[1] "Number of children that the patient have"              
[2] "Duration time in days of the patient's hospitalization"

$total.score
 [1]  5  7  6 NA  7  3  5  7  4  8  2 NA  1 NA NA  9  8 NA  2  8 13  8 NA NA 10
[26]  5 NA  5  5  1  0 NA 11 12  9  4  1  4  0  4 13  4  4 NA 10  9 NA NA 10 NA

$mean.score
 [1] 2.5 3.5 3.0  NA 3.5 1.5 2.5 3.5 2.0 4.0 1.0  NA 0.5  NA  NA 4.5 4.0  NA 1.0
[20] 4.0 6.5 4.0  NA  NA 5.0 2.5  NA 2.5 2.5 0.5 0.0  NA 5.5 6.0 4.5 2.0 0.5 2.0
[39] 0.0 2.0 6.5 2.0 2.0  NA 5.0 4.5  NA  NA 5.0  NA

$mean.of.total.scores
[1] 6.054054

$sd.of.total.scores
[1] 3.612832

$mean.of.average.scores
[1] 3.027027

$sd.of.average.scores
[1] 1.806416

attr(,"class")
[1] "tableStack" "list"      
$results
                    0 1 2  3  4 5 6 7 8 9 10 count mean sd  
numberOfChildren    8 3 12 14 0 0 0 0 0 0 0  37    1.86 1.16
hospitalizationTime 5 7 10 3  2 4 4 4 5 3 3  50    4.26 3.20
 Total score                                 37    6.05 3.61
 Average score                               37    3.03 1.81
                    description                        
numberOfChildren    Number of children that the patient
hospitalizationTime Duration time in days of the patien
 Total score                                           
 Average score                                         

$item.labels
[1] "Number of children that the patient have"              
[2] "Duration time in days of the patient's hospitalization"

$total.score
 [1]  5  7  6 NA  7  3  5  7  4  8  2 NA  1 NA NA  9  8 NA  2  8 13  8 NA NA 10
[26]  5 NA  5  5  1  0 NA 11 12  9  4  1  4  0  4 13  4  4 NA 10  9 NA NA 10 NA

$mean.score
 [1] 2.5 3.5 3.0  NA 3.5 1.5 2.5 3.5 2.0 4.0 1.0  NA 0.5  NA  NA 4.5 4.0  NA 1.0
[20] 4.0 6.5 4.0  NA  NA 5.0 2.5  NA 2.5 2.5 0.5 0.0  NA 5.5 6.0 4.5 2.0 0.5 2.0
[39] 0.0 2.0 6.5 2.0 2.0  NA 5.0 4.5  NA  NA 5.0  NA

$mean.of.total.scores
[1] 6.054054

$sd.of.total.scores
[1] 3.612832

$mean.of.average.scores
[1] 3.027027

$sd.of.average.scores
[1] 1.806416

attr(,"class")
[1] "tableStack" "list"      
$results
                    Reversed 0 1 2  3  4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
age                     .    0 0 0  0  0 0 0 0 0 0 0  0  0  0  0  0  0  0  0 
numberOfChildren        .    8 3 12 14 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0 
hospitalizationTime     .    5 7 10 3  2 4 4 4 5 3 3  0  0  0  0  0  0  0  0 
 Total score                                                                 
 Average score                                                               
                    19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
age                 0  1  0  0  0  5  0  0  0  0  1  0  2  2  0  0  1  1  0  1 
numberOfChildren    0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
hospitalizationTime 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
 Total score                                                                   
 Average score                                                                 
                    39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
age                 1  2  2  1  3  0  0  1  2  0  0  1  1  0  0  1  0  1  3  4 
numberOfChildren    0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
hospitalizationTime 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
 Total score                                                                   
 Average score                                                                 
                    59 60 61 62 63 64 65 66 67 68 69 count mean  sd   
age                 0  1  0  3  2  1  0  2  0  0  3  49    47.04 14.49
numberOfChildren    0  0  0  0  0  0  0  0  0  0  0  37    1.86  1.16 
hospitalizationTime 0  0  0  0  0  0  0  0  0  0  0  50    4.26  3.20 
 Total score                                         36    53.89 16.72
 Average score                                       36    17.96 5.57 
                    description                                           
age                 Type of admission for each patient                    
numberOfChildren    Number of children that the patient have              
hospitalizationTime Duration time in days of the patient's hospitalization
 Total score                                                              
 Average score                                                            

$items.reversed
character(0)

$item.labels
[1] "Type of admission for each patient"                    
[2] "Number of children that the patient have"              
[3] "Duration time in days of the patient's hospitalization"

$total.score
 [1] 29 65 68 NA 31 60 74 67 28 50 52 NA 21 NA NA 49 40 NA NA 77 82 66 NA NA 72
[26] 29 NA 62 34 36 54 NA 69 55 75 47 42 68 38 61 60 35 44 NA 56 71 NA NA 73 NA

$mean.score
 [1]  9.666667 21.666667 22.666667        NA 10.333333 20.000000 24.666667
 [8] 22.333333  9.333333 16.666667 17.333333        NA  7.000000        NA
[15]        NA 16.333333 13.333333        NA        NA 25.666667 27.333333
[22] 22.000000        NA        NA 24.000000  9.666667        NA 20.666667
[29] 11.333333 12.000000 18.000000        NA 23.000000 18.333333 25.000000
[36] 15.666667 14.000000 22.666667 12.666667 20.333333 20.000000 11.666667
[43] 14.666667        NA 18.666667 23.666667        NA        NA 24.333333
[50]        NA

$mean.of.total.scores
[1] 53.88889

$sd.of.total.scores
[1] 16.72257

$mean.of.average.scores
[1] 17.96296

$sd.of.average.scores
[1] 5.574191

attr(,"class")
[1] "tableStack" "list"      
                                                       F                 
Total                                                  23                
                                                                         
Type of admission for each patient                                       
  mean (SD)                                            44.68 (12.16)     
                                                                         
Number of children that the patient have                                 
  median (IQR)                                         2.00 (0.00 - 3.00)
                                                                         
Duration time in days of the patient's hospitalization                   
  median (IQR)                                         4.00 (1.00 - 6.50)
                                                                         
<NA>                                                                     
  mean (SD)                                            16.06 (4.29)      
                                                                         
<NA>                                                                     
  mean (SD)                                            48.19 (12.87)     
                                                                         
                                                       M                 
Total                                                  27                
                                                                         
Type of admission for each patient                                       
  mean (SD)                                            48.96 (16.11)     
                                                                         
Number of children that the patient have                                 
  median (IQR)                                         2.00 (1.75 - 3.00)
                                                                         
Duration time in days of the patient's hospitalization                   
  median (IQR)                                         3.00 (2.00 - 7.50)
                                                                         
<NA>                                                                     
  mean (SD)                                            19.48 (6.10)      
                                                                         
<NA>                                                                     
  mean (SD)                                            58.45 (18.30)     
                                                                         
                                                       F                 
Total                                                  23                
                                                                         
age                                                                      
   clinical                                            7 (36.84)         
   scheduled                                           5 (26.32)         
   urgency                                             7 (36.84)         
                                                                         
Duration time in days of the patient's hospitalization                   
  median (IQR)                                         4.00 (1.00 - 6.50)
                                                                         
Number of children that the patient have                                 
  mean (SD)                                            1.65 (1.22)       
                                                                         
                                                       M                 
Total                                                  27                
                                                                         
age                                                                      
   clinical                                            9 (42.86)         
   scheduled                                           5 (23.81)         
   urgency                                             7 (33.33)         
                                                                         
Duration time in days of the patient's hospitalization                   
  median (IQR)                                         3.00 (2.00 - 7.50)
                                                                         
Number of children that the patient have                                 
  mean (SD)                                            2.05 (1.10)       
                                                                         
                                                       Test stat.             
Total                                                                         
                                                                              
age                                                    Chisq. (2 df) = 0.150  
   clinical                                                                   
   scheduled                                                                  
   urgency                                                                    
                                                                              
Duration time in days of the patient's hospitalization Ranksum test           
  median (IQR)                                                                
                                                                              
Number of children that the patient have               t-test  (35 df) = 1.056
  mean (SD)                                                                   
                                                                              
                                                       P.Value
Total                                                         
                                                              
age                                                    0.9276 
   clinical                                                   
   scheduled                                                  
   urgency                                                    
                                                              
Duration time in days of the patient's hospitalization 0.4386 
  median (IQR)                                                
                                                              
Number of children that the patient have               0.2982 
  mean (SD)                                                   
                                                              
                                                       clinical          
Total                                                  16                
                                                                         
age                                                                      
   clinical                                            16 (100.00)       
   scheduled                                           0 (0.00)          
   urgency                                             0 (0.00)          
                                                                         
Duration time in days of the patient's hospitalization                   
  median (IQR)                                         2.00 (1.75 - 5.25)
                                                                         
Number of children that the patient have                                 
  mean (SD)                                            2.33 (1.15)       
                                                                         
                                                       scheduled         
Total                                                  10                
                                                                         
age                                                                      
   clinical                                            0 (0.00)          
   scheduled                                           10 (100.00)       
   urgency                                             0 (0.00)          
                                                                         
Duration time in days of the patient's hospitalization                   
  median (IQR)                                         2.00 (1.00 - 5.75)
                                                                         
Number of children that the patient have                                 
  mean (SD)                                            1.40 (1.17)       
                                                                         
                                                       urgency           
Total                                                  14                
                                                                         
age                                                                      
   clinical                                            0 (0.00)          
   scheduled                                           0 (0.00)          
   urgency                                             14 (100.00)       
                                                                         
Duration time in days of the patient's hospitalization                   
  median (IQR)                                         5.50 (3.25 - 6.75)
                                                                         
Number of children that the patient have                                 
  mean (SD)                                            1.88 (0.83)       
                                                                         
                                                       Test stat.                     
Total                                                                                 
                                                                                      
age                                                    Fisher's exact test            
   clinical                                                                           
   scheduled                                                                          
   urgency                                                                            
                                                                                      
Duration time in days of the patient's hospitalization Kruskal-Wallis test            
  median (IQR)                                                                        
                                                                                      
Number of children that the patient have               ANOVA F-test (2, 27 df) = 2.011
  mean (SD)                                                                           
                                                                                      
                                                       P.Value
Total                                                         
                                                              
age                                                    < 0.001
   clinical                                                   
   scheduled                                                  
   urgency                                                    
                                                              
Duration time in days of the patient's hospitalization 0.0877 
  median (IQR)                                                
                                                              
Number of children that the patient have               0.1534 
  mean (SD)                                                   
                                                              
               F                     M                    
Total          23                    27                   
                                                          
<NA>                                                      
  mean (SD)    16.06 (4.29)          19.48 (6.10)         
                                                          
<NA>                                                      
  median (IQR) 49.50 (37.50 - 57.00) 66.50 (46.25 - 72.25)
                                                          
<NA>                                                      
   No          16 (100.00)           20 (100.00)          
   Yes         0 (0.00)              0 (0.00)             
                                                          
               Test stat.              P.Value
Total                                         
                                              
<NA>           t-test  (34 df) = 1.896 0.0664 
  mean (SD)                                   
                                              
<NA>           Ranksum test            0.0416 
  median (IQR)                                
                                              
<NA>           Fisher's exact test     1.0000 
   No                                         
   Yes                                        
                                              
                                                     F  M 
Total                                                23 27
                                                          
whether or not the patient is on a relapse admission      
   FALSE                                             8  10
   TRUE                                              9  10
                                                          
age                                                       
   clinical                                          7  9 
   scheduled                                         5  5 
   urgency                                           7  7 
                                                          
                                                     Test stat.           
Total                                                                     
                                                                          
whether or not the patient is on a relapse admission Chisq. (1 df) = 0.000
   FALSE                                                                  
   TRUE                                                                   
                                                                          
age                                                  Chisq. (2 df) = 0.150
   clinical                                                               
   scheduled                                                              
   urgency                                                                
                                                                          
                                                     P.Value
Total                                                       
                                                            
whether or not the patient is on a relapse admission 1.0000 
   FALSE                                                    
   TRUE                                                     
                                                            
age                                                  0.9276 
   clinical                                                 
   scheduled                                                
   urgency                                                  
                                                            
                                                     F            
Total                                                23           
                                                                  
whether or not the patient is on a relapse admission              
  prevalence                                         9/17 (52.94%)
                                                                  
age                                                               
   clinical                                          7 (36.84)    
   scheduled                                         5 (26.32)    
   urgency                                           7 (36.84)    
                                                                  
                                                     M             
Total                                                27            
                                                                   
whether or not the patient is on a relapse admission               
  prevalence                                         10/20 (50.00%)
                                                                   
age                                                                
   clinical                                          9 (42.86)     
   scheduled                                         5 (23.81)     
   urgency                                           7 (33.33)     
                                                                   
                                                     Test stat.           
Total                                                                     
                                                                          
whether or not the patient is on a relapse admission Chisq. (1 df) = 0.000
  prevalence                                                              
                                                                          
age                                                  Chisq. (2 df) = 0.150
   clinical                                                               
   scheduled                                                              
   urgency                                                                
                                                                          
                                                     P.Value
Total                                                       
                                                            
whether or not the patient is on a relapse admission 1.0000 
  prevalence                                                
                                                            
age                                                  0.9276 
   clinical                                                 
   scheduled                                                
   urgency                                                  
                                                            
                                                     F         M         
Total                                                23        27        
                                                                         
whether or not the patient is on a relapse admission                     
   FALSE                                             8 (47.06) 10 (50.00)
   TRUE                                              9 (52.94) 10 (50.00)
                                                                         
age                                                                      
   clinical                                          7 (36.84) 9 (42.86) 
   scheduled                                         5 (26.32) 5 (23.81) 
   urgency                                           7 (36.84) 7 (33.33) 
                                                                         
                                                     P.Value
Total                                                       
                                                            
whether or not the patient is on a relapse admission 1.0000 
   FALSE                                                    
   TRUE                                                     
                                                            
age                                                  0.9276 
   clinical                                                 
   scheduled                                                
   urgency                                                  
                                                            
                                                       F                 
Total                                                  23                
                                                                         
age                                                                      
   clinical                                            7 (36.84)         
   scheduled                                           5 (26.32)         
   urgency                                             7 (36.84)         
                                                                         
Duration time in days of the patient's hospitalization                   
  median (IQR)                                         4.00 (1.00 - 6.50)
                                                                         
Number of children that the patient have                                 
  median (IQR)                                         2.00 (0.00 - 3.00)
                                                                         
                                                       M                 
Total                                                  27                
                                                                         
age                                                                      
   clinical                                            9 (42.86)         
   scheduled                                           5 (23.81)         
   urgency                                             7 (33.33)         
                                                                         
Duration time in days of the patient's hospitalization                   
  median (IQR)                                         3.00 (2.00 - 7.50)
                                                                         
Number of children that the patient have                                 
  median (IQR)                                         2.00 (1.75 - 3.00)
                                                                         
                                                       Test stat.           
Total                                                                       
                                                                            
age                                                    Chisq. (2 df) = 0.150
   clinical                                                                 
   scheduled                                                                
   urgency                                                                  
                                                                            
Duration time in days of the patient's hospitalization Ranksum test         
  median (IQR)                                                              
                                                                            
Number of children that the patient have               Ranksum test         
  median (IQR)                                                              
                                                                            
                                                       P.Value
Total                                                         
                                                              
age                                                    0.9276 
   clinical                                                   
   scheduled                                                  
   urgency                                                    
                                                              
Duration time in days of the patient's hospitalization 0.4386 
  median (IQR)                                                
                                                              
Number of children that the patient have               0.2969 
  median (IQR)                                                
                                                              
                                                       F         M        
Total                                                  23        27       
                                                                          
age                                                                       
   clinical                                            7 (36.84) 9 (42.86)
   scheduled                                           5 (26.32) 5 (23.81)
   urgency                                             7 (36.84) 7 (33.33)
                                                                          
Duration time in days of the patient's hospitalization                    
   0                                                   3 (13.04) 2 (7.41) 
   1                                                   5 (21.74) 2 (7.41) 
   2                                                   3 (13.04) 7 (25.93)
   3                                                   0 (0.00)  3 (11.11)
   4                                                   2 (8.70)  0 (0.00) 
   5                                                   2 (8.70)  2 (7.41) 
   6                                                   2 (8.70)  2 (7.41) 
   7                                                   2 (8.70)  2 (7.41) 
   8                                                   1 (4.35)  4 (14.81)
   9                                                   1 (4.35)  2 (7.41) 
   10                                                  2 (8.70)  1 (3.70) 
                                                                          
Number of children that the patient have                                  
   0                                                   5 (29.41) 3 (15.00)
   1                                                   1 (5.88)  2 (10.00)
   2                                                   6 (35.29) 6 (30.00)
   3                                                   5 (29.41) 9 (45.00)
                                                                          
                                                       Test stat.           
Total                                                                       
                                                                            
age                                                    Chisq. (2 df) = 0.150
   clinical                                                                 
   scheduled                                                                
   urgency                                                                  
                                                                            
Duration time in days of the patient's hospitalization Fisher's exact test  
   0                                                                        
   1                                                                        
   2                                                                        
   3                                                                        
   4                                                                        
   5                                                                        
   6                                                                        
   7                                                                        
   8                                                                        
   9                                                                        
   10                                                                       
                                                                            
Number of children that the patient have               Fisher's exact test  
   0                                                                        
   1                                                                        
   2                                                                        
   3                                                                        
                                                                            
                                                       P.Value
Total                                                         
                                                              
age                                                    0.9276 
   clinical                                                   
   scheduled                                                  
   urgency                                                    
                                                              
Duration time in days of the patient's hospitalization 0.4740 
   0                                                          
   1                                                          
   2                                                          
   3                                                          
   4                                                          
   5                                                          
   6                                                          
   7                                                          
   8                                                          
   9                                                          
   10                                                         
                                                              
Number of children that the patient have               0.6418 
   0                                                          
   1                                                          
   2                                                          
   3                                                          
                                                              
               CA                  US                  Test stat.         
Total          102                 98                                     
                                                                          
AgeInDays                                              Ranksum test       
  median (IQR) 8.00 (4.00 - 11.00) 5.00 (3.00 - 12.00)                    
                                                                          
Type                                                   Fisher's exact test
   A           37 (36.27)          31 (31.63)                             
   B           38 (37.25)          38 (38.78)                             
   AB          0 (0.00)            0 (0.00)                               
   0           27 (26.47)          29 (29.59)                             
                                                                          
               P.Value
Total                 
                      
AgeInDays      0.2567 
  median (IQR)        
                      
Type           0.7797 
   A                  
   B                  
   AB                 
   0                  
                      
               CA                  US                  Test stat.           
Total          102                 98                                       
                                                                            
AgeInDays                                              Ranksum test         
  median (IQR) 8.00 (4.00 - 11.00) 5.00 (3.00 - 12.00)                      
                                                                            
Type                                                   Chisq. (2 df) = 0.521
   A           37 (36.27)          31 (31.63)                               
   B           38 (37.25)          38 (38.78)                               
   0           27 (26.47)          29 (29.59)                               
                                                                            
               P.Value
Total                 
                      
AgeInDays      0.2567 
  median (IQR)        
                      
Type           0.7706 
   A                  
   B                  
   0                  
                      

ems documentation built on Dec. 11, 2021, 9:15 a.m.