structured_effects() returns the structured random-effect markers that
drmTMB parsed and fitted. It gives downstream tools a stable post-fit
metadata table so they do not need to grep or re-parse formula text.
Usage
structured_effects(object, ...)
# Default S3 method
structured_effects(object, ...)
# S3 method for class 'drmTMB'
structured_effects(object, ...)Value
A data frame with one row per fitted structured-effect marker. The
args, dpars, coef_names, endpoint_members, member_levels,
provider_levels, observed_levels, endpoint_blocks, and
endpoint_covariance_labels columns are list columns. Empty fits return
the same columns with zero rows.
Details
The current fitted marker grammar is:
phylo(1 | species, tree = tree)spatial(1 | site, coords = coords)animal(1 | id, pedigree = pedigree),animal(1 | id, A = A), oranimal(1 | id, Ainv = Ainv)relmat(1 | id, K = K)orrelmat(1 | id, Q = Q)phylo_interaction(1 | plant:pollinator, tree1 = plant_tree, tree2 = pollinator_tree)
Some Gaussian routes also fit matching location-scale, bivariate, or
one-slope structured blocks. Those routes still return one row per parsed
structured marker, with dpars and coef_names stored as list columns.
Examples
dat <- data.frame(
y = c(0.1, 0.4, 0.8, 1.1),
x = c(-1, 0, 1, 2)
)
fit <- drmTMB(bf(y ~ x, sigma ~ 1), data = dat)
structured_effects(fit)
#> [1] marker provider
#> [3] grouping_variable matrix_attachment
#> [5] matrix_id matrix_slot
#> [7] matrix_source matrix_role
#> [9] matrix_digest input_scale
#> [11] level_alignment missing_level_policy
#> [13] bridge_marshalling provenance_contract
#> [15] structure group1
#> [17] group2 label
#> [19] block block_label
#> [21] covariance_layout endpoint_set
#> [23] coefficient_set endpoint_member_set
#> [25] endpoint_member_count q
#> [27] n_re member_count
#> [29] provider_level_count observed_level_count
#> [31] random_effect_block correlation_level
#> [33] dpars coef_names
#> [35] endpoint_members member_levels
#> [37] provider_levels observed_levels
#> [39] endpoint_blocks endpoint_covariance_labels
#> [41] args
#> <0 rows> (or 0-length row.names)