A probability survey observes an outcome and a rich set of
person-level attributes. Census dissemination supplies reliable
aggregate tables, but the full cross-classification is unavailable.
interSAE treats the unobserved multiway census table as a
latent population constrained by every published margin.
library(interSAE)
x <- inter_example()
design <- inter_design(x$survey, "weight", "area", "strata", "psu")
margins <- census_margins(x$margins)
fit <- fit_inter_sae(
unemployed ~ sex + age + residence + area,
design, margins,
family = "binomial",
domain = c("area", "sex")
)
head(inter_estimates(fit))
#> area sex estimate synthetic residual_correction population direct
#> 1 A1 Female 0.3628242 0.2938713 0.068952904 2277 0.3628208
#> 2 A2 Female 0.3246757 0.3529523 -0.028276628 2726 0.3246760
#> 3 A3 Female 0.3525557 0.3590753 -0.006519579 3263 0.3525522
#> 4 A4 Female 0.4576265 0.4383212 0.019305249 3906 0.4576252
#> 5 A5 Female 0.4096888 0.4942813 -0.084592509 4677 0.4096883
#> 6 A6 Female 0.5308005 0.4840845 0.046716014 5600 0.5308006
#> direct_n
#> 1 23
#> 2 38
#> 3 31
#> 4 53
#> 5 53
#> 6 72The synthetic column is the census-cell prediction
aggregated with the reconstructed population counts. The residual
correction is a calibrated survey residual total divided by domain
population. Their sum gives the model-assisted estimate.
max(margin_diagnostics(fit)$relative_error)
#> [1] 4.143726e-14
check_identifiability(fit)
#> Identification diagnostic
#> Feasible cells: 72
#> Independent margin constraints: 48
#> Unidentified dimensions: 24
#> Full table identified: noNullity greater than zero means that overlapping margins do not uniquely identify the full latent table. It is not an algorithmic failure. It is a property of the available information.
When lpSolve is installed, association sensitivity can
be evaluated by restricting each latent cell to a multiplicative
neighborhood of its fitted value while maintaining all census margins
exactly.
inter_sensitivity(
fit,
gamma = c(1, 1.25, 1.5, 2),
domain = list(area = "A1", sex = "Female")
)
#> gamma lower estimate upper domain statistic
#> 1 1.00 0.2938713 0.2938713 0.2938713 area=A1, sex=Female mean
#> 2 1.25 0.2918422 0.2938713 0.2957422 area=A1, sex=Female mean
#> 3 1.50 0.2902970 0.2938713 0.2970815 area=A1, sex=Female mean
#> 4 2.00 0.2885098 0.2938713 0.2986865 area=A1, sex=Female meanThe multiplier bootstrap assigns one exponential multiplier per PSU and renormalizes within strata. Every replicate repeats both population reconstruction and outcome-model fitting.
Bootstrap variation and identification width should not be silently
collapsed into one standard error. decompose_uncertainty()
reports them separately.