Transition probabilities along a numeric covariate
Source:R/transition_regression.R
transition_curve.RdThe probability of every transition that a transition_regression()
predicts at several values of a numeric covariate, the other covariates at
their observed values, with percentile intervals from the same cluster
bootstrap as transition_effects().
Usage
transition_curve(x, term, at = NULL, iter = 200, level = 0.95, cores = 1L)
# S3 method for class 'net_transition_curve'
print(x, digits = 2L, ...)
# S3 method for class 'net_transition_curve'
summary(object, ...)
# S3 method for class 'summary.net_transition_curve'
print(x, digits = 2L, ...)
# S3 method for class 'net_transition_curve'
plot(x, top_n = 4, ...)Arguments
- x
A
net_transition_regression. For theprint()andplot()methods: anet_transition_curve, or itssummary()forprint().- term
Character. A numeric covariate of the model.
- at
Numeric vector or
NULL(default). The values at which the network is predicted; by default round values across the observed range ofterm(frompretty()).- iter
Integer of at least two. Number of bootstrap resamples. Default
200.- level
Numeric. Coverage of the percentile interval. Default
0.95.- cores
Integer. Cores for the bootstrap. Default
1. With more than one, each core draws from its own L'Ecuyer-CMRG stream, seeded from the session's random state, soset.seed()before the call reproduces the result for the samecores; the session's generator is restored afterwards. Parallel draws use forked processes, which Windows does not have.- digits
For the
print()methods: decimals shown. Default2.- ...
Ignored.
- object
For the
summary()method: an object of classnet_transition_curve.- top_n
For the
plot()method: the number of transitions that change most, drawn as lines. Default4.
Value
An object of class net_transition_curve, a data frame with one row
per observed transition and value: from, to, term, value,
probability, lower, upper. Transitions that never occur in the data
are left out. summary() returns one row per transition: term, from,
to, start and end (the probability at the smallest and largest value
of at), change, its percentile interval lower, upper from the same
bootstrap, and excludes_zero, sorted by the size of the change, as a data
frame of class summary.net_transition_curve; its print gives each change
with its interval, to digits decimals. plot() returns a ggplot:
one line per transition, told apart by colour, line type, point shape and
a label at its end.
Details
The covariate enters the logit linearly, so each curve is a smooth trend: it shows how far a transition moves across the range and how wide the uncertainty is, not a bend at a particular value.
Examples
net <- build_ftna(group_regulation_long, action = "Action", actor = "Actor",
time = "Time")
fit <- transition_regression(net, covariates = "progress", actor = "Group")
set.seed(1)
curve <- transition_curve(fit, term = "progress", iter = 20)
summary(curve)
#> Change along progress from 0.2 to 1
#> 78 transitions, 12 with an interval of the change that excludes zero
#> change [95% interval]; * the interval excludes zero
#>
#> from to progress 0.2 progress 1 change
#> adapt cohesion 0.25 0.30 0.05 [-0.05, 0.12]
#> monitor cohesion 0.04 0.08 0.04 [0.00, 0.06] *
#> adapt emotion 0.13 0.10 -0.04 [-0.09, 0.04]
#> cohesion emotion 0.10 0.14 0.03 [-0.00, 0.06]
#> cohesion consensus 0.51 0.48 -0.03 [-0.08, 0.02]
#> cohesion discuss 0.05 0.08 0.03 [0.00, 0.06] *
#> synthesis consensus 0.45 0.48 0.03 [-0.08, 0.10]
#> adapt monitor 0.05 0.02 -0.03 [-0.06, 0.01]
#> consensus plan 0.41 0.38 -0.02 [-0.05, -0.01] *
#> discuss consensus 0.33 0.31 -0.02 [-0.05, 0.01]
#> cohesion cohesion 0.04 0.01 -0.02 [-0.04, -0.01] *
#> synthesis emotion 0.06 0.08 0.02 [-0.02, 0.06]
#> plan plan 0.36 0.39 0.02 [-0.01, 0.04]
#> coregulate monitor 0.10 0.07 -0.02 [-0.05, -0.00] *
#> synthesis adapt 0.24 0.22 -0.02 [-0.09, 0.06]
#> discuss synthesis 0.13 0.15 0.02 [-0.00, 0.04]
#> consensus monitor 0.04 0.06 0.02 [0.01, 0.04] *
#> adapt discuss 0.05 0.07 0.02 [-0.02, 0.09]
#> adapt consensus 0.48 0.46 -0.02 [-0.15, 0.09]
#> discuss discuss 0.19 0.21 0.02 [0.00, 0.04] *
#> coregulate cohesion 0.05 0.03 -0.02 [-0.04, -0.00] *
#> emotion cohesion 0.33 0.31 -0.02 [-0.06, 0.01]
#> monitor discuss 0.38 0.36 -0.02 [-0.06, 0.04]
#> emotion emotion 0.07 0.09 0.02 [-0.01, 0.03]
#> plan consensus 0.30 0.28 -0.02 [-0.04, 0.01]
#> synthesis cohesion 0.04 0.02 -0.02 [-0.03, 0.02]
#> adapt plan 0.01 0.03 0.02 [0.01, 0.04] *
#> coregulate emotion 0.16 0.18 0.02 [-0.04, 0.04]
#> consensus consensus 0.09 0.07 -0.02 [-0.04, 0.00]
#> synthesis coregulate 0.05 0.04 -0.01 [-0.04, 0.05]
#> monitor coregulate 0.06 0.05 -0.01 [-0.04, 0.00]
#> emotion consensus 0.33 0.31 -0.01 [-0.04, 0.03]
#> discuss adapt 0.08 0.06 -0.01 [-0.03, -0.00] *
#> cohesion coregulate 0.11 0.13 0.01 [-0.01, 0.04]
#> coregulate plan 0.23 0.25 0.01 [-0.03, 0.05]
#> consensus emotion 0.07 0.08 0.01 [-0.00, 0.02]
#> monitor consensus 0.16 0.15 -0.01 [-0.05, 0.03]
#> monitor emotion 0.09 0.10 0.01 [-0.03, 0.02]
#> cohesion monitor 0.04 0.03 -0.01 [-0.02, 0.01]
#> monitor synthesis 0.01 0.02 0.01 [-0.00, 0.03]
#> cohesion plan 0.14 0.13 -0.01 [-0.06, 0.03]
#> monitor adapt 0.02 0.01 -0.01 [-0.02, 0.00]
#> discuss cohesion 0.05 0.04 -0.01 [-0.02, 0.01]
#> plan cohesion 0.03 0.02 -0.01 [-0.02, 0.00]
#> synthesis monitor 0.02 0.01 -0.01 [-0.02, 0.00]
#> plan emotion 0.14 0.15 0.01 [-0.02, 0.04]
#> emotion discuss 0.10 0.11 0.01 [-0.02, 0.02]
#> coregulate discuss 0.27 0.28 0.01 [-0.03, 0.05]
#> adapt coregulate 0.03 0.02 -0.01 [-0.03, 0.02]
#> plan discuss 0.07 0.06 -0.01 [-0.02, 0.01]
#> discuss monitor 0.03 0.02 -0.01 [-0.01, 0.01]
#> discuss emotion 0.10 0.11 0.01 [-0.01, 0.02]
#> emotion plan 0.10 0.10 0.01 [-0.01, 0.02]
#> emotion coregulate 0.04 0.03 -0.01 [-0.02, 0.02]
#> emotion synthesis 0.00 0.01 0.01 [0.00, 0.01] *
#> monitor plan 0.22 0.21 -0.01 [-0.05, 0.04]
#> coregulate coregulate 0.02 0.03 0.00 [-0.01, 0.02]
#> synthesis discuss 0.06 0.07 0.00 [-0.04, 0.06]
#> discuss plan 0.01 0.01 0.00 [-0.00, 0.01]
#> plan monitor 0.07 0.08 0.00 [-0.01, 0.02]
#> consensus coregulate 0.19 0.19 0.00 [-0.02, 0.03]
#> consensus synthesis 0.01 0.01 0.00 [-0.00, 0.01]
#> plan synthesis 0.00 0.00 -0.00 [-0.00, -0.00] *
#> consensus cohesion 0.01 0.02 0.00 [-0.00, 0.01]
#> synthesis plan 0.07 0.08 0.00 [-0.04, 0.04]
#> consensus discuss 0.19 0.19 -0.00 [-0.02, 0.01]
#> consensus adapt 0.00 0.01 0.00 [-0.00, 0.00]
#> discuss coregulate 0.08 0.08 0.00 [-0.01, 0.02]
#> emotion adapt 0.00 0.00 0.00 [-0.00, 0.01]
#> cohesion adapt 0.00 0.00 -0.00 [-0.01, 0.00]
#> coregulate adapt 0.02 0.02 -0.00 [-0.01, 0.01]
#> coregulate consensus 0.13 0.13 0.00 [-0.03, 0.04]
#> coregulate synthesis 0.02 0.02 0.00 [-0.02, 0.01]
#> monitor monitor 0.02 0.02 0.00 [-0.01, 0.02]
#> plan coregulate 0.02 0.02 -0.00 [-0.01, 0.01]
#> cohesion synthesis 0.00 0.00 0.00 [-0.00, 0.01]
#> plan adapt 0.00 0.00 0.00 [-0.00, 0.00]
#> emotion monitor 0.04 0.04 0.00 [-0.01, 0.01]