Perform bootstrapping on transition networks created from
sequence data stored in a tna
object. Bootstrapped estimates
of edge weights are returned with confidence intervals and significance
testing.
bootstrap(x, ...)# S3 method for tna
bootstrap(
x,
iter = 1000,
level = 0.05,
method = "stability",
threshold,
consistency_range = c(0.75, 1.25),
...
)
# S3 method for group_tna
bootstrap(x, ...)
A tna_bootstrap
object which is a list
containing the
following elements:
weights_orig
: The original edge weight matrix
.
weights_sig
: The matrix
of significant transitions
(those with p-values below the significance level).
weights_mean
: The mean weight matrix
from the bootstrap samples.
weights_sd
: The standard deviation matrix
from the bootstrap samples.
ci_lower
: The lower bound matrix
of the confidence intervals for
the edge weights.
ci_upper
: The upper bound matrix
of the confidence intervals for
the edge weights.
p_values
: The matrix
of p-values for the edge weights.
summary
: A data.frame
summarizing the edges, their weights,
p-values, statistical significance and confidence intervals.
If x
is a group_tna
object, the output is a group_tna_bootstrap
object, which is a list
of tna_bootstrap
objects.
A tna
or a group_tna
object created from sequence data.
Ignored.
An integer
specifying the number of bootstrap samples to
draw. Defaults to 1000
.
A numeric
value representing the significance level for
hypothesis testing and confidence intervals. Defaults to 0.05
.
A character
string. This argument defines the bootstrap
test statistic. The "stability"
option (the default) compares edge weights
against a range of "consistent" values defined by consistency_range
.
Weights that fall outside this range are considered insignificant. In other
words, an edge is considered significant if its value is within the range
in (1 - level)
* 100% of the bootstrap samples. The "threshold"
option
instead compares the edge weights against a user-specified threshold
value.
A numeric
value to compare edge weights against.
The default is the 10th percentile of the edge weights. Used only when
method = "threshold"
.
A numeric
vector of length 2. Determines how much
the edge weights may deviate (multiplicatively) from their observed values
(below and above) before they are considered insignificant. The default is
c(0.75, 1.25)
which corresponds to a symmetric 25% deviation range. Used
only when method = "stability"
.
The function first computes the original edge weights for the specified
cluster from the tna
object. It then performs bootstrapping by resampling
the sequence data and recalculating the edge weights for each
bootstrap sample. The mean and standard deviation of the transitions are
computed, and confidence intervals are derived. The function also calculates
p-values for each edge and identifies significant edges based on
the specified significance level. A matrix of significant edges
(those with p-values below the significance level) is generated.
Additional statistics on removed edges (those not considered
significant) are provided.
All results, including the original transition matrix, bootstrapped estimates, and summary statistics for removed edges, are returned in a structured list.
Evaluation and validation functions
permutation_test()
,
prune()
,
pruning_details()
Cluster-related functions
centralities()
,
cliques()
,
communities()
,
deprune()
,
estimate_cs()
,
group_model()
,
hist.group_tna()
,
mmm_stats()
,
plot.group_tna()
,
plot.group_tna_centralities()
,
plot.group_tna_cliques()
,
plot.group_tna_communities()
,
plot.group_tna_stability()
,
plot_compare.group_tna()
,
plot_mosaic.group_tna()
,
plot_mosaic.tna_data()
,
print.group_tna()
,
print.group_tna_bootstrap()
,
print.group_tna_centralities()
,
print.group_tna_cliques()
,
print.group_tna_communities()
,
print.group_tna_stability()
,
print.summary.group_tna()
,
print.summary.group_tna_bootstrap()
,
prune()
,
pruning_details()
,
rename_groups()
,
reprune()
,
summary.group_tna()
,
summary.group_tna_bootstrap()
model <- tna(group_regulation)
# Small number of iterations for CRAN
bootstrap(model, iter = 10)
Run the code above in your browser using DataLab