fit_ancova {junco} | R Documentation |
ANCOVA
Analysis
Description
Does the ANCOVA
analysis, separately for each visit.
Usage
fit_ancova(
vars = list(response = "AVAL", covariates = c(), arm = "ARM", visit = "AVISIT", id =
"USUBJID"),
data,
conf_level = 0.95,
weights_emmeans = "proportional"
)
Arguments
vars |
(named
Note that the |
data |
( |
conf_level |
( |
weights_emmeans |
( |
Value
A tern_model
object which is a list with model results:
-
fit
: A list with a fittedstats::lm()
result for each visit. -
mse
: Mean squared error, i.e. variance estimate, for each visit. -
df
: Degrees of freedom for the variance estimate for each visit. -
lsmeans
: This is a list with data framesestimates
andcontrasts
. The attributeweights
savse the settings used (weights_emmeans
). -
vars
: The variable list. -
labels
: Corresponding list with variable labels extracted fromdata
. -
ref_level
: The reference level for the arm variable, which is always the first level. -
treatment_levels
: The treatment levels for the arm variable. -
conf_level
: The confidence level which was used to construct thelsmeans
confidence intervals.
Examples
library(mmrm)
fit <- fit_ancova(
vars = list(
response = "FEV1",
covariates = c("RACE", "SEX"),
arm = "ARMCD",
id = "USUBJID",
visit = "AVISIT"
),
data = fev_data,
conf_level = 0.9,
weights_emmeans = "equal"
)