| parameter_inference.multilpa_additive | R Documentation |
Standard errors, tests and intervals for every free parameter of
multilpa(profile_covariates = ), at all three levels at once: the
measurement model, the
profile logits and the group-class logits. Without them a membership
coefficient cannot be reported, because nothing distinguishes a real effect
from separation.
Computes ordinary maximum-likelihood standard errors from the inverse observed Hessian and delta-method Wald confidence intervals. These are local, asymptotic estimates conditional on the selected numbers of classes. They are not robust sandwich errors and do not account for model selection. Mixture boundary solutions and unidentified Hessians do not admit this calculation.
## S3 method for class 'multilpa_additive'
parameter_inference(
x,
data = NULL,
level = 0.95,
step = 1e-04,
vcov_type = c("observed", "robust", "opg"),
adjust = .multilpa_p_adjust_methods,
method = c("wald", "bootstrap"),
...
)
## S3 method for class 'multilpa_covariates'
parameter_inference(
x,
data = NULL,
level = 0.95,
step = 1e-04,
vcov_type = c("observed", "robust", "opg"),
adjust = .multilpa_p_adjust_methods,
method = c("wald", "bootstrap"),
iter = 199L,
n_starts = 10L,
max_iter = 1000L,
tol = 1e-08,
seed = NULL,
boundary = c("error", "fix")
)
## S3 method for class 'multilpa_cross_level'
parameter_inference(x, ...)
parameter_inference(
x,
data = NULL,
level = 0.95,
step = 1e-04,
vcov_type = c("observed", "robust", "opg"),
adjust = .multilpa_p_adjust_methods,
method = c("wald", "bootstrap"),
iter = 199L,
n_starts = 10L,
max_iter = 1000L,
tol = 1e-08,
seed = NULL,
boundary = c("error", "fix")
)
## S3 method for class 'multilpa'
parameter_inference(
x,
data = NULL,
level = 0.95,
step = 1e-04,
vcov_type = c("observed", "robust", "opg"),
adjust = .multilpa_p_adjust_methods,
method = c("wald", "bootstrap"),
iter = 199L,
n_starts = 10L,
max_iter = 1000L,
tol = 1e-08,
seed = NULL,
boundary = c("error", "fix")
)
## S3 method for class 'multilpa_lta'
parameter_inference(
x,
data = NULL,
level = 0.95,
step = 1e-04,
vcov_type = c("observed", "robust", "opg"),
adjust = .multilpa_p_adjust_methods,
method = c("wald", "bootstrap"),
iter = 199L,
n_starts = 10L,
max_iter = 1000L,
tol = 1e-08,
seed = NULL,
boundary = c("error", "fix")
)
x |
A converged |
data |
Optional. The data frame the model was fitted to; when omitted it is rebuilt from the indicators, identifiers and occasions the fit stores, which round-trip exactly. Supplying it is the stronger check that the caller still holds that frame. A supplied frame is checked exactly against the stored indicators and identifiers; for an older fit without stored indicators, the likelihood provides a weaker consistency check. |
level |
Confidence level strictly between zero and one. |
step |
Positive finite-difference step for the analytic score derivative. |
vcov_type |
|
adjust |
Multiplicity correction applied to |
method |
How uncertainty is measured. |
... |
Unused by most methods; accepted so every method shares the generic's signature. |
iter |
Number of resamples when |
n_starts, max_iter, tol |
Passed to each bootstrap refit. Each replicate
is a fresh fit, so |
seed |
Optional seed for the resampling: any whole number |
boundary |
What to do when categorical response probabilities sit on
their lower bound, |
Class-membership coefficients are on the multinomial logit scale with the final profile and the final group class as references, so a coefficient is a log odds against that reference. The tests are Wald tests and inherit the usual caveat: they are unreliable for a coefficient driven to the boundary by separation, which the size of the estimate and its standard error together will reveal.
For a general transition fit (an lta() fit with covariate,
occasion-varying or second-order transitions), the table has one row per
transition, initial and second-order logit: block, group_class,
from, to, term, estimate, standard_error, statistic,
p_value, p_adjusted, conf_low, conf_high (and previous for a
second-order fit). method = "bootstrap" resamples persons, refits, and
matches every replicate's profiles (on the measurement) and group classes
to the original's, rebasing the initial logits when the reference profile
moves; it needs data, and works where Wald inference is refused (for
example full covariance structures). Transition inference holds nothing
at a bound: with no bound active boundary = "fix" gives the same table
as "error", and a fit with an active bound raises latents_boundary_fit
under either.
A base data.frame with one row per free parameter and the same
columns, in the same order, that parameter_inference() returns for every
other fitted class: level ("measurement", "profile" or "group"),
outcome (which profile or group class the coefficient predicts, or which
profile a measurement parameter belongs to), term, parameter
("mean", "variance", "covariance", "response" or
"coefficient"), estimate,
standard_error, statistic, p_value, p_adjusted, conf_low and
conf_high. Variances and covariances are reported in their natural units,
with standard errors carried through the delta method from the log and
log-Cholesky coordinates on which they are estimated. Categorical
indicators contribute one "response" row per profile, indicator and
category, named indicator:category: the probability of that category,
with its standard error carried from the multinomial logits it is
estimated on, and no Wald test, as for the covariate-free model.
A base data.frame with one row per reported parameter and the
columns level ("measurement", "profile" or "group"), outcome,
term, parameter, estimate, standard_error, statistic, p_value,
p_adjusted, conf_low and conf_high. Estimates are on the natural
scale: variances in their own units, probabilities as probabilities. A
parameter whose null value is on the boundary of its space – a variance, a
probability, a residual variance on the covariance diagonal – carries NA
for statistic, p_value and p_adjusted, because a Wald test against
that boundary is not a question worth asking; the interval still is. All
class probabilities are reported; their sum constraints make the natural
covariance singular. Wald intervals for probabilities are formed on the
logit scale and for variances (and covariance diagonals) on the log
scale, then mapped back with the same standard error, so they stay inside
the parameter's range and widen towards the far side of a bound; every
other interval is estimate +/- z * standard_error. confint() returns
the same intervals. A probability at or below 1e-6 is treated as on its
bound (refused, or held by boundary = "fix").
A fit made with fixed reports only the parameters it estimated: a held
measurement block is a constant of this likelihood, so it contributes no
row here and no row or column to the information matrix. The table is on
the natural scale, where every class probability is reported, so it has one
row per estimated natural coefficient: n_parameters rows plus one for
each set of probabilities whose reference category the estimation scale
drops. The held values still enter the likelihood at
the values they were held at, so every standard error, interval and p-value
is conditional on that measurement solution and does not propagate its
uncertainty. See fit_staged() for what that conditioning means. For a
fit_staged() result, method = "bootstrap" does propagate it: each
resample refits both stages, and the table has a row for every
parameter, the measurement included (attribute stages_resampled is 2).
With method = "bootstrap" the table has the same columns and the same
rows, estimate is still the fitted value, standard_error is the
standard deviation of the replicates and conf_low/conf_high are the
percentile interval. statistic, p_value and p_adjusted are NA
throughout: putting a normal approximation back on top of the replicates
the interval was read from is the assumption this path exists to avoid, so
the interval is the inference. Its attributes are covariance (the
covariance of the replicates, which vcov() returns), level, method,
iter, n_valid, replicates (the kept replicates, one row each),
messages (why a resample was dropped, NA where it was not),
structure and fixed; covariance_unconstrained is NULL, because the
estimation-scale chart is what this path does without.
Diagnostics of the fit as a whole travel as attributes rather than as
columns repeated down every row: covariance and covariance_unconstrained
(natural and estimation-scale covariance of the estimates), hessian,
gradient, scaled_score, condition_ratio, level, step, vcov_type,
fixed (the measurement blocks this fit held, character() when none) and
adjust. When vcov_type is "robust", group_scores holds the
groups-by-parameters score matrix and scaling_correction the MLR scaling
correction factor tr(A^-1 B) / q, used for scaled likelihood-ratio
difference tests.
latents_no_converge for an unconverged fit, latents_boundary_fit when
a variance, a response probability or a mixing probability sits at its
bound, latents_singular_information when the observed information cannot
be inverted, latents_no_free_parameters when fixed held every
parameter, latents_bad_inference_data when a supplied data does not
reproduce the fit, and latents_too_few_groups for vcov_type = "robust"
with fewer independent groups than reported parameters. A fit whose score
is still far from zero is reported with a latents_unconverged warning
rather than refused. A fit made with multilpa(prior = ) is refused by
the Wald path with latents_unsupported_inference (it sits at a
posterior mode, where the likelihood's score is not zero), and a fit with
a noise component by either path with latents_unsupported_noise.
method = "bootstrap" adds latents_unsupported_inference for a fit that
holds a measurement block through multilpa(fixed = ) — the held values
came from another fit and resampling these data does not resample them;
a fit_staged() result is bootstrapped by staging again instead — and
latents_bootstrap_failed when fewer than two resamples produced a usable
fit, whose message carries the first reason one gave. Resamples that fail
or do not converge are dropped with a latents_bootstrap_dropped warning
naming how many, rather than being silently left out of the count.
# Two separated profiles, membership driven by `x` and by the group's class.
set.seed(5)
school <- rep(seq_len(16), each = 8)
high_class <- rep(rep(c(FALSE, TRUE), length.out = 16), each = 8)
x <- rnorm(128)
profile <- ifelse(
runif(128) < plogis(-1 + 2 * high_class + 0.8 * x), 2L, 1L
)
example_data <- data.frame(
school = school, x = x,
y1 = rnorm(128, ifelse(profile == 2L, 2, -2), 0.7),
y2 = rnorm(128, ifelse(profile == 2L, 1.5, -1.5), 0.7)
)
fit <- multilpa(example_data, c("y1", "y2"), "school", n_profiles = 2,
n_group_classes = 2, profile_covariates = "x",
n_starts = 2, seed = 1)
parameter_inference(fit, example_data)
set.seed(42)
example_data <- data.frame(
school = rep(seq_len(10), each = 10),
score_a = rnorm(100), score_b = rnorm(100)
)
fit <- multilpa(example_data, c("score_a", "score_b"), "school",
n_profiles = 2, n_group_classes = 1, n_starts = 2, seed = 1)
parameter_inference(fit)
# Many tests in one table: name the correction, do not apply one by stealth.
parameter_inference(fit, adjust = "BH")
# A structure that constrains the shape across profiles (VEI) is charted in
# its own free coordinates, so it has Wald standard errors too.
shaped <- multilpa(example_data, c("score_a", "score_b"), "school",
n_profiles = 2, n_group_classes = 1, n_starts = 2, seed = 1,
volume = "varying", shape = "equal", orientation = "axis")
parameter_inference(shaped)
# The bootstrap resamples schools and refits inside the same family.
parameter_inference(shaped, method = "bootstrap", iter = 10, n_starts = 1,
seed = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.