tables: Functions for custom tables construction

Description Usage Arguments Details Value See Also Examples

Description

Table construction consists of at least of three functions chained with magrittr pipe operator. At first we need to specify variables for which statistics will be computed with tab_cells. Secondary, we calculate statistics with one of tab_stat_* functions. And last, we finalize table creation with tab_pivot: dataset %>% tab_cells(variable) %>% tab_stat_cases() %>% tab_pivot(). After that we can optionally sort table with tab_sort_asc, drop empty rows/columns with drop_rc and transpose with tab_transpose. Generally, table is just a data.frame so we can use arbitrary operations on it. Statistic is always calculated with the last cell, column/row variables, weight, missing values and subgroup. To define new cell/column/row variables we can call appropriate function one more time. tab_pivot defines how we combine different statistics and where statistic labels will appear - inside/outside rows/columns. See examples. For significance testing see significance.

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
 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
tab_cols(data, ...)

tab_cells(data, ...)

tab_rows(data, ...)

tab_weight(data, weight = NULL)

tab_mis_val(data, ...)

tab_total_label(data, ...)

tab_total_statistic(data, ...)

tab_total_row_position(data, total_row_position = c("below", "above", "none"))

tab_subgroup(data, subgroup = NULL)

tab_row_label(data, ..., label = NULL)

tab_stat_fun(data, ..., label = NULL, unsafe = FALSE)

tab_stat_mean_sd_n(
  data,
  weighted_valid_n = FALSE,
  labels = c("Mean", "Std. dev.", ifelse(weighted_valid_n, "Valid N", "Unw. valid N")),
  label = NULL
)

tab_stat_mean(data, label = "Mean")

tab_stat_median(data, label = "Median")

tab_stat_se(data, label = "S. E.")

tab_stat_sum(data, label = "Sum")

tab_stat_min(data, label = "Min.")

tab_stat_max(data, label = "Max.")

tab_stat_sd(data, label = "Std. dev.")

tab_stat_valid_n(data, label = "Valid N")

tab_stat_unweighted_valid_n(data, label = "Unw. valid N")

tab_stat_fun_df(data, ..., label = NULL, unsafe = FALSE)

tab_stat_cases(
  data,
  total_label = NULL,
  total_statistic = "u_cases",
  total_row_position = c("below", "above", "none"),
  label = NULL
)

tab_stat_cpct(
  data,
  total_label = NULL,
  total_statistic = "u_cases",
  total_row_position = c("below", "above", "none"),
  label = NULL
)

tab_stat_cpct_responses(
  data,
  total_label = NULL,
  total_statistic = "u_responses",
  total_row_position = c("below", "above", "none"),
  label = NULL
)

tab_stat_tpct(
  data,
  total_label = NULL,
  total_statistic = "u_cases",
  total_row_position = c("below", "above", "none"),
  label = NULL
)

tab_stat_rpct(
  data,
  total_label = NULL,
  total_statistic = "u_cases",
  total_row_position = c("below", "above", "none"),
  label = NULL
)

tab_last_vstack(
  data,
  stat_position = c("outside_rows", "inside_rows"),
  stat_label = c("inside", "outside"),
  label = NULL
)

tab_last_hstack(
  data,
  stat_position = c("outside_columns", "inside_columns"),
  stat_label = c("inside", "outside"),
  label = NULL
)

tab_pivot(
  data,
  stat_position = c("outside_rows", "inside_rows", "outside_columns", "inside_columns"),
  stat_label = c("inside", "outside")
)

tab_transpose(data)

tab_caption(data, ...)

Arguments

data

data.frame/intermediate_table

...

vector/data.frame/list. Variables for tables. Use mrset/mdset for multiple-response variables.

weight

numeric vector in tab_weight. Cases with NA's, negative and zero weights are removed before calculations.

total_row_position

Position of total row in the resulting table. Can be one of "below", "above", "none".

subgroup

logical vector in tab_subgroup. You can specify subgroup on which table will be computed.

label

character. Label for the statistic in the tab_stat_*.

unsafe

logical If TRUE than fun will be evaluated as is. It can lead to significant increase in the performance. But there are some limitations. For tab_stat_fun it means that your function fun should return vector of length one. Also there will be no attempts to make labels for statistic. For tab_stat_fun_df your function should return vector of length one or list/data.frame (optionally with 'row_labels' element - statistic labels). If unsafe is TRUE then further arguments (...) for fun will be ignored.

weighted_valid_n

logical. Sould we show weighted valid N in tab_stat_mean_sd_n? By default it is FALSE.

labels

character vector of length 3. Labels for mean, standard deviation and valid N in tab_stat_mean_sd_n.

total_label

By default "#Total". You can provide several names - each name for each total statistics.

total_statistic

By default it is "u_cases" (unweighted cases). Possible values are "u_cases", "u_responses", "u_cpct", "u_rpct", "u_tpct", "w_cases", "w_responses", "w_cpct", "w_rpct", "w_tpct". "u_" means unweighted statistics and "w_" means weighted statistics.

stat_position

character one of the values "outside_rows", "inside_rows", "outside_columns" or "inside_columns". It defines how we will combine statistics in the table.

stat_label

character one of the values "inside" or "outside". Where will be placed labels for the statistics relative to column names/row labels? See examples.

Details

Value

All of these functions return object of class intermediate_table except tab_pivot which returns final result - object of class etable. Basically it's a data.frame but class is needed for custom methods.

See Also

fre, cro, cro_fun, tab_sort_asc, drop_empty_rows, significance.

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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
data(mtcars)
mtcars = apply_labels(mtcars,
                      mpg = "Miles/(US) gallon",
                      cyl = "Number of cylinders",
                      disp = "Displacement (cu.in.)",
                      hp = "Gross horsepower",
                      drat = "Rear axle ratio",
                      wt = "Weight (1000 lbs)",
                      qsec = "1/4 mile time",
                      vs = "Engine",
                      vs = c("V-engine" = 0,
                             "Straight engine" = 1),
                      am = "Transmission",
                      am = c("Automatic" = 0,
                             "Manual"=1),
                      gear = "Number of forward gears",
                      carb = "Number of carburetors"
)
# some examples from 'cro'
# simple example - generally with 'cro' it can be made with less typing
mtcars %>% 
    tab_cells(cyl) %>% 
    tab_cols(vs) %>% 
    tab_stat_cpct() %>% 
    tab_pivot()

# split rows
mtcars %>% 
    tab_cells(cyl) %>% 
    tab_cols(vs) %>% 
    tab_rows(am) %>% 
    tab_stat_cpct() %>% 
    tab_pivot()

# multiple banners
mtcars %>% 
    tab_cells(cyl) %>% 
    tab_cols(total(), vs, am) %>% 
    tab_stat_cpct() %>% 
    tab_pivot()

# nested banners
mtcars %>% 
    tab_cells(cyl) %>% 
    tab_cols(total(), vs %nest% am) %>% 
    tab_stat_cpct() %>% 
    tab_pivot()

# summary statistics
mtcars %>% 
    tab_cells(mpg, disp, hp, wt, qsec) %>%
    tab_cols(am) %>% 
    tab_stat_fun(Mean = w_mean, "Std. dev." = w_sd, "Valid N" = w_n) %>%
    tab_pivot()

# summary statistics - labels in columns
mtcars %>% 
    tab_cells(mpg, disp, hp, wt, qsec) %>%
    tab_cols(am) %>% 
    tab_stat_fun(Mean = w_mean, "Std. dev." = w_sd, "Valid N" = w_n, method = list) %>%
    tab_pivot()

# subgroup with droping empty columns
mtcars %>% 
    tab_subgroup(am == 0) %>% 
    tab_cells(cyl) %>% 
    tab_cols(total(), vs %nest% am) %>% 
    tab_stat_cpct() %>% 
    tab_pivot() %>% 
    drop_empty_columns()

# total position at the top of the table
mtcars %>% 
    tab_cells(cyl) %>% 
    tab_cols(total(), vs) %>% 
    tab_rows(am) %>% 
    tab_stat_cpct(total_row_position = "above",
                  total_label = c("number of cases", "row %"),
                  total_statistic = c("u_cases", "u_rpct")) %>% 
    tab_pivot()

# this example cannot be made easily with 'cro'             
mtcars %>%
    tab_cells(am) %>%
    tab_cols(total(), vs) %>%
    tab_total_row_position("none") %>% 
    tab_stat_cpct(label = "col %") %>%
    tab_stat_rpct(label = "row %") %>%
    tab_stat_tpct(label = "table %") %>%
    tab_pivot(stat_position = "inside_rows")

# statistic labels inside columns             
mtcars %>%
    tab_cells(am) %>%
    tab_cols(total(), vs) %>%
    tab_total_row_position("none") %>% 
    tab_stat_cpct(label = "col %") %>%
    tab_stat_rpct(label = "row %") %>%
    tab_stat_tpct(label = "table %") %>%
    tab_pivot(stat_position = "inside_columns")

# stacked statistics
mtcars %>% 
    tab_cells(cyl) %>% 
    tab_cols(total(), am) %>% 
    tab_stat_mean() %>%
    tab_stat_se() %>% 
    tab_stat_valid_n() %>% 
    tab_stat_cpct() %>% 
    tab_pivot()
    
# stacked statistics with section headings
mtcars %>% 
    tab_cells(cyl) %>% 
    tab_cols(total(), am) %>% 
    tab_row_label("#Summary statistics") %>% 
    tab_stat_mean() %>%
    tab_stat_se() %>% 
    tab_stat_valid_n() %>% 
    tab_row_label("#Column percent") %>% 
    tab_stat_cpct() %>% 
    tab_pivot()

# stacked statistics with different variables
mtcars %>% 
    tab_cols(total(), am) %>% 
    tab_cells(mpg, hp, qsec) %>% 
    tab_stat_mean() %>%
    tab_cells(cyl, carb) %>% 
    tab_stat_cpct() %>% 
    tab_pivot()

# stacked statistics - label position outside row labels
mtcars %>% 
    tab_cells(cyl) %>% 
    tab_cols(total(), am) %>% 
    tab_stat_mean() %>%
    tab_stat_se %>% 
    tab_stat_valid_n() %>% 
    tab_stat_cpct(label = "Col %") %>% 
    tab_pivot(stat_label = "outside")
    
# example from 'cro_fun_df' - linear regression by groups with sorting 
mtcars %>% 
    tab_cells(sheet(mpg, disp, hp, wt, qsec)) %>% 
    tab_cols(total(), am) %>% 
    tab_stat_fun_df(
        function(x){
            frm = reformulate(".", response = as.name(names(x)[1]))
            model = lm(frm, data = x)
            sheet('Coef.' = coef(model), 
                  confint(model)
            )
        }    
    ) %>% 
    tab_pivot() %>% 
    tab_sort_desc()

# multiple-response variables and weight
data(product_test)
codeframe_likes = num_lab("
                          1 Liked everything
                          2 Disliked everything
                          3 Chocolate
                          4 Appearance
                          5 Taste
                          6 Stuffing
                          7 Nuts
                          8 Consistency
                          98 Other
                          99 Hard to answer
                          ")

set.seed(1)
product_test = compute(product_test, {
    # recode age by groups
    age_cat = recode(s2a, lo %thru% 25 ~ 1, lo %thru% hi ~ 2)
    
    var_lab(age_cat) = "Age"
    val_lab(age_cat) = c("18 - 25" = 1, "26 - 35" = 2)
    
    var_lab(a1_1) = "Likes. VSX123"
    var_lab(b1_1) = "Likes. SDF456"
    val_lab(a1_1) = codeframe_likes
    val_lab(b1_1) = codeframe_likes
    
    wgt = runif(.N, 0.25, 4)
    wgt = wgt/sum(wgt)*.N
})

product_test %>% 
    tab_cells(mrset(a1_1 %to% a1_6), mrset(b1_1 %to% b1_6)) %>% 
    tab_cols(total(), age_cat) %>% 
    tab_weight(wgt) %>% 
    tab_stat_cpct() %>% 
    tab_sort_desc() %>% 
    tab_pivot()
    
# trick to place cell variables labels inside columns
# useful to compare two variables
# '|' is needed to prevent automatic labels creation from argument
# alternatively we can use list(...) to avoid this
product_test %>% 
    tab_cols(total(), age_cat) %>% 
    tab_weight(wgt) %>% 
    tab_cells("|" = unvr(mrset(a1_1 %to% a1_6))) %>% 
    tab_stat_cpct(label = var_lab(a1_1)) %>% 
    tab_cells("|" = unvr(mrset(b1_1 %to% b1_6))) %>% 
    tab_stat_cpct(label = var_lab(b1_1)) %>% 
    tab_pivot(stat_position = "inside_columns")

# if you need standard evaluation, use 'vars'
tables = mtcars %>%
      tab_cols(total(), am %nest% vs)

for(each in c("mpg", "disp", "hp", "qsec")){
    tables = tables %>% tab_cells(vars(each)) %>%
        tab_stat_fun(Mean = w_mean, "Std. dev." = w_sd, "Valid N" = w_n) 
}
tables %>% tab_pivot()

Example output

                                                                    
 |                     |              |   Engine |                 |
 |                     |              | V-engine | Straight engine |
 | ------------------- | ------------ | -------- | --------------- |
 | Number of cylinders |            4 |      5.6 |            71.4 |
 |                     |            6 |     16.7 |            28.6 |
 |                     |            8 |     77.8 |                 |
 |                     | #Total cases |     18.0 |            14.0 |
                                                                             
 |              |           |                     |              |   Engine |
 |              |           |                     |              | V-engine |
 | ------------ | --------- | ------------------- | ------------ | -------- |
 | Transmission | Automatic | Number of cylinders |            4 |          |
 |              |           |                     |            6 |          |
 |              |           |                     |            8 |    100.0 |
 |              |           |                     | #Total cases |     12.0 |
 |              |    Manual | Number of cylinders |            4 |     16.7 |
 |              |           |                     |            6 |     50.0 |
 |              |           |                     |            8 |     33.3 |
 |              |           |                     | #Total cases |      6.0 |
                  
                 |
 Straight engine |
 --------------- |
            42.9 |
            57.1 |
                 |
             7.0 |
           100.0 |
                 |
                 |
             7.0 |
                                                                             
 |                     |              | #Total |   Engine |                 |
 |                     |              |        | V-engine | Straight engine |
 | ------------------- | ------------ | ------ | -------- | --------------- |
 | Number of cylinders |            4 |   34.4 |      5.6 |            71.4 |
 |                     |            6 |   21.9 |     16.7 |            28.6 |
 |                     |            8 |   43.8 |     77.8 |                 |
 |                     | #Total cases |   32.0 |     18.0 |            14.0 |
                        
 Transmission |        |
    Automatic | Manual |
 ------------ | ------ |
         15.8 |   61.5 |
         21.1 |   23.1 |
         63.2 |   15.4 |
         19.0 |   13.0 |
                                                                        
 |                     |              | #Total |       Engine |        |
 |                     |              |        |     V-engine |        |
 |                     |              |        | Transmission |        |
 |                     |              |        |    Automatic | Manual |
 | ------------------- | ------------ | ------ | ------------ | ------ |
 | Number of cylinders |            4 |   34.4 |              |   16.7 |
 |                     |            6 |   21.9 |              |   50.0 |
 |                     |            8 |   43.8 |          100 |   33.3 |
 |                     | #Total cases |   32.0 |           12 |    6.0 |
                           
                 |        |
 Straight engine |        |
    Transmission |        |
       Automatic | Manual |
 --------------- | ------ |
            42.9 |    100 |
            57.1 |        |
                 |        |
             7.0 |      7 |
                                                              
 |                       |           | Transmission |        |
 |                       |           |    Automatic | Manual |
 | --------------------- | --------- | ------------ | ------ |
 |     Miles/(US) gallon |      Mean |         17.1 |   24.4 |
 |                       | Std. dev. |          3.8 |    6.2 |
 |                       |   Valid N |         19.0 |   13.0 |
 | Displacement (cu.in.) |      Mean |        290.4 |  143.5 |
 |                       | Std. dev. |        110.2 |   87.2 |
 |                       |   Valid N |         19.0 |   13.0 |
 |      Gross horsepower |      Mean |        160.3 |  126.8 |
 |                       | Std. dev. |         53.9 |   84.1 |
 |                       |   Valid N |         19.0 |   13.0 |
 |     Weight (1000 lbs) |      Mean |          3.8 |    2.4 |
 |                       | Std. dev. |          0.8 |    0.6 |
 |                       |   Valid N |         19.0 |   13.0 |
 |         1/4 mile time |      Mean |         18.2 |   17.4 |
 |                       | Std. dev. |          1.8 |    1.8 |
 |                       |   Valid N |         19.0 |   13.0 |
                                                                        
 |                       | Transmission |           |         |        |
 |                       |    Automatic |           |         | Manual |
 |                       |         Mean | Std. dev. | Valid N |   Mean |
 | --------------------- | ------------ | --------- | ------- | ------ |
 |     Miles/(US) gallon |         17.1 |       3.8 |      19 |   24.4 |
 | Displacement (cu.in.) |        290.4 |     110.2 |      19 |  143.5 |
 |      Gross horsepower |        160.3 |      53.9 |      19 |  126.8 |
 |     Weight (1000 lbs) |          3.8 |       0.8 |      19 |    2.4 |
 |         1/4 mile time |         18.2 |       1.8 |      19 |   17.4 |
                      
           |         |
           |         |
 Std. dev. | Valid N |
 --------- | ------- |
       6.2 |      13 |
      87.2 |      13 |
      84.1 |      13 |
       0.6 |      13 |
       1.8 |      13 |
                                                               
 |                     |              | #Total |       Engine |
 |                     |              |        |     V-engine |
 |                     |              |        | Transmission |
 |                     |              |        |    Automatic |
 | ------------------- | ------------ | ------ | ------------ |
 | Number of cylinders |            4 |   15.8 |              |
 |                     |            6 |   21.1 |              |
 |                     |            8 |   63.2 |          100 |
 |                     | #Total cases |   19.0 |           12 |
                  
                 |
 Straight engine |
    Transmission |
       Automatic |
 --------------- |
            42.9 |
            57.1 |
                 |
             7.0 |
                                                                               
 |              |           |                     |                  | #Total |
 |              |           |                     |                  |        |
 | ------------ | --------- | ------------------- | ---------------- | ------ |
 | Transmission | Automatic | Number of cylinders | #number of cases |   19.0 |
 |              |           |                     |           #row % |  100.0 |
 |              |           |                     |                4 |   15.8 |
 |              |           |                     |                6 |   21.1 |
 |              |           |                     |                8 |   63.2 |
 |              |    Manual | Number of cylinders | #number of cases |   13.0 |
 |              |           |                     |           #row % |  100.0 |
 |              |           |                     |                4 |   61.5 |
 |              |           |                     |                6 |   23.1 |
 |              |           |                     |                8 |   15.4 |
                             
   Engine |                 |
 V-engine | Straight engine |
 -------- | --------------- |
     12.0 |             7.0 |
     63.2 |            36.8 |
          |            42.9 |
          |            57.1 |
    100.0 |                 |
      6.0 |             7.0 |
     46.2 |            53.8 |
     16.7 |           100.0 |
     50.0 |                 |
     33.3 |                 |
                                                                             
 |              |           |         | #Total |   Engine |                 |
 |              |           |         |        | V-engine | Straight engine |
 | ------------ | --------- | ------- | ------ | -------- | --------------- |
 | Transmission | Automatic |   col % |   59.4 |     66.7 |            50.0 |
 |              |           |   row % |  100.0 |     63.2 |            36.8 |
 |              |           | table % |   59.4 |     37.5 |            21.9 |
 |              |    Manual |   col % |   40.6 |     33.3 |            50.0 |
 |              |           |   row % |  100.0 |     46.2 |            53.8 |
 |              |           | table % |   40.6 |     18.8 |            21.9 |
                                                                           
 |              |           | #Total |       |         |   Engine |       |
 |              |           |  col % | row % | table % | V-engine |       |
 |              |           |        |       |         |    col % | row % |
 | ------------ | --------- | ------ | ----- | ------- | -------- | ----- |
 | Transmission | Automatic |   59.4 |   100 |    59.4 |     66.7 |  63.2 |
 |              |    Manual |   40.6 |   100 |    40.6 |     33.3 |  46.2 |
                                              
         |                 |       |         |
         | Straight engine |       |         |
 table % |           col % | row % | table % |
 ------- | --------------- | ----- | ------- |
    37.5 |              50 |  36.8 |    21.9 |
    18.8 |              50 |  53.8 |    21.9 |
                                                                        
 |                     |              | #Total | Transmission |        |
 |                     |              |        |    Automatic | Manual |
 | ------------------- | ------------ | ------ | ------------ | ------ |
 | Number of cylinders |         Mean |    6.2 |          6.9 |    5.1 |
 |                     |        S. E. |    0.3 |          0.4 |    0.4 |
 |                     |      Valid N |   32.0 |         19.0 |   13.0 |
 |                     |            4 |   34.4 |         15.8 |   61.5 |
 |                     |            6 |   21.9 |         21.1 |   23.1 |
 |                     |            8 |   43.8 |         63.2 |   15.4 |
 |                     | #Total cases |   32.0 |         19.0 |   13.0 |
                                                                        
 |                     |              | #Total | Transmission |        |
 |                     |              |        |    Automatic | Manual |
 | ------------------- | ------------ | ------ | ------------ | ------ |
 | #Summary statistics |              |        |              |        |
 | Number of cylinders |         Mean |    6.2 |          6.9 |    5.1 |
 |                     |        S. E. |    0.3 |          0.4 |    0.4 |
 |                     |      Valid N |   32.0 |         19.0 |   13.0 |
 |     #Column percent |              |        |              |        |
 | Number of cylinders |            4 |   34.4 |         15.8 |   61.5 |
 |                     |            6 |   21.9 |         21.1 |   23.1 |
 |                     |            8 |   43.8 |         63.2 |   15.4 |
 |                     | #Total cases |   32.0 |         19.0 |   13.0 |
                                                                          
 |                       |              | #Total | Transmission |        |
 |                       |              |        |    Automatic | Manual |
 | --------------------- | ------------ | ------ | ------------ | ------ |
 |     Miles/(US) gallon |         Mean |   20.1 |         17.1 |   24.4 |
 |      Gross horsepower |         Mean |  146.7 |        160.3 |  126.8 |
 |         1/4 mile time |         Mean |   17.8 |         18.2 |   17.4 |
 |   Number of cylinders |            4 |   34.4 |         15.8 |   61.5 |
 |                       |            6 |   21.9 |         21.1 |   23.1 |
 |                       |            8 |   43.8 |         63.2 |   15.4 |
 |                       | #Total cases |   32.0 |         19.0 |   13.0 |
 | Number of carburetors |            1 |   21.9 |         15.8 |   30.8 |
 |                       |            2 |   31.2 |         31.6 |   30.8 |
 |                       |            3 |    9.4 |         15.8 |        |
 |                       |            4 |   31.2 |         36.8 |   23.1 |
 |                       |            6 |    3.1 |              |    7.7 |
 |                       |            8 |    3.1 |              |    7.7 |
 |                       | #Total cases |   32.0 |         19.0 |   13.0 |
                                                                         
 |         |                     |              | #Total | Transmission |
 |         |                     |              |        |    Automatic |
 | ------- | ------------------- | ------------ | ------ | ------------ |
 |    Mean | Number of cylinders |              |    6.2 |          6.9 |
 |   S. E. | Number of cylinders |              |    0.3 |          0.4 |
 | Valid N | Number of cylinders |              |   32.0 |         19.0 |
 |   Col % | Number of cylinders |            4 |   34.4 |         15.8 |
 |         |                     |            6 |   21.9 |         21.1 |
 |         |                     |            8 |   43.8 |         63.2 |
 |         |                     | #Total cases |   32.0 |         19.0 |
         
        |
 Manual |
 ------ |
    5.1 |
    0.4 |
   13.0 |
   61.5 |
   23.1 |
   15.4 |
   13.0 |
                                                                             
 |                         | #Total |       |        | Transmission |       |
 |                         |  Coef. | 2.5 % | 97.5 % |    Automatic |       |
 |                         |        |       |        |        Coef. | 2.5 % |
 | ----------------------- | ------ | ----- | ------ | ------------ | ----- |
 |             (Intercept) |   27.3 |   9.6 |   45.1 |         21.8 |  -1.9 |
 |         `1/4 mile time` |    0.5 |  -0.4 |    1.5 |          0.4 |  -0.7 |
 | `Displacement (cu.in.)` |    0.0 |   0.0 |    0.0 |          0.0 |   0.0 |
 |      `Gross horsepower` |    0.0 |  -0.1 |    0.0 |          0.0 |  -0.1 |
 |     `Weight (1000 lbs)` |   -4.6 |  -7.2 |   -2.0 |         -2.3 |  -5.0 |
                                   
        |        |       |        |
        | Manual |       |        |
 97.5 % |  Coef. | 2.5 % | 97.5 % |
 ------ | ------ | ----- | ------ |
   45.5 |   13.3 | -21.9 |   48.4 |
    1.6 |    1.6 |  -0.2 |    3.4 |
    0.0 |    0.0 |  -0.1 |    0.1 |
    0.0 |    0.0 |   0.0 |    0.1 |
    0.4 |   -7.7 | -12.5 |   -2.9 |
                                                                     
 |               |                     | #Total |     Age |         |
 |               |                     |        | 18 - 25 | 26 - 35 |
 | ------------- | ------------------- | ------ | ------- | ------- |
 | Likes. VSX123 |                Nuts |   68.0 |    82.5 |    53.7 |
 |               |               Taste |   39.3 |    48.4 |    30.3 |
 |               |           Chocolate |   34.5 |    31.9 |    37.0 |
 |               |          Appearance |   33.6 |    26.7 |    40.4 |
 |               |            Stuffing |   31.5 |    23.6 |    39.3 |
 |               |         Consistency |   12.9 |     7.7 |    18.0 |
 |               | Disliked everything |    0.7 |         |     1.4 |
 |               |    Liked everything |        |         |         |
 |               |               Other |        |         |         |
 |               |      Hard to answer |        |         |         |
 |               |        #Total cases |  150.0 |    70.0 |    80.0 |
 | Likes. SDF456 |                Nuts |   63.3 |    62.1 |    64.4 |
 |               |               Taste |   31.6 |    35.2 |    28.0 |
 |               |          Appearance |   30.3 |    28.8 |    31.8 |
 |               |           Chocolate |   27.2 |    27.9 |    26.4 |
 |               |            Stuffing |   21.5 |    14.3 |    28.7 |
 |               |         Consistency |    8.2 |     1.7 |    14.7 |
 |               | Disliked everything |    2.9 |     3.3 |     2.5 |
 |               |               Other |    1.0 |         |     1.9 |
 |               |    Liked everything |        |         |         |
 |               |      Hard to answer |        |         |         |
 |               |        #Total cases |  150.0 |    70.0 |    80.0 |
                                                                        
 |                     |        #Total |               |           Age |
 |                     | Likes. VSX123 | Likes. SDF456 |       18 - 25 |
 |                     |               |               | Likes. VSX123 |
 | ------------------- | ------------- | ------------- | ------------- |
 |    Liked everything |               |               |               |
 | Disliked everything |           0.7 |           2.9 |               |
 |           Chocolate |          34.5 |          27.2 |          31.9 |
 |          Appearance |          33.6 |          30.3 |          26.7 |
 |               Taste |          39.3 |          31.6 |          48.4 |
 |            Stuffing |          31.5 |          21.5 |          23.6 |
 |                Nuts |          68.0 |          63.3 |          82.5 |
 |         Consistency |          12.9 |           8.2 |           7.7 |
 |               Other |               |           1.0 |               |
 |      Hard to answer |               |               |               |
 |        #Total cases |         150.0 |         150.0 |          70.0 |
                                                
               |               |               |
               |       26 - 35 |               |
 Likes. SDF456 | Likes. VSX123 | Likes. SDF456 |
 ------------- | ------------- | ------------- |
               |               |               |
           3.3 |           1.4 |           2.5 |
          27.9 |          37.0 |          26.4 |
          28.8 |          40.4 |          31.8 |
          35.2 |          30.3 |          28.0 |
          14.3 |          39.3 |          28.7 |
          62.1 |          53.7 |          64.4 |
           1.7 |          18.0 |          14.7 |
               |               |           1.9 |
               |               |               |
          70.0 |          80.0 |          80.0 |
                                                              
 |                       |           | #Total | Transmission |
 |                       |           |        |    Automatic |
 |                       |           |        |       Engine |
 |                       |           |        |     V-engine |
 | --------------------- | --------- | ------ | ------------ |
 |     Miles/(US) gallon |      Mean |   20.1 |         15.1 |
 |                       | Std. dev. |    6.0 |          2.8 |
 |                       |   Valid N |   32.0 |         12.0 |
 | Displacement (cu.in.) |      Mean |  230.7 |        357.6 |
 |                       | Std. dev. |  123.9 |         71.8 |
 |                       |   Valid N |   32.0 |         12.0 |
 |      Gross horsepower |      Mean |  146.7 |        194.2 |
 |                       | Std. dev. |   68.6 |         33.4 |
 |                       |   Valid N |   32.0 |         12.0 |
 |         1/4 mile time |      Mean |   17.8 |         17.1 |
 |                       | Std. dev. |    1.8 |          0.8 |
 |                       |   Valid N |   32.0 |         12.0 |
                                               
                 |          |                 |
                 |   Manual |                 |
                 |   Engine |                 |
 Straight engine | V-engine | Straight engine |
 --------------- | -------- | --------------- |
            20.7 |     19.8 |            28.4 |
             2.5 |      4.0 |             4.8 |
             7.0 |      6.0 |             7.0 |
           175.1 |    206.2 |            89.8 |
            49.1 |     95.2 |            18.8 |
             7.0 |      6.0 |             7.0 |
           102.1 |    180.8 |            80.6 |
            20.9 |     98.8 |            24.1 |
             7.0 |      6.0 |             7.0 |
            20.0 |     15.8 |            18.7 |
             1.5 |      1.1 |             0.9 |
             7.0 |      6.0 |             7.0 |

expss documentation built on Jan. 8, 2021, 5:38 p.m.