Skip to contents

Diagnose support for a MASMR substantive contrast

Usage

masmr_support(
  object,
  substantive,
  methodology,
  target_weights = NULL,
  outcome = NULL
)

Arguments

object

A fitted masmr object from the extended implementation.

substantive

A named list of exactly two one-row data frames. The result is the second scenario minus the first. Supply every substantive variable, including substantive covariates held constant.

methodology

A nonempty data frame containing all methodology variables. Each row defines one target profile. A single row defines a reference-profile contrast. No ideal profile is chosen automatically.

target_weights

Nonnegative finite weights, one per target row, with positive sum. Normalized to sum to one; default equal profile weights. These are target weights, not the fitting precision weights. Repeated rows are retained, so study-level rather than effect-level targets must be built explicitly when studies contribute several effects.

outcome

Outcome name(s) for an outcome-aware fit. NULL returns separate contrasts for every outcome, with cross-outcome covariance. No aggregation.

Value

A list with profile-level flags, weighted flagged share by scenario, counts and substantive ranges by categorical methodological combination, and the substantive information matrix after partialling out methodology at the joint fitted weights. Counts of studies are not robust clusters. With EM completion, data_basis identifies completed-predictor geometry; imputed values do not establish observed support.

Examples

dat <- data.frame(study = 1:18, S = rep(c(0, 1, 0), each = 6),
                  M = rep(c(0, 0, 1), each = 6), vi = .0075)
dat$yi <- .20 + .15 * dat$S - .05 * dat$M + rep(seq(-.02, .02, length.out = 6), 3)
fit <- masmr(dat, "M", "S", formula = yi ~ 1, studyID = "study",
             variance = "vi", varcov_type = "univariate", measure = "SMD",
             structure = "univariate", tau2 = 0)
target <- list(A = data.frame(S = 0), B = data.frame(S = 1))
masmr_support(fit, target, data.frame(M = 0))
#> $profiles
#>    scenario profile weight n_records n_studies absent_combination outside_range
#> 1         A       1      1        18        18              FALSE         FALSE
#> 11        B       1      1        18        18              FALSE         FALSE
#>    flagged  leverage max_observed_leverage
#> 1    FALSE 0.1666667             0.1666667
#> 11   FALSE 0.1666667             0.1666667
#> 
#> $flagged_share
#>   scenario flagged_target_weight
#> 1        A                     0
#> 2        B                     0
#> 
#> $methodology_groups
#>   methodology_group n_records n_studies S_min S_max
#> 1               all        18        18     0     1
#> 
#> $substantive_information
#>     S
#> S 400
#> 
#> $data_basis
#> [1] "observed_predictors"
#> 
#> $note
#> [1] "Range and category flags are descriptive; no calibrated multivariate-overlap threshold is imposed. "
#>