First release.
foresty_app() provides a Shiny interface for
interactively selecting exposures, modifiers, contrasts, colors, and
plot layouts. Its R code tab writes the code twice over: the
foresty calls that drew the figures, and the same estimates
worked out in base R and the car package with nothing from
this package in them – the interaction term, the linear combination of
the coefficients each subgroup estimate is, and the joint test beside
it. For a multinomial fit that linear combination is a difference of
blocks of coefficients, one block per equation, and the script writes
that out too.foresty_data() draws the same figure – the forest plot
and the table of numbers beside it, aligned row for row, in any of the
journal styles – from estimates you already have: a
data.frame, tibble or data.table
with one row per row of the figure. It is the entry point for numbers
that did not come out of a model this package can read: a meta-analysis,
a table being redrawn from a paper, a model fitted by something
else.glm(), lm(),
survival models, and lme4 models, with robust
and cluster-robust standard errors through sandwich.MASS::polr() and
nominal outcomes through nnet::multinom(). A multinomial
fit holds one equation per non-reference level of the outcome, so the
figure carries one row per level. outcome_reference says
which level they are all read against and
outcome_reference_row draws that level as a row of its own.
The interaction is tested jointly across the equations, so its p-value
is a chunk test spending one degree of freedom for each coefficient the
interaction added.822 vs 468 people and 125 vs 59
events, those being the groups its odds ratio was estimated from. A
multinomial row, which compares two levels of the outcome, reads
637 vs 1,050 under the sizes and drops the events column,
which would have repeated the first of them.
foresty_layout(counts = "row") holds the row’s own group
alone, as before. The rows that compare no two groups of people – a step
along a continuous exposure, and the reference rows – are
unchanged.?foresty_main:
they are taken over the rows the model was fitted to, so a complete case
on the outcome, the exposure and the covariates. The figures whose rows
compare two groups say which two under the plot in
foresty_app() and under the table of estimates in
foresty_report(), and say of a multinomial fit that the
estimate did not come out of those two groups alone. The figure itself
is unchanged, so the downloads are what they always were.summary(), as.data.frame(),
broom::tidy(), broom::glance(),
coef(), vcov(), predict(),
formula(), and nobs() are supported for
foresty results.