View source: R/additive-methods.R
| get_results.multilpa_additive | R Documentation |
Tidy tables of a fit from multilpa(family = "additive"). Every table is a
base data.frame; the fit itself never needs to be reached into.
## S3 method for class 'multilpa_additive'
get_results(
x,
what = "parameters",
level = 0.95,
vcov_type = c("observed", "robust", "opg"),
adjust = .multilpa_p_adjust_methods,
data = NULL,
truth = NULL,
...
)
## S3 method for class 'multilpa_additive'
as.data.frame(x, row.names = NULL, optional = FALSE, what = "parameters", ...)
## S3 method for class 'multilpa_additive'
coef(object, scale = c("natural", "unconstrained"), ...)
## S3 method for class 'multilpa_additive'
vcov(
object,
type = c("observed", "robust", "opg"),
scale = c("natural", "unconstrained"),
...
)
## S3 method for class 'multilpa_additive'
confint(object, parm, level = 0.95, type = c("observed", "robust", "opg"), ...)
## S3 method for class 'multilpa_additive'
logLik(object, ...)
## S3 method for class 'multilpa_additive'
nobs(object, ...)
x |
A |
what |
Which table; |
level |
Confidence level of the intervals in |
vcov_type |
|
adjust |
p-value adjustment across the class means, one of
stats::p.adjust.methods; |
data, truth |
For |
... |
Unused. |
row.names, optional |
Unused; part of the generic. |
object |
A |
scale |
|
type |
Covariance type, as |
parm |
Natural parameter names or positions; all by default. |
A base data.frame, or a named list of them for what = "all".
parametersOne row per natural parameter: level ("between"
for class means and between-group variances, "within" for the shared
within-group variances, "group_class" for class weights),
group_class ("shared" for a parameter common to all classes),
indicator (NA for weights), parameter ("mean", "variance",
"weight"), estimate, standard_error, statistic, p_value,
p_adjusted, conf_low, conf_high. Only means carry a Wald test.
Intervals for variances are formed on the log scale and for weights on
the logit scale. When inference is refused (boundary, unconverged,
singular information) the standard-error columns are NA and a
latents_no_standard_errors message says why.
group_classesOne row per group class: weight, count
(summed posterior), n_assigned (modal), mean_posterior among the
groups assigned to it, and effective_groups: the number of perfectly
classified groups that would estimate the class weight as precisely as
this fit does, w^2 (1 - w) / Var(w). It equals the class's expected
group count when classes are perfectly separated and falls when a
class is small or poorly separated. Below 50, intervals for class
parameters are flagged with a latents_weak_class warning (threshold
and its simulation evaluation: validation/ADDITIVE_SIMULATION.md in
the source repository). NA for one class or when inference is refused.
groupsOne row per group (named by the id column): size n,
modal group_class, its posterior, and probability_group_class_h.
interceptsOne row per group and indicator: n, the observed
group average, and the posterior mean and variance of the group's
intercept, mixed over its class posterior (so the variance includes
uncertainty about class membership). Conditional on the estimated
parameters; not a statement about their sampling uncertainty.
conditional_interceptsAs intercepts, one row per group,
indicator and group class, conditional on that class, with the class
posterior.
assignmentsOne row per data row: row, the id column, the
group's modal group_class and posterior, and
assignment_level = "group": every row inherits its group's class.
classificationOne row per assigned and group class: the
mean_posterior of group_class among groups assigned to assigned.
fitOne row: log likelihood, n_parameters, aic, bic
(penalized by the number of groups), bic_individual (by rows),
n_groups, n_obs, relative entropy over groups, the smallest class
weight, min_effective_groups, converged, boundary, kkt and start
replication.
recoveryNeeds data and truth: one row per modal group
class and known value, with the number of groups n and their share
of the assigned class. Not part of what = "all".
startsOne row per start: likelihood, convergence, iterations, number of between variances held at zero, error message of a failed start, and which start was selected.
set.seed(1)
ratings <- data.frame(
team = rep(seq_len(40), each = 6),
climate = rep(rnorm(40, rep(c(-1, 1), each = 20), 0.5), each = 6) +
rnorm(240),
support = rep(rnorm(40, rep(c(-1, 1), each = 20), 0.5), each = 6) +
rnorm(240))
fit <- multilpa(ratings, c("climate", "support"), "team",
n_group_classes = 2, family = "additive", n_starts = 3,
seed = 1)
get_results(fit)
get_results(fit, "group_classes")
get_results(fit, "parameters", vcov_type = "robust")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.