Skip to contents

odds_ratio() calculates odds ratios and their profiled confidence intervals for GLMs and outputs these together with the estimates of the regression coefficients, their standard errors and probabilities.

Usage

odds_ratio(object, ...)

# S3 method for class 'binom_contingency'
odds_ratio(
  object,
  ...,
  .ind_var,
  .level = 0.95,
  .print_call = FALSE,
  .stat = FALSE,
  .print_contr = FALSE
)

# S3 method for class 'data.frame'
odds_ratio(
  object,
  ...,
  .dep_var,
  .ind_var,
  .level = 0.95,
  .print_call = FALSE,
  .stat = FALSE,
  .print_contr = FALSE
)

# S3 method for class 'formula'
odds_ratio(
  object,
  ...,
  .family = binomial,
  .data,
  .level = 0.95,
  .print_call = FALSE,
  .stat = FALSE,
  .print_contr = FALSE
)

# S3 method for class 'glm'
odds_ratio(
  object,
  ...,
  .level = 0.95,
  .print_call = TRUE,
  .stat = FALSE,
  .print_contr = FALSE
)

# S3 method for class 'odds_ratio'
formula(x, ...)

Arguments

object

an object from which the odds ratios are to be calculated, which may be a binom_contingency table, a data frame (or a data frame extension e.g., a tibble), a formula or a glm.

...

further arguments passed to or from other methods.

.ind_var

<data-masking> quoted name of an independent variable, which may be either a character vector or factor.

.level

the confidence level required; default 0.95.

.print_call

logical, whether or not to print the call for the GLM.

.stat

logical, whether or not to print z or t statistic for the GLM; default FALSE.

.print_contr

logical. If TRUE, and .ind_var has a contrast attribute set, the contrast matrix will be printed; default FALSE.

.dep_var

<data-masking> quoted name of the numeric response variable in the data, either a vector with values of 1 and 0, representing the number of successes and failures respectively, or as a two-column matrix with the columns giving the numbers of successes and failures see glm().

.family

a description of the error distribution and link function to be used in the model. This can be a character string naming a family function, a family function or the result of a call to a family function. (See family for details of family functions.)

.data

a data frame, or a data frame extension (e.g. a tibble).

x

an object of class "odds_ratio".

Value

An object of classes "odds_ratio", "announce", inheriting from tibble, and containing the following columns: -

parameter

The names of the model parameters.

estimate

The estimate of the regression coefficient.

se

The standard error of the estimate.

z (or t) value

Optionally, the value of the z (or t) statistic for the estimate.

p_val

The p-value for the estimate.

odds_ratio

The odds ratio.

ci

The lower and upper confidence intervals for the odds ratio, by default at the 2.5% and 97.5% levels.

sig

Stars for statistical significance.

Details

odds_ratio() is a generic function used to calculate odds ratios and their profiled confidence intervals for univariable GLMs with a single categorical independent variable, or for multivariable GLMs, and output these together with the estimates of the regression coefficients, their standard errors and probabilities. The function invokes particular methods which depend on the class of the first argument.

The S3 method for objects of class "formula" or "glm" can be used with either unvariable GLMs, or with multivariable GLMs to calculate "adjusted" odds ratios. Currently, the S3 methods for classes "data.frame" and "binom_contingency" can only be used with univariable GLMs.

Optionally, if print_call = TRUE the call to glm() may be retrieved and printed.

If .print_contr = TRUE and any factor independent variables have a contrast attribute set, the contrast matrix will be printed. Contrasts may be set conveniently for factors in data using set_contrasts(), see examples.

Confidence intervals for odds ratios are based on profile likelihood and calculated using confint.glm(). The confidence level may be adjusted using .level, otherwise the default value of 0.95 is used.

See also

binom_contingency(), contrast matrix, contrasts(), formula, glm(), set_contrasts(), summary.glm(); Print_Methods and print_all() for S3 methods for printing objects of class "odds_ratio".

Examples

## Create simulated Bernoulli data
(d <- bernoulli_data())
#> ___________________________
#> Simulated Bernoulli Data: -
#> 
#> # A tibble: 330 × 2
#>    iv       dv
#>  * <fct> <int>
#>  1 a         0
#>  2 a         0
#>  3 a         0
#>  4 a         0
#>  5 a         1
#>  6 a         1
#>  7 a         1
#>  8 a         1
#>  9 a         1
#> 10 a         1
#> # ℹ 320 more rows

## Invoking the S3 method for class "data.frame" and using the default
## contrasts from options("contrasts")
## — contrasts not printed 
d |> odds_ratio(.dep_var = dv, .ind_var = iv)
#> Waiting for profiling to be done...
#> ____________________________
#> Estimates and Odds Ratios: -
#> 
#> # A tibble: 5 × 7
#>   parameter   estimate    se     p_val odds_ratio ci[,"2.5%"] [,"97.5%"] sig  
#>   <chr>          <dbl> <dbl>     <dbl>      <dbl>       <dbl>      <dbl> <fct>
#> 1 (Intercept)    0.182 0.247 0.461         1          NA          NA     NS   
#> 2 ivb           -0.550 0.352 0.118         0.577       0.287       1.15  NS   
#> 3 ivc           -1.41  0.384 0.000250      0.245       0.113       0.512 ***  
#> 4 ivd           -1.91  0.423 0.0000067     0.149       0.0623      0.331 ***  
#> 5 ive           -2.48  0.494 0.0000005     0.0833      0.0289      0.207 ***  

## Using the default contrasts from options("contrasts")
## — adjust confidence level, contrasts are printed 
d |> odds_ratio(.dep_var = dv, .ind_var = iv, .level = 0.99, .print_contr = TRUE)
#> Waiting for profiling to be done...
#> ____________________________
#> Estimates and Odds Ratios: -
#> 
#> # A tibble: 5 × 7
#>   parameter   estimate    se     p_val odds_ratio ci[,"0.5%"] [,"99.5%"] sig  
#>   <chr>          <dbl> <dbl>     <dbl>      <dbl>       <dbl>      <dbl> <fct>
#> 1 (Intercept)    0.182 0.247 0.461         1          NA          NA     NS   
#> 2 ivb           -0.550 0.352 0.118         0.577       0.230       1.42  NS   
#> 3 ivc           -1.41  0.384 0.000250      0.245       0.0876      0.642 ***  
#> 4 ivd           -1.91  0.423 0.0000067     0.149       0.0463      0.421 ***  
#> 5 ive           -2.48  0.494 0.0000005     0.0833      0.0198      0.269 ***  
#> ____________
#> Contrasts: -
#> 
#> $iv
#> [1] "contr.treatment"
#> 

## Specifying treatment contrasts, with last level as base
## — contrasts not printed
d |> set_contrasts(iv, base =  99L, contr = contr.treatment) |>
    odds_ratio(.dep_var = dv, .ind_var = iv)
#> Waiting for profiling to be done...
#> ____________________________
#> Estimates and Odds Ratios: -
#> 
#> # A tibble: 5 × 7
#>   parameter   estimate    se     p_val odds_ratio ci[,"2.5%"] [,"97.5%"] sig  
#>   <chr>          <dbl> <dbl>     <dbl>      <dbl>       <dbl>      <dbl> <fct>
#> 1 (Intercept)   -2.30  0.428 0.0000001       1         NA          NA    ***  
#> 2 iva            2.48  0.494 0.0000005      12.0        4.84       34.5  ***  
#> 3 ivb            1.93  0.496 0.0000956       6.92       2.77       19.9  ***  
#> 4 ivc            1.08  0.519 0.0377          2.94       1.11        8.76 *    
#> 5 ivd            0.580 0.549 0.291           1.79       0.621       5.55 NS   

## Specifying treatment contrasts, with last level as base
## — contrasts printed
d |> set_contrasts(iv, base =  99L, contr = contr.treatment) |>
    odds_ratio(.dep_var = dv, .ind_var = iv, .print_contr = TRUE)
#> Waiting for profiling to be done...
#> ____________________________
#> Estimates and Odds Ratios: -
#> 
#> # A tibble: 5 × 7
#>   parameter   estimate    se     p_val odds_ratio ci[,"2.5%"] [,"97.5%"] sig  
#>   <chr>          <dbl> <dbl>     <dbl>      <dbl>       <dbl>      <dbl> <fct>
#> 1 (Intercept)   -2.30  0.428 0.0000001       1         NA          NA    ***  
#> 2 iva            2.48  0.494 0.0000005      12.0        4.84       34.5  ***  
#> 3 ivb            1.93  0.496 0.0000956       6.92       2.77       19.9  ***  
#> 4 ivc            1.08  0.519 0.0377          2.94       1.11        8.76 *    
#> 5 ivd            0.580 0.549 0.291           1.79       0.621       5.55 NS   
#> ____________
#> Contrasts: -
#> 
#> $iv
#>   a b c d
#> a 1 0 0 0
#> b 0 1 0 0
#> c 0 0 1 0
#> d 0 0 0 1
#> e 0 0 0 0
#> 

## Helmert contrasts specified
## — contrasts printed
d |> set_contrasts(iv, contr = contr.helmert) |>
    odds_ratio(.dep_var = dv, .ind_var = iv, .print_contr = TRUE)
#> Waiting for profiling to be done...
#> ____________________________
#> Estimates and Odds Ratios: -
#> 
#> # A tibble: 5 × 7
#>   parameter   estimate     se    p_val odds_ratio ci[,"2.5%"] [,"97.5%"] sig  
#>   <chr>          <dbl>  <dbl>    <dbl>      <dbl>       <dbl>      <dbl> <fct>
#> 1 (Intercept)   -1.09  0.143  0             1          NA         NA     ***  
#> 2 iv1           -0.275 0.176  0.118         0.760       0.536      1.07  NS   
#> 3 iv2           -0.377 0.114  0.000954      0.686       0.544      0.852 ***  
#> 4 iv3           -0.313 0.0939 0.000854      0.731       0.600      0.871 ***  
#> 5 iv4           -0.304 0.0903 0.000761      0.738       0.606      0.868 ***  
#> ____________
#> Contrasts: -
#> 
#> $iv
#>   [,1] [,2] [,3] [,4]
#> a   -1   -1   -1   -1
#> b    1   -1   -1   -1
#> c    0    2   -1   -1
#> d    0    0    3   -1
#> e    0    0    0    4
#> 

# Set default unordered contrasts in options("contrasts") to Helmert
options("contrasts" =  c(unordered = "contr.helmert", ordered = "contr.poly"))
getOption("contrasts")
#>       unordered         ordered 
#> "contr.helmert"    "contr.poly" 

## Using the default, unordered Helmert contrasts
## — contrasts printed
d |> odds_ratio(.dep_var = dv, .ind_var = iv, .print_contr = TRUE)
#> Waiting for profiling to be done...
#> ____________________________
#> Estimates and Odds Ratios: -
#> 
#> # A tibble: 5 × 7
#>   parameter   estimate     se    p_val odds_ratio ci[,"2.5%"] [,"97.5%"] sig  
#>   <chr>          <dbl>  <dbl>    <dbl>      <dbl>       <dbl>      <dbl> <fct>
#> 1 (Intercept)   -1.09  0.143  0             1          NA         NA     ***  
#> 2 iv1           -0.275 0.176  0.118         0.760       0.536      1.07  NS   
#> 3 iv2           -0.377 0.114  0.000954      0.686       0.544      0.852 ***  
#> 4 iv3           -0.313 0.0939 0.000854      0.731       0.600      0.871 ***  
#> 5 iv4           -0.304 0.0903 0.000761      0.738       0.606      0.868 ***  
#> ____________
#> Contrasts: -
#> 
#> $iv
#> [1] "contr.helmert"
#> 

## Specify treatment contrasts
## — contrasts printed
d |> set_contrasts(iv, contr = contr.treatment) |>
    odds_ratio(.dep_var = dv, .ind_var = iv, .print_contr = TRUE)
#> Waiting for profiling to be done...
#> ____________________________
#> Estimates and Odds Ratios: -
#> 
#> # A tibble: 5 × 7
#>   parameter   estimate    se     p_val odds_ratio ci[,"2.5%"] [,"97.5%"] sig  
#>   <chr>          <dbl> <dbl>     <dbl>      <dbl>       <dbl>      <dbl> <fct>
#> 1 (Intercept)    0.182 0.247 0.461         1          NA          NA     NS   
#> 2 ivb           -0.550 0.352 0.118         0.577       0.287       1.15  NS   
#> 3 ivc           -1.41  0.384 0.000250      0.245       0.113       0.512 ***  
#> 4 ivd           -1.91  0.423 0.0000067     0.149       0.0623      0.331 ***  
#> 5 ive           -2.48  0.494 0.0000005     0.0833      0.0289      0.207 ***  
#> ____________
#> Contrasts: -
#> 
#> $iv
#>   b c d e
#> a 0 0 0 0
#> b 1 0 0 0
#> c 0 1 0 0
#> d 0 0 1 0
#> e 0 0 0 1
#> 

## Restore default contrasts in options("contrasts")
options("contrasts" =  c(unordered = "contr.treatment", ordered = "contr.poly"))
options("contrasts")
#> $contrasts
#>         unordered           ordered 
#> "contr.treatment"      "contr.poly" 
#> 

## Invoking the S3 method for class "binom_contingency" 
d |> binom_contingency(dv, iv) |> odds_ratio(.ind_var = iv)
#> Waiting for profiling to be done...
#> ____________________________
#> Estimates and Odds Ratios: -
#> 
#> # A tibble: 5 × 7
#>   parameter   estimate    se     p_val odds_ratio ci[,"2.5%"] [,"97.5%"] sig  
#>   <chr>          <dbl> <dbl>     <dbl>      <dbl>       <dbl>      <dbl> <fct>
#> 1 (Intercept)    0.182 0.247 0.461         1          NA          NA     NS   
#> 2 ivb           -0.550 0.352 0.118         0.577       0.287       1.15  NS   
#> 3 ivc           -1.41  0.384 0.000250      0.245       0.113       0.512 ***  
#> 4 ivd           -1.91  0.423 0.0000067     0.149       0.0623      0.331 ***  
#> 5 ive           -2.48  0.494 0.0000005     0.0833      0.0289      0.207 ***  

## Create multivariable glm object and specify treatment contrasts
(d <- list(
    iv2 = list(g = c("a", "c", "e"), h = c("b", "d", "f")),
    iv3 = list(i = c("a", "b", "c"), j = c("d", "e", "f"))
) |> add_grps(binom_data(levels = 6), iv, .key = _))
#> __________________________
#> Simulated Binomial Data: -
#> 
#> # A tibble: 6 × 5
#>   iv    iv2   iv3      pn    qn
#>   <fct> <fct> <fct> <int> <int>
#> 1 a     g     i        39    27
#> 2 b     h     i        30    36
#> 3 c     g     i        19    47
#> 4 d     h     j        17    49
#> 5 e     g     j         9    57
#> 6 f     h     j         3    63

set_contr_treat(d, num_range("iv", 2:3)) <- c(1L, 2L)
get_contr_data(d)
#> $iv
#> NULL
#> 
#> $iv2
#>   h
#> g 0
#> h 1
#> 
#> $iv3
#>   i
#> i 1
#> j 0
#> 

glm1 <- glm(cbind(pn, qn) ~ iv2 + iv3, family = binomial, data = d)

glm1 |> summary()
#> 
#> Call:
#> glm(formula = cbind(pn, qn) ~ iv2 + iv3, family = binomial, data = d)
#> 
#> Coefficients:
#>             Estimate Std. Error z value Pr(>|z|)    
#> (Intercept) -1.81758    0.26222  -6.931 4.17e-12 ***
#> iv2h         0.08168    0.24783   0.330    0.742    
#> iv3i         1.56713    0.26105   6.003 1.93e-09 ***
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#> 
#> (Dispersion parameter for binomial family taken to be 1)
#> 
#>     Null deviance: 68.942  on 5  degrees of freedom
#> Residual deviance: 25.099  on 3  degrees of freedom
#> AIC: 56.045
#> 
#> Number of Fisher Scoring iterations: 4
#> 

## Invoking the S3 method for class "glm"
glm1 |> odds_ratio()
#> 
#> Call:  glm(formula = cbind(pn, qn) ~ iv2 + iv3, family = binomial, data = d)
#> 
#> Waiting for profiling to be done...
#> ____________________________
#> Estimates and Odds Ratios: -
#> 
#> # A tibble: 3 × 7
#>   parameter   estimate    se p_val odds_ratio ci[,"2.5%"] [,"97.5%"] sig  
#>   <chr>          <dbl> <dbl> <dbl>      <dbl>       <dbl>      <dbl> <fct>
#> 1 (Intercept)  -1.82   0.262 0           1         NA          NA    ***  
#> 2 iv2h          0.0817 0.248 0.742       1.09       0.669       1.77 NS   
#> 3 iv3i          1.57   0.261 0           4.79       2.91        8.11 ***  

glm1 |> odds_ratio(.print_call = FALSE, .stat = TRUE, .print_contr = TRUE)
#> Waiting for profiling to be done...
#> ____________________________
#> Estimates and Odds Ratios: -
#> 
#> # A tibble: 3 × 8
#>   parameter   estimate    se `z value` p_val odds_ratio ci[,"2.5%"] sig  
#>   <chr>          <dbl> <dbl>     <dbl> <dbl>      <dbl>       <dbl> <fct>
#> 1 (Intercept)  -1.82   0.262    -6.93  0           1         NA     ***  
#> 2 iv2h          0.0817 0.248     0.330 0.742       1.09       0.669 NS   
#> 3 iv3i          1.57   0.261     6.00  0           4.79       2.91  ***  
#> # ℹ 1 more variable: ci[2] <dbl>
#> ____________
#> Contrasts: -
#> 
#> $iv2
#>   h
#> g 0
#> h 1
#> 
#> $iv3
#>   i
#> i 1
#> j 0
#> 

## Invoking the S3 formula() method for class "odds_ratio"
glm1 |> odds_ratio(.print_call = FALSE) |> formula()
#> Waiting for profiling to be done...
#> cbind(pn, qn) ~ iv2 + iv3
#> <environment: 0x5634afd64ed8>

## Compare S3 method for class "glm" to that for "data.frame"
## — only possible for univariable analyses
(d <- binom_data())
#> __________________________
#> Simulated Binomial Data: -
#> 
#> # A tibble: 5 × 3
#>   iv       pn    qn
#> * <fct> <int> <int>
#> 1 a        25    41
#> 2 b        27    39
#> 3 c        23    43
#> 4 d        17    49
#> 5 e         5    61

glm(cbind(pn, qn) ~ iv, family = binomial, data = d) |>
    odds_ratio()
#> 
#> Call:  glm(formula = cbind(pn, qn) ~ iv, family = binomial, data = d)
#> 
#> Waiting for profiling to be done...
#> ____________________________
#> Estimates and Odds Ratios: -
#> 
#> # A tibble: 5 × 7
#>   parameter   estimate    se    p_val odds_ratio ci[,"2.5%"] [,"97.5%"] sig  
#>   <chr>          <dbl> <dbl>    <dbl>      <dbl>       <dbl>      <dbl> <fct>
#> 1 (Intercept)   -0.495 0.254 0.0512        1         NA          NA     .    
#> 2 ivb            0.127 0.356 0.722         1.14       0.564       2.29  NS   
#> 3 ivc           -0.131 0.362 0.718         0.877      0.430       1.78  NS   
#> 4 ivd           -0.564 0.379 0.137         0.569      0.267       1.19  NS   
#> 5 ive           -2.01  0.530 0.000152      0.134      0.0426      0.353 ***  

d |> odds_ratio(.dep_var = cbind(pn, qn), .ind_var = iv)
#> Waiting for profiling to be done...
#> ____________________________
#> Estimates and Odds Ratios: -
#> 
#> # A tibble: 5 × 7
#>   parameter   estimate    se    p_val odds_ratio ci[,"2.5%"] [,"97.5%"] sig  
#>   <chr>          <dbl> <dbl>    <dbl>      <dbl>       <dbl>      <dbl> <fct>
#> 1 (Intercept)   -0.495 0.254 0.0512        1         NA          NA     .    
#> 2 ivb            0.127 0.356 0.722         1.14       0.564       2.29  NS   
#> 3 ivc           -0.131 0.362 0.718         0.877      0.430       1.78  NS   
#> 4 ivd           -0.564 0.379 0.137         0.569      0.267       1.19  NS   
#> 5 ive           -2.01  0.530 0.000152      0.134      0.0426      0.353 ***  

## Helmert contrasts given more easily readable names
d |> set_contrasts(iv) <- contr.helmert
helm_names(d$iv) <- c(":", "v")
d |> get_contrasts(iv)
#>   a v b a:b v c a:c v d a:d v e
#> a    -1      -1      -1      -1
#> b     1      -1      -1      -1
#> c     0       2      -1      -1
#> d     0       0       3      -1
#> e     0       0       0       4

## Add separator as last little tweak ;-)
contr_colpfx(d$iv) <- ": "

glm(cbind(pn, qn) ~ iv, family = binomial, data = d) |>
    odds_ratio()
#> 
#> Call:  glm(formula = cbind(pn, qn) ~ iv, family = binomial, data = d)
#> 
#> Waiting for profiling to be done...
#> ____________________________
#> Estimates and Odds Ratios: -
#> 
#> # A tibble: 5 × 7
#>   parameter   estimate     se    p_val odds_ratio ci[,"2.5%"] [,"97.5%"] sig  
#>   <chr>          <dbl>  <dbl>    <dbl>      <dbl>       <dbl>      <dbl> <fct>
#> 1 (Intercept)  -1.01   0.140  0             1          NA         NA     ***  
#> 2 iv: a v b     0.0635 0.178  0.722         1.07        0.751      1.51  NS   
#> 3 iv: a:b v c  -0.0648 0.105  0.535         0.937       0.761      1.15  NS   
#> 4 iv: a:c v d  -0.141  0.0794 0.0764        0.869       0.740      1.01  .    
#> 5 iv: a:d v e  -0.373  0.0966 0.000114      0.689       0.555      0.817 ***  

d |> odds_ratio(.dep_var = cbind(pn, qn), .ind_var = iv)
#> Waiting for profiling to be done...
#> ____________________________
#> Estimates and Odds Ratios: -
#> 
#> # A tibble: 5 × 7
#>   parameter   estimate     se    p_val odds_ratio ci[,"2.5%"] [,"97.5%"] sig  
#>   <chr>          <dbl>  <dbl>    <dbl>      <dbl>       <dbl>      <dbl> <fct>
#> 1 (Intercept)  -1.01   0.140  0             1          NA         NA     ***  
#> 2 iv: a v b     0.0635 0.178  0.722         1.07        0.751      1.51  NS   
#> 3 iv: a:b v c  -0.0648 0.105  0.535         0.937       0.761      1.15  NS   
#> 4 iv: a:c v d  -0.141  0.0794 0.0764        0.869       0.740      1.01  .    
#> 5 iv: a:d v e  -0.373  0.0966 0.000114      0.689       0.555      0.817 ***  

## Printing lengthier output with print_all()
binom_data(26, 100) |>
    odds_ratio(.dep_var = cbind(pn, qn), .ind_var = iv, .print_contr = TRUE) |>
    print_all()
#> Waiting for profiling to be done...
#> ____________________________
#> Estimates and Odds Ratios: -
#> 
#> # A tibble: 26 × 7
#>    parameter   estimate    se     p_val odds_ratio ci[,"2.5%"] [,"97.5%"] sig  
#>    <chr>          <dbl> <dbl>     <dbl>      <dbl>       <dbl>      <dbl> <fct>
#>  1 (Intercept)    0.201 0.201 0.318         1          NA          NA     NS   
#>  2 ivb           -0.690 0.288 0.0165        0.501       0.284       0.878 *    
#>  3 ivc            0     0.284 1             1           0.572       1.75  NS   
#>  4 ivd           -0.241 0.284 0.396         0.786       0.450       1.37  NS   
#>  5 ive           -0.483 0.285 0.0904        0.617       0.352       1.08  .    
#>  6 ivf           -0.442 0.285 0.121         0.643       0.367       1.12  NS   
#>  7 ivg           -0.606 0.286 0.0344        0.545       0.310       0.953 *    
#>  8 ivh           -0.733 0.289 0.0111        0.481       0.271       0.843 *    
#>  9 ivi           -0.776 0.289 0.00735       0.460       0.259       0.808 **   
#> 10 ivj           -0.483 0.285 0.0904        0.617       0.352       1.08  .    
#> 11 ivk           -0.864 0.291 0.00304       0.421       0.236       0.743 **   
#> 12 ivl           -1.53  0.317 0.0000015     0.217       0.115       0.400 ***  
#> 13 ivm           -0.864 0.291 0.00304       0.421       0.236       0.743 **   
#> 14 ivn           -0.909 0.293 0.00190       0.403       0.225       0.711 **   
#> 15 ivo           -1.25  0.304 0.000041      0.287       0.157       0.517 ***  
#> 16 ivp           -1.30  0.306 0.000022      0.273       0.148       0.492 ***  
#> 17 ivq           -1.20  0.302 0.0000752     0.303       0.166       0.542 ***  
#> 18 ivr           -1.05  0.297 0.000412      0.351       0.194       0.623 ***  
#> 19 ivs           -1.53  0.317 0.0000015     0.217       0.115       0.400 ***  
#> 20 ivt           -1.86  0.339 0             0.156       0.0782      0.297 ***  
#> 21 ivu           -2.29  0.378 0             0.101       0.0462      0.205 ***  
#> 22 ivv           -2.10  0.359 0             0.122       0.0585      0.241 ***  
#> 23 ivw           -1.59  0.321 0.0000008     0.205       0.107       0.378 ***  
#> 24 ivx           -2.19  0.368 0             0.112       0.0523      0.223 ***  
#> 25 ivy           -2.40  0.389 0             0.0909      0.0404      0.188 ***  
#> 26 ivz           -2.95  0.467 0             0.0522      0.0190      0.122 ***  
#> ____________
#> Contrasts: -
#> 
#> $iv
#> [1] "contr.treatment"
#> 

rm(d, glm1)