compute contrasts for full models

my_contrast(
  m,
  linfct,
  coef = coefficients(m),
  Sigma.hat = vcov(m),
  confint = 0.95
)

Arguments

m

linear model generated using lm

linfct

linear function

coef

use default

confint

which confidence interval to determine

use

default

Examples


m <-  sim_make_model_lm( "factors")
#> creating sampleName from fileName column
#> completing cases
#> Joining with `by = join_by(protein_Id)`
linfct <- linfct_from_model(m)$linfct_factors
my_glht(m, linfct)
#> # A tibble: 4 × 10
#>   contrast    null.value estimate std.error statistic adj.p.value conf.low
#>   <chr>            <dbl>    <dbl>     <dbl>     <dbl>       <dbl>    <dbl>
#> 1 BackgroundX          0     18.6     0.551      33.8    4.62e-14     17.4
#> 2 BackgroundZ          0     18.2     0.551      33.0    6.29e-14     17.0
#> 3 TreatmentA           0     18.8     0.551      34.1    4.26e-14     17.6
#> 4 TreatmentB           0     18.1     0.551      32.8    6.83e-14     16.9
#> # ℹ 3 more variables: conf.high <dbl>, df <int>, sigma <dbl>
my_contrast(m, linfct, confint = 0.95)
#>                     lhs    sigma df estimate std.error statistic      p.value
#> BackgroundX BackgroundX 1.557675 13 18.63959 0.5507212  33.84577 4.612815e-14
#> BackgroundZ BackgroundZ 1.557675 13 18.19440 0.5507212  33.03740 6.294815e-14
#> TreatmentA   TreatmentA 1.557675 13 18.75377 0.5507212  34.05311 4.264271e-14
#> TreatmentB   TreatmentB 1.557675 13 18.08021 0.5507212  32.83007 6.825487e-14
#>             conf.low conf.high
#> BackgroundX 17.44983  19.82935
#> BackgroundZ 17.00464  19.38416
#> TreatmentA  17.56401  19.94353
#> TreatmentB  16.89045  19.26998
my_contrast(m, linfct, confint = 0.99)
#>                     lhs    sigma df estimate std.error statistic      p.value
#> BackgroundX BackgroundX 1.557675 13 18.63959 0.5507212  33.84577 4.612815e-14
#> BackgroundZ BackgroundZ 1.557675 13 18.19440 0.5507212  33.03740 6.294815e-14
#> TreatmentA   TreatmentA 1.557675 13 18.75377 0.5507212  34.05311 4.264271e-14
#> TreatmentB   TreatmentB 1.557675 13 18.08021 0.5507212  32.83007 6.825487e-14
#>             conf.low conf.high
#> BackgroundX 16.98066  20.29851
#> BackgroundZ 16.53547  19.85332
#> TreatmentA  17.09485  20.41269
#> TreatmentB  16.42129  19.73914