Skip to contents

Takes fitted model output to created predicted values for user-specified histories (pooling for imputed data), before conducting contrast comparisons (pooling for imputed data), correcting for multiple comparisons, and then plotting results.

Usage

compareHistories(
  fit,
  hi_lo_cut,
  dose_level = "h",
  reference = NULL,
  comparison = NULL,
  mc_comp_method = "BH",
  verbose = FALSE,
  save.out = FALSE
)

# S3 method for class 'devMSM_comparisons'
print(x, save.out = FALSE, ...)

# S3 method for class 'devMSM_comparisons'
plot(
  x,
  colors = "Dark2",
  exp_lab = NULL,
  out_lab = NULL,
  save.out = FALSE,
  ...
)

# S3 method for class 'devMSM_comparisons'
summary(object, type = "comps", ...)

Arguments

fit

list of model outputs from fitModel()

hi_lo_cut

list of two numbers indicating quantile values that reflect high and low values, respectively, for continuous exposure

dose_level

(optional) "l" or "h" indicating whether low or high doses should be tallied in tables and plots (default is high "h")

reference

lists of one or more strings of "-"-separated "l" and "h" values indicative of a reference exposure history to which to compare comparison, required if comparison is supplied

comparison

(optional) list of one or more strings of "-"-separated "l" and "h" values indicative of comparison history/histories to compare to reference, required if reference is supplied

mc_comp_method

(optional) character abbreviation for multiple comparison correction method for stats::p.adjust, default is Benjamini-Hochburg ("BH")

verbose

(optional) TRUE or FALSE indicator for printing output to console. default is FALSE.

save.out

(optional) Either logical or a character string. If TRUE, it will output the result to a default file name within home_dir set in initMSM(). You can load the data with x <- readRDS(file). To use a non-default file name, specify a character string with the file name. It will save relative to home_dir. There might be naming conflicts where two objects get saved to the same file. In these cases, users should specify a custom name. default is FALSE.

x

devMSM_histories object from compareHistories()

...

ignored

colors

(optional) character specifying Brewer palette or list of colors (n(epochs)+1) for plotting (default is "Dark2" palette)

exp_lab

(optional) character label for exposure variable in plots (default is variable name)

out_lab

(optional) character label for outcome variable in plots (default is variable name)

object

devMSM_histories object from compareHistories()

type

Either "preds" or "comps" corresponding to the results of marginaleffects::avg_predictions() at low and high dosages or marginaleffects::avg_comparisons() respectively

Value

list containing two dataframes: preds with predictions from marginaleffects::avg_predictions() containing average expected outcome for different exposure histories and comps with contrasts from marginaleffects::comparisons() comparing different exposure history

Examples

library(devMSMs)
set.seed(123)
data <- data.frame(
  ID = 1:50,
  A.1 = rnorm(n = 50),
  A.2 = rnorm(n = 50),
  A.3 = rnorm(n = 50),
  B.1 = rnorm(n = 50),
  B.2 = rnorm(n = 50),
  B.3 = rnorm(n = 50),
  C = rnorm(n = 50),
  D.3 = rnorm(n = 50)
)
obj <- initMSM(
  data,
  exposure = c("A.1", "A.2", "A.3"),
  ti_conf = c("C"),
  tv_conf = c("B.1", "B.2", "B.3", "D.3")
)
f <- createFormulas(obj, type = "short")
w <- createWeights(data = data, formulas = f)
fit <- fitModel(
  data = data, weights = w,
  outcome = "D.3", model = "m0"
)

comp <- compareHistories(
  fit = fit,
  hi_lo_cut = c(0.3, 0.6)
)
print(comp)
#> Summary of Exposure Main Effects:
#> USER ALERT: Out of the total of 50 individuals in the sample, below is the distribution of the 50 (100%) individuals that fall into 24 user-selected exposure histories (out of the 24 total) created from 30th and 60th percentile values for low and high levels of exposure-epoch A.1, A.2, A.3. 
#> USER ALERT: Please inspect the distribution of the sample across the following exposure histories and ensure there is sufficient spread to avoid extrapolation and low precision:
#> 
#> +---------------+---+
#> | epoch_history | n |
#> +===============+===+
#> | NA-NA-h       | 2 |
#> +---------------+---+
#> | NA-NA-l       | 1 |
#> +---------------+---+
#> | NA-h-NA       | 2 |
#> +---------------+---+
#> | NA-h-h        | 3 |
#> +---------------+---+
#> | NA-h-l        | 2 |
#> +---------------+---+
#> | NA-l-NA       | 1 |
#> +---------------+---+
#> | NA-l-h        | 2 |
#> +---------------+---+
#> | NA-l-l        | 2 |
#> +---------------+---+
#> | h-NA-NA       | 2 |
#> +---------------+---+
#> | h-NA-h        | 4 |
#> +---------------+---+
#> | h-NA-l        | 1 |
#> +---------------+---+
#> | h-h-NA        | 2 |
#> +---------------+---+
#> | h-h-h         | 3 |
#> +---------------+---+
#> | h-h-l         | 3 |
#> +---------------+---+
#> | h-l-NA        | 1 |
#> +---------------+---+
#> | h-l-h         | 2 |
#> +---------------+---+
#> | h-l-l         | 2 |
#> +---------------+---+
#> | l-NA-NA       | 3 |
#> +---------------+---+
#> | l-NA-l        | 2 |
#> +---------------+---+
#> | l-h-NA        | 2 |
#> +---------------+---+
#> | l-h-h         | 1 |
#> +---------------+---+
#> | l-h-l         | 2 |
#> +---------------+---+
#> | l-l-NA        | 2 |
#> +---------------+---+
#> | l-l-h         | 3 |
#> +---------------+---+
#> 
#> Table: Summary of user-selected exposure histories based on exposure main effects A.1, A.2, A.3: 
#> 
#> Below are the pooled average predictions by user-specified history:
#> +-------+-------+-------+--------+----------+-----------+----------+-----------+
#> | term  | A.1   | A.2   | A.3    | estimate | std.error | conf.low | conf.high |
#> +=======+=======+=======+========+==========+===========+==========+===========+
#> | l-l-l | -0.47 | -0.3  | -0.804 | -0.15    | 0.2       | -0.54    | 0.239     |
#> +-------+-------+-------+--------+----------+-----------+----------+-----------+
#> | l-l-h | -0.47 | -0.3  | -0.051 | -0.064   | 0.2       | -0.47    | 0.338     |
#> +-------+-------+-------+--------+----------+-----------+----------+-----------+
#> | l-h-l | -0.47 |  0.31 | -0.804 | -0.093   | 0.18      | -0.44    | 0.25      |
#> +-------+-------+-------+--------+----------+-----------+----------+-----------+
#> | l-h-h | -0.47 |  0.31 | -0.051 | -0.007   | 0.19      | -0.37    | 0.357     |
#> +-------+-------+-------+--------+----------+-----------+----------+-----------+
#> | h-l-l |  0.24 | -0.3  | -0.804 | -0.235   | 0.15      | -0.53    | 0.059     |
#> +-------+-------+-------+--------+----------+-----------+----------+-----------+
#> | h-l-h |  0.24 | -0.3  | -0.051 | -0.149   | 0.15      | -0.45    | 0.154     |
#> +-------+-------+-------+--------+----------+-----------+----------+-----------+
#> | h-h-l |  0.24 |  0.31 | -0.804 | -0.179   | 0.13      | -0.43    | 0.07      |
#> +-------+-------+-------+--------+----------+-----------+----------+-----------+
#> | h-h-h |  0.24 |  0.31 | -0.051 | -0.093   | 0.14      | -0.36    | 0.176     |
#> +-------+-------+-------+--------+----------+-----------+----------+-----------+ 
#> 
#> Conducting multiple comparison correction for all pairings between comparison histories and each refernece history using the BH method. 
#> 
#> 
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | term              | estimate      | std.error  | p.value   | conf.low    | conf.high  | p.value_corr |
#> +===================+===============+============+===========+=============+============+==============+
#> | (l-l-l) - (l-l-h) | -0.0860245895 | 0.09323351 | 0.3561746 | -0.26875891 | 0.09670973 | 0.5955722    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (l-l-l) - (l-h-l) | -0.0567671468 | 0.06804542 | 0.4041380 | -0.19013372 | 0.07659943 | 0.5955722    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (l-l-l) - (l-h-h) | -0.1427917364 | 0.12113186 | 0.2384729 | -0.38020583 | 0.09462235 | 0.5955722    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (l-l-l) - (h-l-l) |  0.0855518211 | 0.09515347 | 0.3686031 | -0.10094556 | 0.27204920 | 0.5955722    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (l-l-l) - (h-l-h) | -0.0004727684 | 0.12853504 | 0.9970653 | -0.25239681 | 0.25145127 | 0.9970653    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (l-l-l) - (h-h-l) |  0.0287846743 | 0.12605827 | 0.8193787 | -0.21828499 | 0.27585434 | 0.8824078    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (l-l-l) - (h-h-h) | -0.0572399153 | 0.15718786 | 0.7157462 | -0.36532245 | 0.25084262 | 0.8824078    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (l-l-h) - (l-h-l) |  0.0292574427 | 0.10941845 | 0.7891686 | -0.18519878 | 0.24371366 | 0.8824078    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (l-l-h) - (l-h-h) | -0.0567671468 | 0.06804540 | 0.4041379 | -0.19013369 | 0.07659939 | 0.5955722    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (l-l-h) - (h-l-l) |  0.1715764106 | 0.13773921 | 0.2128887 | -0.09838748 | 0.44154030 | 0.5955722    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (l-l-h) - (h-l-h) |  0.0855518211 | 0.09515351 | 0.3686033 | -0.10094562 | 0.27204927 | 0.5955722    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (l-l-h) - (h-h-l) |  0.1148092638 | 0.15639156 | 0.4628791 | -0.19171256 | 0.42133108 | 0.6480308    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (l-l-h) - (h-h-h) |  0.0287846743 | 0.12605825 | 0.8193786 | -0.21828496 | 0.27585431 | 0.8824078    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (l-h-l) - (l-h-h) | -0.0860245895 | 0.09323348 | 0.3561744 | -0.26875886 | 0.09670968 | 0.5955722    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (l-h-l) - (h-l-l) |  0.1423189679 | 0.10713569 | 0.1840462 | -0.06766312 | 0.35230106 | 0.5955722    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (l-h-l) - (h-l-h) |  0.0562943784 | 0.13264560 | 0.6712764 | -0.20368622 | 0.31627498 | 0.8824078    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (l-h-l) - (h-h-l) |  0.0855518211 | 0.09515354 | 0.3686034 | -0.10094568 | 0.27204932 | 0.5955722    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (l-h-l) - (h-h-h) | -0.0004727684 | 0.12853506 | 0.9970653 | -0.25239686 | 0.25145133 | 0.9970653    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (l-h-h) - (h-l-l) |  0.2283435575 | 0.15081852 | 0.1300186 | -0.06725530 | 0.52394242 | 0.5955722    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (l-h-h) - (h-l-h) |  0.1423189679 | 0.10713569 | 0.1840463 | -0.06766313 | 0.35230107 | 0.5955722    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (l-h-h) - (h-h-l) |  0.1715764106 | 0.13773922 | 0.2128888 | -0.09838750 | 0.44154032 | 0.5955722    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (l-h-h) - (h-h-h) |  0.0855518211 | 0.09515352 | 0.3686034 | -0.10094565 | 0.27204929 | 0.5955722    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (h-l-l) - (h-l-h) | -0.0860245895 | 0.09323350 | 0.3561745 | -0.26875889 | 0.09670971 | 0.5955722    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (h-l-l) - (h-h-l) | -0.0567671468 | 0.06804546 | 0.4041383 | -0.19013380 | 0.07659951 | 0.5955722    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (h-l-l) - (h-h-h) | -0.1427917364 | 0.12113192 | 0.2384731 | -0.38020594 | 0.09462247 | 0.5955722    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (h-l-h) - (h-h-l) |  0.0292574427 | 0.10941843 | 0.7891686 | -0.18519874 | 0.24371362 | 0.8824078    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (h-l-h) - (h-h-h) | -0.0567671468 | 0.06804543 | 0.4041381 | -0.19013374 | 0.07659945 | 0.5955722    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+
#> | (h-h-l) - (h-h-h) | -0.0860245895 | 0.09323350 | 0.3561745 | -0.26875888 | 0.09670970 | 0.5955722    |
#> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ 
plot(comp)

summary(comp, "preds")
#>    term        A.1        A.2         A.3     estimate std.error   statistic
#> 1 l-l-l -0.4684962 -0.2971206 -0.80434443 -0.149799589 0.1983536 -0.75521501
#> 2 l-l-h -0.4684962 -0.2971206 -0.05134827 -0.063774999 0.2048054 -0.31139320
#> 3 l-h-l -0.4684962  0.3148300 -0.80434443 -0.093032442 0.1750306 -0.53152099
#> 4 l-h-h -0.4684962  0.3148300 -0.05134827 -0.007007852 0.1859760 -0.03768148
#> 5 h-l-l  0.2359494 -0.2971206 -0.80434443 -0.235351410 0.1502513 -1.56638563
#> 6 h-l-h  0.2359494 -0.2971206 -0.05134827 -0.149326820 0.1547615 -0.96488363
#> 7 h-h-l  0.2359494  0.3148300 -0.80434443 -0.178584263 0.1267806 -1.40860879
#> 8 h-h-h  0.2359494  0.3148300 -0.05134827 -0.092559673 0.1371105 -0.67507375
#>     p.value    s.value   conf.low  conf.high dose
#> 1 0.4501200 1.15161848 -0.5385654 0.23896625    0
#> 2 0.7555017 0.40449305 -0.4651861 0.33763614    1
#> 3 0.5950578 0.74889829 -0.4360861 0.25002124    1
#> 4 0.9699416 0.04403015 -0.3715142 0.35749845    2
#> 5 0.1172584 3.09223725 -0.5298385 0.05913564    1
#> 6 0.3346031 1.57947727 -0.4526538 0.15400011    2
#> 7 0.1589509 2.65334711 -0.4270697 0.06990114    2
#> 8 0.4996289 1.00107114 -0.3612912 0.17617189    3
summary(comp, "comps")
#>                 term      estimate  std.error    statistic   p.value
#> 1  (l-l-l) - (l-l-h) -0.0860245895 0.09323351 -0.922678895 0.3561746
#> 2  (l-l-l) - (l-h-l) -0.0567671468 0.06804542 -0.834253748 0.4041380
#> 3  (l-l-l) - (l-h-h) -0.1427917364 0.12113186 -1.178812343 0.2384729
#> 4  (l-l-l) - (h-l-l)  0.0855518211 0.09515347  0.899092985 0.3686031
#> 5  (l-l-l) - (h-l-h) -0.0004727684 0.12853504 -0.003678129 0.9970653
#> 6  (l-l-l) - (h-h-l)  0.0287846743 0.12605827  0.228344197 0.8193787
#> 7  (l-l-l) - (h-h-h) -0.0572399153 0.15718786 -0.364149728 0.7157462
#> 8  (l-l-h) - (l-h-l)  0.0292574427 0.10941845  0.267390396 0.7891686
#> 9  (l-l-h) - (l-h-h) -0.0567671468 0.06804540 -0.834253950 0.4041379
#> 10 (l-l-h) - (h-l-l)  0.1715764106 0.13773921  1.245661352 0.2128887
#> 11 (l-l-h) - (h-l-h)  0.0855518211 0.09515351  0.899092683 0.3686033
#> 12 (l-l-h) - (h-h-l)  0.1148092638 0.15639156  0.734114205 0.4628791
#> 13 (l-l-h) - (h-h-h)  0.0287846743 0.12605825  0.228344230 0.8193786
#> 14 (l-h-l) - (l-h-h) -0.0860245895 0.09323348 -0.922679121 0.3561744
#> 15 (l-h-l) - (h-l-l)  0.1423189679 0.10713569  1.328399262 0.1840462
#> 16 (l-h-l) - (h-l-h)  0.0562943784 0.13264560  0.424396874 0.6712764
#> 17 (l-h-l) - (h-h-l)  0.0855518211 0.09515354  0.899092410 0.3686034
#> 18 (l-h-l) - (h-h-h) -0.0004727684 0.12853506 -0.003678128 0.9970653
#> 19 (l-h-h) - (h-l-l)  0.2283435575 0.15081852  1.514028672 0.1300186
#> 20 (l-h-h) - (h-l-h)  0.1423189679 0.10713569  1.328399184 0.1840463
#> 21 (l-h-h) - (h-h-l)  0.1715764106 0.13773922  1.245661276 0.2128888
#> 22 (l-h-h) - (h-h-h)  0.0855518211 0.09515352  0.899092564 0.3686034
#> 23 (h-l-l) - (h-l-h) -0.0860245895 0.09323350 -0.922678981 0.3561745
#> 24 (h-l-l) - (h-h-l) -0.0567671468 0.06804546 -0.834253253 0.4041383
#> 25 (h-l-l) - (h-h-h) -0.1427917364 0.12113192 -1.178811770 0.2384731
#> 26 (h-l-h) - (h-h-l)  0.0292574427 0.10941843  0.267390449 0.7891686
#> 27 (h-l-h) - (h-h-h) -0.0567671468 0.06804543 -0.834253622 0.4041381
#> 28 (h-h-l) - (h-h-h) -0.0860245895 0.09323350 -0.922679011 0.3561745
#>        s.value    conf.low  conf.high  dose p.value_corr
#> 1  1.489343589 -0.26875891 0.09670973 0 - 1    0.5955722
#> 2  1.307080051 -0.19013372 0.07659943 0 - 1    0.5955722
#> 3  2.068102717 -0.38020583 0.09462235 0 - 2    0.5955722
#> 4  1.439859757 -0.10094556 0.27204920 0 - 1    0.5955722
#> 5  0.004240125 -0.25239681 0.25145127 0 - 2    0.9970653
#> 6  0.287397761 -0.21828499 0.27585434 0 - 2    0.8824078
#> 7  0.482479980 -0.36532245 0.25084262 0 - 3    0.8824078
#> 8  0.341594553 -0.18519878 0.24371366 1 - 1    0.8824078
#> 9  1.307080457 -0.19013369 0.07659939 1 - 2    0.5955722
#> 10 2.231828396 -0.09838748 0.44154030 1 - 1    0.5955722
#> 11 1.439859126 -0.10094562 0.27204927 1 - 2    0.5955722
#> 12 1.111292558 -0.19171256 0.42133108 1 - 2    0.6480308
#> 13 0.287397807 -0.21828496 0.27585431 1 - 3    0.8824078
#> 14 1.489344066 -0.26875886 0.09670968 1 - 2    0.5955722
#> 15 2.441859794 -0.06766312 0.35230106 1 - 1    0.5955722
#> 16 0.575021172 -0.20368622 0.31627498 1 - 2    0.8824078
#> 17 1.439858557 -0.10094568 0.27204932 1 - 2    0.5955722
#> 18 0.004240124 -0.25239686 0.25145133 1 - 3    0.9970653
#> 19 2.943210429 -0.06725530 0.52394242 2 - 1    0.5955722
#> 20 2.441859592 -0.06766313 0.35230107 2 - 2    0.5955722
#> 21 2.231828206 -0.09838750 0.44154032 2 - 2    0.5955722
#> 22 1.439858879 -0.10094565 0.27204929 2 - 3    0.5955722
#> 23 1.489343772 -0.26875889 0.09670971 1 - 2    0.5955722
#> 24 1.307079055 -0.19013380 0.07659951 1 - 2    0.5955722
#> 25 2.068101336 -0.38020594 0.09462247 1 - 3    0.5955722
#> 26 0.341594628 -0.18519874 0.24371362 2 - 2    0.8824078
#> 27 1.307079797 -0.19013374 0.07659945 2 - 3    0.5955722
#> 28 1.489343836 -0.26875888 0.09670970 2 - 3    0.5955722

comp2 <- compareHistories(
  fit = fit,
  hi_lo_cut = c(0.3, 0.6),
  reference = "l-l-l",
  comparison = c("h-h-h", "h-h-l")
)
print(comp2)
#> Summary of Exposure Main Effects:
#> Warning: There are no participants in your sample in the following histories: l-l-l. 
#>                    Please revise your reference/comparison histories and/or the high/low cutoffs, if applicable.
#> USER ALERT: Out of the total of 50 individuals in the sample, below is the distribution of the 6 (12%) individuals that fall into 2 user-selected exposure histories (out of the 24 total) created from 30th and 60th percentile values for low and high levels of exposure-epoch A.1, A.2, A.3. 
#> USER ALERT: Please inspect the distribution of the sample across the following exposure histories and ensure there is sufficient spread to avoid extrapolation and low precision:
#> 
#> +---------------+---+
#> | epoch_history | n |
#> +===============+===+
#> | h-h-h         | 3 |
#> +---------------+---+
#> | h-h-l         | 3 |
#> +---------------+---+
#> 
#> Table: Summary of user-selected exposure histories based on exposure main effects A.1, A.2, A.3: 
#> 
#> Below are the pooled average predictions by user-specified history:
#> +-------+-------+-------+--------+----------+-----------+----------+-----------+
#> | term  | A.1   | A.2   | A.3    | estimate | std.error | conf.low | conf.high |
#> +=======+=======+=======+========+==========+===========+==========+===========+
#> | l-l-l | -0.47 | -0.3  | -0.804 | -0.15    | 0.2       | -0.54    | 0.24      |
#> +-------+-------+-------+--------+----------+-----------+----------+-----------+
#> | h-h-l |  0.24 |  0.31 | -0.804 | -0.179   | 0.13      | -0.43    | 0.07      |
#> +-------+-------+-------+--------+----------+-----------+----------+-----------+
#> | h-h-h |  0.24 |  0.31 | -0.051 | -0.093   | 0.14      | -0.36    | 0.18      |
#> +-------+-------+-------+--------+----------+-----------+----------+-----------+ 
#> 
#> Conducting multiple comparison correction for all pairings between comparison histories and each refernece history using the BH method. 
#> 
#> 
#> +-------------------+-------------+-----------+-----------+------------+-----------+--------------+
#> | term              | estimate    | std.error | p.value   | conf.low   | conf.high | p.value_corr |
#> +===================+=============+===========+===========+============+===========+==============+
#> | (h-h-h) - (l-l-l) |  0.05723992 | 0.1571879 | 0.7157462 | -0.2508426 | 0.3653225 | 0.8193787    |
#> +-------------------+-------------+-----------+-----------+------------+-----------+--------------+
#> | (h-h-l) - (l-l-l) | -0.02878467 | 0.1260583 | 0.8193787 | -0.2758543 | 0.2182850 | 0.8193787    |
#> +-------------------+-------------+-----------+-----------+------------+-----------+--------------+ 
plot(comp2)

summary(comp2, "preds")
#>    term        A.1        A.2         A.3    estimate std.error  statistic
#> 1 l-l-l -0.4684962 -0.2971206 -0.80434443 -0.14979959 0.1983536 -0.7552150
#> 7 h-h-l  0.2359494  0.3148300 -0.80434443 -0.17858426 0.1267806 -1.4086088
#> 8 h-h-h  0.2359494  0.3148300 -0.05134827 -0.09255967 0.1371105 -0.6750738
#>     p.value  s.value   conf.low  conf.high dose
#> 1 0.4501200 1.151618 -0.5385654 0.23896625    0
#> 7 0.1589509 2.653347 -0.4270697 0.06990114    2
#> 8 0.4996289 1.001071 -0.3612912 0.17617189    3
summary(comp2, "comps")
#>                term    estimate std.error  statistic   p.value   s.value
#> 1 (h-h-h) - (l-l-l)  0.05723992 0.1571879  0.3641497 0.7157462 0.4824800
#> 2 (h-h-l) - (l-l-l) -0.02878467 0.1260583 -0.2283442 0.8193787 0.2873978
#>     conf.low conf.high  dose p.value_corr
#> 1 -0.2508426 0.3653225 3 - 0    0.8193787
#> 2 -0.2758543 0.2182850 2 - 0    0.8193787