| g_mmrm_lsmeans | R Documentation |
This function summarizes adjusted lsmeans and standard error, as well as conducts
comparisons between groups' adjusted lsmeans, where the first level of the group
is the reference level.
g_mmrm_lsmeans(
object,
select = c("estimates", "contrasts"),
titles = c(estimates = paste("Adjusted mean of", object$labels$response,
"by treatment at visits"), contrasts = paste0("Differences of ",
object$labels$response, " adjusted means vs. control ('", object$ref_level, "')")),
xlab = object$labels$visit,
ylab = paste0("Estimates with ", round(object$conf_level * 100), "% CIs"),
xlimits = NULL,
ylimits = NULL,
width = 0.6,
show_pval = TRUE,
show_lines = FALSE,
constant_baseline = NULL,
n_baseline = NA_integer_,
table_stats = character(),
table_formats = c(n = "xx.", estimate = "xx.x", se = "xx.x", ci = "(xx.xx, xx.xx)"),
table_labels = c(n = "n", estimate = "LS mean", se = "Std. Error", ci =
paste0(round(object$conf_level * 100), "% CI")),
table_font_size = 3,
table_rel_height = 0.5
)
object |
( |
select |
( |
titles |
( |
xlab |
( |
ylab |
( |
xlimits |
( |
ylimits |
( |
width |
( |
show_pval |
( |
show_lines |
( |
constant_baseline |
(named |
n_baseline |
( |
table_stats |
( |
table_formats |
(named |
table_labels |
(named |
table_font_size |
( |
table_rel_height |
( |
If variable labels are available in the original data set, then these are used. Otherwise the variable names themselves are used for annotating the plot.
The contrast plot is not going to be returned if treatment is not
considered in the tern_mmrm object input,
no matter if select argument contains the contrasts value.
A ggplot2 plot.
library(dplyr)
mmrm_results <- fit_mmrm(
vars = list(
response = "FEV1",
covariates = c("RACE", "SEX"),
id = "USUBJID",
arm = "ARMCD",
visit = "AVISIT"
),
data = mmrm_test_data,
cor_struct = "unstructured",
weights_emmeans = "equal"
)
g_mmrm_lsmeans(mmrm_results, constant_baseline = c(BSL = 0))
g_mmrm_lsmeans(
mmrm_results,
select = "estimates",
show_lines = TRUE,
xlab = "Visit"
)
g_mmrm_lsmeans(
mmrm_results,
select = "contrasts",
titles = c(contrasts = "Contrasts of FKSI-FWB means"),
show_pval = TRUE,
show_lines = TRUE,
width = 0.8
)
mmrm_test_data2 <- mmrm_test_data %>%
filter(ARMCD == "TRT")
mmrm_results_no_arm <- fit_mmrm(
vars = list(
response = "FEV1",
covariates = c("RACE", "SEX"),
id = "USUBJID",
visit = "AVISIT"
),
data = mmrm_test_data2,
cor_struct = "unstructured",
weights_emmeans = "equal"
)
g_mmrm_lsmeans(mmrm_results_no_arm, select = "estimates")
g_mmrm_lsmeans(
mmrm_results_no_arm,
select = c("estimates", "contrasts"),
titles = c(
estimates = "Adjusted mean of FKSI-FWB",
contrasts = "it will not be created"
),
show_pval = TRUE,
width = 0.8
)
g_mmrm_lsmeans(
mmrm_results_no_arm,
select = "estimates",
titles = c(estimates = "Adjusted mean of FKSI-FWB"),
show_pval = TRUE,
width = 0.8,
show_lines = TRUE
)
g_mmrm_lsmeans(
mmrm_results,
select = "estimates",
titles = c(estimates = "Adjusted mean of FKSI-FWB"),
table_stats = c("n", "ci")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.