Skip to contents

Every influence-function estimate in misskappa carries a per-subject influence matrix fit$psi: an n-by-K matrix whose rows are subjects, whose columns are coefficients, and which satisfies

\[ \widehat{\mathrm{Cov}}(\widehat\theta) = \frac{1}{n^2}\,\psi^\top\psi . \]

That single matrix is the raw material behind every standard error the package prints, and it is all you need to build custom contrasts or joint tests by hand.

The influence matrix

stats::influence() is the registered accessor. It returns the same matrix as fit$psi.

fit <- kappa(dat.tenhove2025, estimator = "nt_fiml_cs")
psi <- influence(fit)
dim(psi)
#> [1] 60  3
head(psi, 3)
#>          Conger     Fleiss Brennan-Prediger
#> [1,]  0.2463414  0.2486811        0.2914983
#> [2,] -0.6509042 -0.6548851       -0.4269953
#> [3,] -0.4326967 -0.4289946       -0.5034673

The asymptotic covariance is just the scaled cross-product, so the printed standard errors are sqrt(diag(crossprod(psi))) / n:

all.equal(crossprod(psi) / nrow(psi)^2, vcov(fit), check.attributes = FALSE)
#> [1] TRUE
sqrt(diag(crossprod(psi))) / nrow(psi)
#>           Conger           Fleiss Brennan-Prediger 
#>       0.05390591       0.05424752       0.03954982

A contrast by hand

Because the influence function is additive over subjects, a linear contrast of coefficients has influence function equal to the same linear combination of the columns of psi. To test whether the Conger and Brennan-Prediger coefficients of one fit are equal, difference their columns:

est <- coef(fit)["Conger"] - coef(fit)["Brennan-Prediger"]
d   <- psi[, "Conger"] - psi[, "Brennan-Prediger"]
se  <- sqrt(sum(d^2)) / nrow(psi)
z   <- est / se
c(estimate = est, se = se, z = z, p = 2 * pnorm(-abs(z)))
#> estimate.Conger              se        z.Conger        p.Conger 
#>     -0.03342344      0.03466781     -0.96410591      0.33499283

A paired comparison across two fits

When two fits share the same subjects in the same row order, their influence rows are aligned, so the contrast’s influence function is the row-wise difference of the two columns. The cross-fit dependence is recovered with no independence assumption. Here the Conger coefficient from the likelihood ("nt_fiml_cs") and moment ("pairwise_cs") compound-symmetry estimators is compared on the same planned-incomplete data:

f_mle <- kappa(dat.tenhove2025, estimator = "nt_fiml_cs")
f_mom <- kappa(dat.tenhove2025, estimator = "pairwise_cs")

est <- coef(f_mle)["Conger"] - coef(f_mom)["Conger"]
d   <- influence(f_mle)[, "Conger"] - influence(f_mom)[, "Conger"]
se  <- sqrt(sum(d^2)) / nrow(f_mle$psi)
c(estimate = est, se = se, z = est / se)
#> estimate.Conger              se        z.Conger 
#>    -0.007476686     0.007066425    -1.058057794

The packaged version of exactly this calculation is kappa_test(..., paired = TRUE) (see vignette("equality-tests")). Rolling it by hand is only worthwhile for contrasts the test front door does not cover.

Which estimates carry an influence matrix

Every estimator in misskappa returns psi:

  • the available-case, IPW, and Gwet moment estimators
  • the "pairwise" and "pairwise_cs" covariance estimators
  • the categorical and normal-theory FIMLs (saturated "nt_fiml" and compound-symmetry "nt_fiml_cs")
  • the counts-format estimators

Any two fits on the same subjects can therefore be combined through their aligned influence rows.