cro_fun: Cross-tabulation with custom summary function.

Description Usage Arguments Value See Also Examples

View source: R/cro_fun.R

Description

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
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
cro_fun(
  cell_vars,
  col_vars = total(),
  row_vars = total(label = ""),
  weight = NULL,
  subgroup = NULL,
  fun,
  ...,
  unsafe = FALSE
)

cro_fun_df(
  cell_vars,
  col_vars = total(),
  row_vars = total(label = ""),
  weight = NULL,
  subgroup = NULL,
  fun,
  ...,
  unsafe = FALSE
)

cro_mean(
  cell_vars,
  col_vars = total(),
  row_vars = total(label = ""),
  weight = NULL,
  subgroup = NULL
)

cro_mean_sd_n(
  cell_vars,
  col_vars = total(),
  row_vars = total(label = ""),
  weight = NULL,
  subgroup = NULL,
  weighted_valid_n = FALSE,
  labels = NULL
)

cro_sum(
  cell_vars,
  col_vars = total(),
  row_vars = total(label = ""),
  weight = NULL,
  subgroup = NULL
)

cro_median(
  cell_vars,
  col_vars = total(),
  row_vars = total(label = ""),
  weight = NULL,
  subgroup = NULL
)

cro_pearson(
  cell_vars,
  col_vars = total(),
  row_vars = total(label = ""),
  weight = NULL,
  subgroup = NULL
)

cro_spearman(
  cell_vars,
  col_vars = total(),
  row_vars = total(label = ""),
  weight = NULL,
  subgroup = NULL
)

calc_cro_fun(
  data,
  cell_vars,
  col_vars = total(),
  row_vars = total(label = ""),
  weight = NULL,
  subgroup = NULL,
  fun,
  ...,
  unsafe = FALSE
)

calc_cro_fun_df(
  data,
  cell_vars,
  col_vars = total(),
  row_vars = total(label = ""),
  weight = NULL,
  subgroup = NULL,
  fun,
  ...,
  unsafe = FALSE
)

calc_cro_mean(
  data,
  cell_vars,
  col_vars = total(),
  row_vars = total(label = ""),
  weight = NULL,
  subgroup = NULL
)

calc_cro_mean_sd_n(
  data,
  cell_vars,
  col_vars = total(),
  row_vars = total(label = ""),
  weight = NULL,
  subgroup = NULL,
  weighted_valid_n = FALSE,
  labels = NULL
)

calc_cro_sum(
  data,
  cell_vars,
  col_vars = total(),
  row_vars = total(label = ""),
  weight = NULL,
  subgroup = NULL
)

calc_cro_median(
  data,
  cell_vars,
  col_vars = total(),
  row_vars = total(label = ""),
  weight = NULL,
  subgroup = NULL
)

calc_cro_pearson(
  data,
  cell_vars,
  col_vars = total(),
  row_vars = total(label = ""),
  weight = NULL,
  subgroup = NULL
)

calc_cro_spearman(
  data,
  cell_vars,
  col_vars = total(),
  row_vars = total(label = ""),
  weight = NULL,
  subgroup = NULL
)

combine_functions(..., method = c)

Arguments

cell_vars

vector/data.frame/list. Variables on which summary function will be computed.

col_vars

vector/data.frame/list. Variables which breaks table by columns. Use mrset/mdset for multiple-response variables.

row_vars

vector/data.frame/list. Variables which breaks table by rows. Use mrset/mdset for multiple-response variables.

weight

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

subgroup

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

fun

custom summary function. Generally it is recommended that fun will always return object of the same form. Rownames/vector names of fun result will appear in the row labels of the table and column names/names of list will appear in the column labels. To use weight you should have formal weight argument in fun and some logic for its processing inside. For cro_fun_df fun will receive data.table with all names converted to variable labels (if labels exists). So it is not recommended to rely on original variables names in your fun.

...

further arguments for fun in cro_fun/cro_fun_df or functions for combine_functions. Ignored in cro_fun/cro_fun_df if unsafe is TRUE.

unsafe

logical/character If not FALSE than fun will be evaluated as is. It can lead to significant increase in the performance. But there are some limitations. For cro_fun it means that your function fun should return vector. If length of this vector is greater than one than you should provide with unsafe argument vector of unique labels for each element of this vector. There will be no attempts to automatically make labels for the results of fun. For cro_fun_df your function should return vector or list/data.frame (optionally with 'row_labels' element - statistic labels). If unsafe is TRUE or not logical then further arguments (...) for fun will be ignored.

weighted_valid_n

logical. Should we show weighted valid N in cro_mean_sd_n? By default it is FALSE.

labels

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

data

data.frame in which context all other arguments will be evaluated (for calc_cro_*).

method

function which will combine results of multiple functions in combine_functions. It will be applied as in the expression do.call(method, list_of_functions_results). By default it is c.

Value

object of class 'etable'. Basically it's a data.frame but class is needed for custom methods.

See Also

tables, fre, cro.

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
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"
)


# Simple example - there is special shortcut for it - 'cro_mean'
calculate(mtcars, cro_fun(list(mpg, disp, hp, wt, qsec), 
                               col_vars = list(total(), am), 
                               row_vars = vs, 
                               fun = mean)
)

# the same result
calc_cro_fun(mtcars, list(mpg, disp, hp, wt, qsec), 
                     col_vars = list(total(), am), 
                     row_vars = vs, 
                     fun = mean
) 

# The same example with 'subgroup'
calculate(mtcars, cro_fun(list(mpg, disp, hp, wt, qsec), 
                               col_vars = list(total(), am), 
                               row_vars = vs,
                               subgroup = vs == 0, 
                               fun = mean)
)
                                
# 'combine_functions' usage  
calculate(mtcars, cro_fun(list(mpg, disp, hp, wt, qsec), 
                          col_vars = list(total(), am), 
                          row_vars = vs, 
                          fun = combine_functions(Mean = mean, 
                                                  'Std. dev.' = sd,
                                                  'Valid N' = valid_n)
))  
# 'combine_functions' usage - statistic labels in columns
calculate(mtcars, cro_fun(list(mpg, disp, hp, wt, qsec), 
                          col_vars = list(total(), am), 
                          row_vars = vs, 
                          fun = combine_functions(Mean = mean, 
                                                  'Std. dev.' = sd,
                                                  'Valid N' = valid_n,
                                                  method = list
                                                  )
)) 

# 'summary' function
calculate(mtcars, cro_fun(list(mpg, disp, hp, wt, qsec), 
                          col_vars = list(total(), am), 
                          row_vars = list(total(), vs), 
                          fun = summary
))  
                          
# comparison 'cro_fun' and 'cro_fun_df'
calculate(mtcars, cro_fun(
                       sheet(mpg, disp, hp, wt, qsec), 
                       col_vars = am,
                       fun = mean
                       )
)

# same result
calculate(mtcars, cro_fun_df(
                       sheet(mpg, disp, hp, wt, qsec), 
                       col_vars = am, 
                       fun = colMeans
                       )
) 

# usage for 'cro_fun_df' which is not possible for 'cro_fun'
# linear regression by groups
calculate(mtcars, cro_fun_df(
                      sheet(mpg, disp, hp, wt, qsec), 
                      col_vars = am,
                      fun = function(x){
                            frm = reformulate(".", response = names(x)[1])
                            model = lm(frm, data = x)
                            sheet(
                                'Coef. estimate' = coef(model), 
                                 confint(model)
                                 )
                      }
))

Example output

                                                                             
 |        |                 |                       | #Total | Transmission |
 |        |                 |                       |        |    Automatic |
 | ------ | --------------- | --------------------- | ------ | ------------ |
 | Engine |        V-engine |     Miles/(US) gallon |   16.6 |         15.1 |
 |        |                 | Displacement (cu.in.) |  307.1 |        357.6 |
 |        |                 |      Gross horsepower |  189.7 |        194.2 |
 |        |                 |     Weight (1000 lbs) |    3.7 |          4.1 |
 |        |                 |         1/4 mile time |   16.7 |         17.1 |
 |        | Straight engine |     Miles/(US) gallon |   24.6 |         20.7 |
 |        |                 | Displacement (cu.in.) |  132.5 |        175.1 |
 |        |                 |      Gross horsepower |   91.4 |        102.1 |
 |        |                 |     Weight (1000 lbs) |    2.6 |          3.2 |
 |        |                 |         1/4 mile time |   19.3 |         20.0 |
         
        |
 Manual |
 ------ |
   19.8 |
  206.2 |
  180.8 |
    2.9 |
   15.8 |
   28.4 |
   89.8 |
   80.6 |
    2.0 |
   18.7 |
                                                                             
 |        |                 |                       | #Total | Transmission |
 |        |                 |                       |        |    Automatic |
 | ------ | --------------- | --------------------- | ------ | ------------ |
 | Engine |        V-engine |     Miles/(US) gallon |   16.6 |         15.1 |
 |        |                 | Displacement (cu.in.) |  307.1 |        357.6 |
 |        |                 |      Gross horsepower |  189.7 |        194.2 |
 |        |                 |     Weight (1000 lbs) |    3.7 |          4.1 |
 |        |                 |         1/4 mile time |   16.7 |         17.1 |
 |        | Straight engine |     Miles/(US) gallon |   24.6 |         20.7 |
 |        |                 | Displacement (cu.in.) |  132.5 |        175.1 |
 |        |                 |      Gross horsepower |   91.4 |        102.1 |
 |        |                 |     Weight (1000 lbs) |    2.6 |          3.2 |
 |        |                 |         1/4 mile time |   19.3 |         20.0 |
         
        |
 Manual |
 ------ |
   19.8 |
  206.2 |
  180.8 |
    2.9 |
   15.8 |
   28.4 |
   89.8 |
   80.6 |
    2.0 |
   18.7 |
                                                                             
 |        |                 |                       | #Total | Transmission |
 |        |                 |                       |        |    Automatic |
 | ------ | --------------- | --------------------- | ------ | ------------ |
 | Engine |        V-engine |     Miles/(US) gallon |   16.6 |         15.1 |
 |        |                 | Displacement (cu.in.) |  307.1 |        357.6 |
 |        |                 |      Gross horsepower |  189.7 |        194.2 |
 |        |                 |     Weight (1000 lbs) |    3.7 |          4.1 |
 |        |                 |         1/4 mile time |   16.7 |         17.1 |
 |        | Straight engine |     Miles/(US) gallon |        |              |
 |        |                 | Displacement (cu.in.) |        |              |
 |        |                 |      Gross horsepower |        |              |
 |        |                 |     Weight (1000 lbs) |        |              |
 |        |                 |         1/4 mile time |        |              |
         
        |
 Manual |
 ------ |
   19.8 |
  206.2 |
  180.8 |
    2.9 |
   15.8 |
        |
        |
        |
        |
        |
                                                                          
 |        |                 |                       |           | #Total |
 |        |                 |                       |           |        |
 | ------ | --------------- | --------------------- | --------- | ------ |
 | Engine |        V-engine |     Miles/(US) gallon |      Mean |   16.6 |
 |        |                 |                       | Std. dev. |    3.9 |
 |        |                 |                       |   Valid N |   18.0 |
 |        |                 | Displacement (cu.in.) |      Mean |  307.1 |
 |        |                 |                       | Std. dev. |  106.8 |
 |        |                 |                       |   Valid N |   18.0 |
 |        |                 |      Gross horsepower |      Mean |  189.7 |
 |        |                 |                       | Std. dev. |   60.3 |
 |        |                 |                       |   Valid N |   18.0 |
 |        |                 |     Weight (1000 lbs) |      Mean |    3.7 |
 |        |                 |                       | Std. dev. |    0.9 |
 |        |                 |                       |   Valid N |   18.0 |
 |        |                 |         1/4 mile time |      Mean |   16.7 |
 |        |                 |                       | Std. dev. |    1.1 |
 |        |                 |                       |   Valid N |   18.0 |
 |        | Straight engine |     Miles/(US) gallon |      Mean |   24.6 |
 |        |                 |                       | Std. dev. |    5.4 |
 |        |                 |                       |   Valid N |   14.0 |
 |        |                 | Displacement (cu.in.) |      Mean |  132.5 |
 |        |                 |                       | Std. dev. |   56.9 |
 |        |                 |                       |   Valid N |   14.0 |
 |        |                 |      Gross horsepower |      Mean |   91.4 |
 |        |                 |                       | Std. dev. |   24.4 |
 |        |                 |                       |   Valid N |   14.0 |
 |        |                 |     Weight (1000 lbs) |      Mean |    2.6 |
 |        |                 |                       | Std. dev. |    0.7 |
 |        |                 |                       |   Valid N |   14.0 |
 |        |                 |         1/4 mile time |      Mean |   19.3 |
 |        |                 |                       | Std. dev. |    1.4 |
 |        |                 |                       |   Valid N |   14.0 |
                        
 Transmission |        |
    Automatic | Manual |
 ------------ | ------ |
         15.1 |   19.8 |
          2.8 |    4.0 |
         12.0 |    6.0 |
        357.6 |  206.2 |
         71.8 |   95.2 |
         12.0 |    6.0 |
        194.2 |  180.8 |
         33.4 |   98.8 |
         12.0 |    6.0 |
          4.1 |    2.9 |
          0.8 |    0.5 |
         12.0 |    6.0 |
         17.1 |   15.8 |
          0.8 |    1.1 |
         12.0 |    6.0 |
         20.7 |   28.4 |
          2.5 |    4.8 |
          7.0 |    7.0 |
        175.1 |   89.8 |
         49.1 |   18.8 |
          7.0 |    7.0 |
        102.1 |   80.6 |
         20.9 |   24.1 |
          7.0 |    7.0 |
          3.2 |    2.0 |
          0.3 |    0.4 |
          7.0 |    7.0 |
         20.0 |   18.7 |
          1.5 |    0.9 |
          7.0 |    7.0 |
                                                                          
 |        |                 |                       | #Total |           |
 |        |                 |                       |   Mean | Std. dev. |
 |        |                 |                       |        |           |
 | ------ | --------------- | --------------------- | ------ | --------- |
 | Engine |        V-engine |     Miles/(US) gallon |   16.6 |       3.9 |
 |        |                 | Displacement (cu.in.) |  307.1 |     106.8 |
 |        |                 |      Gross horsepower |  189.7 |      60.3 |
 |        |                 |     Weight (1000 lbs) |    3.7 |       0.9 |
 |        |                 |         1/4 mile time |   16.7 |       1.1 |
 |        | Straight engine |     Miles/(US) gallon |   24.6 |       5.4 |
 |        |                 | Displacement (cu.in.) |  132.5 |      56.9 |
 |        |                 |      Gross horsepower |   91.4 |      24.4 |
 |        |                 |     Weight (1000 lbs) |    2.6 |       0.7 |
 |        |                 |         1/4 mile time |   19.3 |       1.4 |
                                                                              
         | Transmission |           |         |        |           |         |
 Valid N |    Automatic |           |         | Manual |           |         |
         |         Mean | Std. dev. | Valid N |   Mean | Std. dev. | Valid N |
 ------- | ------------ | --------- | ------- | ------ | --------- | ------- |
      18 |         15.1 |       2.8 |      12 |   19.8 |       4.0 |       6 |
      18 |        357.6 |      71.8 |      12 |  206.2 |      95.2 |       6 |
      18 |        194.2 |      33.4 |      12 |  180.8 |      98.8 |       6 |
      18 |          4.1 |       0.8 |      12 |    2.9 |       0.5 |       6 |
      18 |         17.1 |       0.8 |      12 |   15.8 |       1.1 |       6 |
      14 |         20.7 |       2.5 |       7 |   28.4 |       4.8 |       7 |
      14 |        175.1 |      49.1 |       7 |   89.8 |      18.8 |       7 |
      14 |        102.1 |      20.9 |       7 |   80.6 |      24.1 |       7 |
      14 |          3.2 |       0.3 |       7 |    2.0 |       0.4 |       7 |
      14 |         20.0 |       1.5 |       7 |   18.7 |       0.9 |       7 |
                                                                              
 |        |                       |                       |         | #Total |
 |        |                       |                       |         |        |
 | ------ | --------------------- | --------------------- | ------- | ------ |
 | #Total |     Miles/(US) gallon |                  Min. |         |   10.4 |
 |        |                       |               1st Qu. |         |   15.4 |
 |        |                       |                Median |         |   19.2 |
 |        |                       |                  Mean |         |   20.1 |
 |        |                       |               3rd Qu. |         |   22.8 |
 |        |                       |                  Max. |         |   33.9 |
 |        | Displacement (cu.in.) |                  Min. |         |   71.1 |
 |        |                       |               1st Qu. |         |  120.8 |
 |        |                       |                Median |         |  196.3 |
 |        |                       |                  Mean |         |  230.7 |
 |        |                       |               3rd Qu. |         |  326.0 |
 |        |                       |                  Max. |         |  472.0 |
 |        |      Gross horsepower |                  Min. |         |   52.0 |
 |        |                       |               1st Qu. |         |   96.5 |
 |        |                       |                Median |         |  123.0 |
 |        |                       |                  Mean |         |  146.7 |
 |        |                       |               3rd Qu. |         |  180.0 |
 |        |                       |                  Max. |         |  335.0 |
 |        |     Weight (1000 lbs) |                  Min. |         |    1.5 |
 |        |                       |               1st Qu. |         |    2.6 |
 |        |                       |                Median |         |    3.3 |
 |        |                       |                  Mean |         |    3.2 |
 |        |                       |               3rd Qu. |         |    3.6 |
 |        |                       |                  Max. |         |    5.4 |
 |        |         1/4 mile time |                  Min. |         |   14.5 |
 |        |                       |               1st Qu. |         |   16.9 |
 |        |                       |                Median |         |   17.7 |
 |        |                       |                  Mean |         |   17.8 |
 |        |                       |               3rd Qu. |         |   18.9 |
 |        |                       |                  Max. |         |   22.9 |
 | Engine |              V-engine |     Miles/(US) gallon |    Min. |   10.4 |
 |        |                       |                       | 1st Qu. |   14.8 |
 |        |                       |                       |  Median |   15.7 |
 |        |                       |                       |    Mean |   16.6 |
 |        |                       |                       | 3rd Qu. |   19.1 |
 |        |                       |                       |    Max. |   26.0 |
 |        |                       | Displacement (cu.in.) |    Min. |  120.3 |
 |        |                       |                       | 1st Qu. |  275.8 |
 |        |                       |                       |  Median |  311.0 |
 |        |                       |                       |    Mean |  307.1 |
 |        |                       |                       | 3rd Qu. |  360.0 |
 |        |                       |                       |    Max. |  472.0 |
 |        |                       |      Gross horsepower |    Min. |   91.0 |
 |        |                       |                       | 1st Qu. |  156.2 |
 |        |                       |                       |  Median |  180.0 |
 |        |                       |                       |    Mean |  189.7 |
 |        |                       |                       | 3rd Qu. |  226.2 |
 |        |                       |                       |    Max. |  335.0 |
 |        |                       |     Weight (1000 lbs) |    Min. |    2.1 |
 |        |                       |                       | 1st Qu. |    3.2 |
 |        |                       |                       |  Median |    3.6 |
 |        |                       |                       |    Mean |    3.7 |
 |        |                       |                       | 3rd Qu. |    3.8 |
 |        |                       |                       |    Max. |    5.4 |
 |        |                       |         1/4 mile time |    Min. |   14.5 |
 |        |                       |                       | 1st Qu. |   16.0 |
 |        |                       |                       |  Median |   17.0 |
 |        |                       |                       |    Mean |   16.7 |
 |        |                       |                       | 3rd Qu. |   17.4 |
 |        |                       |                       |    Max. |   18.0 |
 |        |       Straight engine |     Miles/(US) gallon |    Min. |   17.8 |
 |        |                       |                       | 1st Qu. |   21.4 |
 |        |                       |                       |  Median |   22.8 |
 |        |                       |                       |    Mean |   24.6 |
 |        |                       |                       | 3rd Qu. |   29.6 |
 |        |                       |                       |    Max. |   33.9 |
 |        |                       | Displacement (cu.in.) |    Min. |   71.1 |
 |        |                       |                       | 1st Qu. |   83.0 |
 |        |                       |                       |  Median |  120.5 |
 |        |                       |                       |    Mean |  132.5 |
 |        |                       |                       | 3rd Qu. |  162.4 |
 |        |                       |                       |    Max. |  258.0 |
 |        |                       |      Gross horsepower |    Min. |   52.0 |
 |        |                       |                       | 1st Qu. |   66.0 |
 |        |                       |                       |  Median |   96.0 |
 |        |                       |                       |    Mean |   91.4 |
 |        |                       |                       | 3rd Qu. |  109.8 |
 |        |                       |                       |    Max. |  123.0 |
 |        |                       |     Weight (1000 lbs) |    Min. |    1.5 |
 |        |                       |                       | 1st Qu. |    2.0 |
 |        |                       |                       |  Median |    2.6 |
 |        |                       |                       |    Mean |    2.6 |
 |        |                       |                       | 3rd Qu. |    3.2 |
 |        |                       |                       |    Max. |    3.5 |
 |        |                       |         1/4 mile time |    Min. |   16.9 |
 |        |                       |                       | 1st Qu. |   18.6 |
 |        |                       |                       |  Median |   19.2 |
 |        |                       |                       |    Mean |   19.3 |
 |        |                       |                       | 3rd Qu. |   20.0 |
 |        |                       |                       |    Max. |   22.9 |
                        
 Transmission |        |
    Automatic | Manual |
 ------------ | ------ |
         10.4 |   15.0 |
         14.9 |   21.0 |
         17.3 |   22.8 |
         17.1 |   24.4 |
         19.2 |   30.4 |
         24.4 |   33.9 |
        120.1 |   71.1 |
        196.3 |   79.0 |
        275.8 |  120.3 |
        290.4 |  143.5 |
        360.0 |  160.0 |
        472.0 |  351.0 |
         62.0 |   52.0 |
        116.5 |   66.0 |
        175.0 |  109.0 |
        160.3 |  126.8 |
        192.5 |  113.0 |
        245.0 |  335.0 |
          2.5 |    1.5 |
          3.4 |    1.9 |
          3.5 |    2.3 |
          3.8 |    2.4 |
          3.8 |    2.8 |
          5.4 |    3.6 |
         15.4 |   14.5 |
         17.2 |   16.5 |
         17.8 |   17.0 |
         18.2 |   17.4 |
         19.2 |   18.6 |
         22.9 |   19.9 |
         10.4 |   15.0 |
         14.1 |   16.8 |
         15.2 |   20.4 |
         15.1 |   19.8 |
         16.6 |   21.0 |
         19.2 |   26.0 |
        275.8 |  120.3 |
        296.9 |  148.8 |
        355.0 |  160.0 |
        357.6 |  206.2 |
        410.0 |  265.8 |
        472.0 |  351.0 |
        150.0 |   91.0 |
        175.0 |  110.0 |
        180.0 |  142.5 |
        194.2 |  180.8 |
        218.8 |  241.8 |
        245.0 |  335.0 |
          3.4 |    2.1 |
          3.6 |    2.7 |
          3.8 |    2.8 |
          4.1 |    2.9 |
          4.4 |    3.1 |
          5.4 |    3.6 |
         15.4 |   14.5 |
         17.0 |   14.8 |
         17.4 |   16.0 |
         17.1 |   15.8 |
         17.7 |   16.6 |
         18.0 |   17.0 |
         17.8 |   21.4 |
         18.6 |   25.1 |
         21.4 |   30.4 |
         20.7 |   28.4 |
         22.1 |   31.4 |
         24.4 |   33.9 |
        120.1 |   71.1 |
        143.8 |   77.2 |
        167.6 |   79.0 |
        175.1 |   89.8 |
        196.3 |  101.5 |
        258.0 |  121.0 |
         62.0 |   52.0 |
         96.0 |   65.5 |
        105.0 |   66.0 |
        102.1 |   80.6 |
        116.5 |  101.0 |
        123.0 |  113.0 |
          2.5 |    1.5 |
          3.2 |    1.7 |
          3.2 |    1.9 |
          3.2 |    2.0 |
          3.4 |    2.3 |
          3.5 |    2.8 |
         18.3 |   16.9 |
         19.2 |   18.6 |
         20.0 |   18.6 |
         20.0 |   18.7 |
         20.1 |   19.2 |
         22.9 |   19.9 |
                                                  
 |                       | Transmission |        |
 |                       |    Automatic | Manual |
 | --------------------- | ------------ | ------ |
 |     Miles/(US) gallon |         17.1 |   24.4 |
 | Displacement (cu.in.) |        290.4 |  143.5 |
 |      Gross horsepower |        160.3 |  126.8 |
 |     Weight (1000 lbs) |          3.8 |    2.4 |
 |         1/4 mile time |         18.2 |   17.4 |
                                                  
 |                       | Transmission |        |
 |                       |    Automatic | Manual |
 | --------------------- | ------------ | ------ |
 |     Miles/(US) gallon |         17.1 |   24.4 |
 | Displacement (cu.in.) |        290.4 |  143.5 |
 |      Gross horsepower |        160.3 |  126.8 |
 |     Weight (1000 lbs) |          3.8 |    2.4 |
 |         1/4 mile time |         18.2 |   17.4 |
                                                                               
 |                         |   Transmission |       |        |                |
 |                         |      Automatic |       |        |         Manual |
 |                         | Coef. estimate | 2.5 % | 97.5 % | Coef. estimate |
 | ----------------------- | -------------- | ----- | ------ | -------------- |
 |             (Intercept) |           21.8 |  -1.9 |   45.5 |           13.3 |
 | `Displacement (cu.in.)` |            0.0 |   0.0 |    0.0 |            0.0 |
 |      `Gross horsepower` |            0.0 |  -0.1 |    0.0 |            0.0 |
 |     `Weight (1000 lbs)` |           -2.3 |  -5.0 |    0.4 |           -7.7 |
 |         `1/4 mile time` |            0.4 |  -0.7 |    1.6 |            1.6 |
                 
       |        |
       |        |
 2.5 % | 97.5 % |
 ----- | ------ |
 -21.9 |   48.4 |
  -0.1 |    0.1 |
   0.0 |    0.1 |
 -12.5 |   -2.9 |
  -0.2 |    3.4 |

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