Predicted transition network of a transition regression
Source:R/transition_regression.R
predicted_network.RdThe network a transition_regression() predicts with one covariate set to
one value: for every current state, the covariate is set to value in each
transition that leaves the state, the other covariates keep their observed
values, and the predicted probabilities are averaged (g-computation). The
result is a marginal network: a state's row averages over its observed
transitions, so sequences with more transitions weigh more.
Arguments
- x
A
net_transition_regression.- term
Character or
NULL. The covariate to set.NULLaverages the fitted probabilities over the data, which for a model without covariates is the TNA network.- value
The value(s)
termis set to: numbers, or levels for a factor. One value gives one network. Several, or none, give anetobject_groupwith one network per value; without values, a numeric covariate is set to its 25th and 75th percentile over the transitions the model is fitted on (namedp25andp75), a two-level factor to its two levels. Named values name the networks.
Value
For one value, or without term, a netobject (method
"relative") whose weights are the predicted probabilities; for several
values, a netobject_group of them, named like "achievement: p25 (0.268)" or "week = 12". plot() draws either. A state that is never
left, or whose departures never have the requested level, has a row of
zeros and is listed in params$unavailable_rows.
References
Robins, J. (1986). A new approach to causal inference in mortality studies with a sustained exposure period. Mathematical Modelling, 7, 1393-1512. doi:10.1016/0270-0255(86)90088-6
Examples
net <- build_ftna(group_regulation_long, action = "Action", actor = "Actor",
time = "Time")
fit <- transition_regression(net, covariates = "Achiever", actor = "Group")
predicted_network(fit, term = "Achiever", value = "High")
#> Transition Network (relative probabilities) [directed]
#> Weights: [0.001, 0.575] | mean: 0.115
#>
#> Strongest edges (10 of 78):
#> from to weight
#> synthesis consensus 0.575
#> cohesion consensus 0.536
#> adapt consensus 0.517
#> discuss consensus 0.425
#> monitor discuss 0.370
#> consensus plan 0.364
#> emotion consensus 0.336
#> plan plan 0.328
#> emotion cohesion 0.326
#> plan consensus 0.294
#>
#> extract_edges(include_self = TRUE) lists every edge; extract_transition_matrix() gives the weight matrix.