
Repeated-effects network meta-analysis from arm-level continuous data
network_meta_repeated.RdFits a treatment-design network meta-analysis to arm-level continuous data
while constructing multi-arm, outcome, and repeated-time sampling covariance
internally. This function is independent of network_meta() and does not
alter its contrast-level interface.
Usage
network_meta_repeated(
data,
study_id,
treatment,
mean,
sd,
n,
outcome = NULL,
time = NULL,
reference = NULL,
treatment_effects = c("common", "by_outcome", "by_time", "by_outcome_time"),
outcome_correlation = c("independence", "exchangeable"),
time_correlation = c("independence", "exchangeable", "ar1"),
rho_outcome = 0,
rho_time = 0,
heterogeneity = c("none", "common"),
estimation_method = c("REML", "ML"),
ci_level = 0.95
)Arguments
- data
Data frame with one row per study, treatment arm, outcome, and optional time combination.
- study_id, treatment, mean, sd, n
Character strings naming study, treatment, arm mean, arm standard deviation, and arm sample-size columns.
- outcome, time
Optional character strings identifying outcomes and follow-up occasions. Omit either when it is not present.
- reference
Optional reference treatment. Defaults to the first sorted treatment.
- treatment_effects
Whether treatment effects are common, outcome specific, time specific, or outcome-by-time specific.
- outcome_correlation, time_correlation
Correlation structures used to construct covariance among means from the same arm.
"independence"and"exchangeable"are available for outcomes;"independence","exchangeable", and"ar1"are available for time.- rho_outcome, rho_time
Correlations for exchangeable or AR(1) structures. Values must be between minus one and one.
- heterogeneity
Either
"none"for generalized least squares or"common"for a common contrast-level random-effects variance estimated by ML or REML.- estimation_method
Either
"REML"or"ML"when common heterogeneity is estimated.- ci_level
Confidence level for coefficient intervals.
Value
An object of class nma_repeated_mars containing the derived
contrast data, internally constructed study covariance blocks, coefficient
summary, fitted covariance, and heterogeneity estimate.
Details
The function currently supports arm-level continuous mean
differences. Multi-arm covariance is derived exactly under independent arms.
Outcome and time covariance are derived from the chosen correlation
assumptions; these assumptions are retained in the fitted object. For time
correlation "ar1", equally spaced ordered occasions are assumed unless
time is numeric, in which case correlation is rho_time raised to the
absolute time distance. This is a treatment-design GLS/REML model, not a
wrapper around network_meta().
Examples
dat <- data.frame(
study = rep(c("S1", "S2", "S3"), each = 2),
trt = rep(c("A", "B"), 3), mean = c(10, 12, 9, 11, 11, 14),
sd = 2, n = 30
)
network_meta_repeated(dat, "study", "trt", "mean", "sd", "n")
#> $call
#> network_meta_repeated(data = dat, study_id = "study", treatment = "trt",
#> mean = "mean", sd = "sd", n = "n")
#>
#> $reference
#> [1] "A"
#>
#> $treatments
#> [1] "A" "B"
#>
#> $treatment_effects
#> [1] "common"
#>
#> $contrast_data
#> study_id treatment_1 treatment_2 outcome_id time_id effect variance
#> S1 S1 A B overall overall 2 0.2666667
#> S2 S2 A B overall overall 2 0.2666667
#> S3 S3 A B overall overall 3 0.2666667
#>
#> $sampling_covariance
#> $sampling_covariance$S1
#> [,1]
#> [1,] 0.2666667
#>
#> $sampling_covariance$S2
#> [,1]
#> [1,] 0.2666667
#>
#> $sampling_covariance$S3
#> [,1]
#> [1,] 0.2666667
#>
#>
#> $design_matrix
#> B::common
#> [1,] 1
#> [2,] 1
#> [3,] 1
#>
#> $coefficients
#> term estimate std_error ci_lower ci_upper
#> B::common B::common 2.333333 0.2981424 1.748985 2.917682
#>
#> $varcov
#> B::common
#> B::common 0.08888889
#>
#> $fitted_values
#> [1] 2.333333 2.333333 2.333333
#>
#> $residuals
#> [1] -0.3333333 -0.3333333 0.6666667
#>
#> $tau2
#> [1] 0
#>
#> $heterogeneity
#> [1] "none"
#>
#> $estimation_method
#> [1] "REML"
#>
#> $assumptions
#> $assumptions$outcome_correlation
#> [1] "independence"
#>
#> $assumptions$time_correlation
#> [1] "independence"
#>
#> $assumptions$rho_outcome
#> [1] 0
#>
#> $assumptions$rho_time
#> [1] 0
#>
#> $assumptions$arms_independent
#> [1] TRUE
#>
#>
#> attr(,"class")
#> [1] "nma_repeated_mars"