Skip to main content

Ex. 10 – Missing data (FIML)

Restricted estimation and GORIC evaluation with incomplete data, using full information maximum likelihood.

The problem

By default, R (and restriktor) removes every case with a missing value (listwise deletion). That is only valid when the data are missing completely at random (MCAR). In practice, missingness often depends on other observed variables (missing at random, MAR), and then listwise deletion gives biased estimates and wastes information.

For linear models, restriktor offers full information maximum likelihood (FIML) with missing = "fiml". FIML uses all available data and is valid under MAR, assuming that the variables are jointly normally distributed.

Note

FIML is available in restriktor() and goric() for linear models (lm) with an intercept. Informative hypothesis tests with iht() are not (yet) available for FIML; use goric() to evaluate hypotheses.

Creating incomplete data

To see what FIML does, we take the complete Burns data (see example 8) and delete values of guilt. Mothers with more post-traumatic stress symptoms (PTSS, the outcome) are more likely to have a missing guilt score. The missingness depends on an observed variable, so the data are missing at random.

library(restriktor)

make_missing <- function(data) {
  z <- as.numeric(scale(data$PTSS))
  p_missing <- plogis(-1 + 1.5 * z)            # more PTSS, more missing
  data$guilt[runif(nrow(data)) < p_missing] <- NA
  data
}

set.seed(2026)
Burns_mis <- make_missing(Burns)
sum(is.na(Burns_mis$guilt))   # number of missing guilt scores
[1] 92
NoteWhen is listwise deletion biased?

In a regression model, listwise deletion is not biased when the missingness depends only on the predictors. It is biased when the missingness depends on the outcome, as here.

Step 1 – fit the model

fit.mis <- lm(PTSS ~ gender + age + TBSA + guilt + anger, data = Burns_mis)
nobs(fit.mis)                 # cases used by lm(): listwise deletion
[1] 186

lm() silently drops all cases with a missing guilt score.

Step 2 – restricted estimates: listwise deletion versus FIML

We expect positive effects of guilt and anger on PTSS:

H1 <- ' guilt > 0; anger > 0 '

restr.listwise <- restriktor(fit.mis, constraints = H1)
restr.fiml     <- restriktor(fit.mis, constraints = H1, missing = "fiml")

# for comparison: the complete data
restr.complete <- restriktor(lm(PTSS ~ gender + age + TBSA + guilt + anger,
                                data = Burns), constraints = H1)

round(rbind(complete = coef(restr.complete),
            listwise = coef(restr.listwise),
            FIML     = coef(restr.fiml)), 3)
         (Intercept) gender   age   TBSA guilt anger
complete      18.834  1.491 0.162 -0.099 3.561 3.379
listwise      18.563  1.566 0.336 -0.080 2.009 3.145
FIML          20.970  1.258 0.165 -0.101 2.529 3.448

Look at the effect of guilt, the incomplete variable: with listwise deletion it is 2.009, with FIML 2.529, while the complete data give 3.561. FIML also uses the observed PTSS, age, gender, TBSA and anger scores of the mothers with a missing guilt score.

One sample can be a coincidence. Therefore, we repeat this 100 times and average the estimates (restricted estimates only, so we skip the standard errors and the chi-bar-square weights to save time):

set.seed(1)
reps <- replicate(100, {
  d <- make_missing(Burns)
  f <- lm(PTSS ~ gender + age + TBSA + guilt + anger, data = d)
  c(listwise = coef(restriktor(f, constraints = H1, se = "none",
                               mix_weights = "none")),
    FIML     = coef(restriktor(f, constraints = H1, se = "none",
                               mix_weights = "none", missing = "fiml")))
})
avg <- rowMeans(reps)

round(rbind(complete = coef(restr.complete),
            listwise = avg[grep("^listwise", names(avg))],
            FIML     = avg[grep("^FIML", names(avg))]), 3)
         (Intercept) gender   age   TBSA guilt anger
complete      18.834  1.491 0.162 -0.099 3.561 3.379
listwise      19.800  0.634 0.147 -0.088 2.477 2.855
FIML          19.858  1.382 0.165 -0.105 3.020 3.487

On average, listwise deletion clearly underestimates the effects of guilt, anger and gender. FIML is much closer to the complete-data results, although not perfect: FIML assumes that all variables are jointly normally distributed, which is not exactly true for, for example, the 0–4 guilt scores.

summary(restr.fiml)

Call:
conLM.lm(object = object, constraints = constraints, missing = "fiml")

Restriktor: restricted linear model:

Residuals:
     Min       1Q   Median       3Q      Max 
-29.0028  -6.5765  -2.2578   2.1633  24.0758 

Coefficients:
             Estimate Std. Error t value  Pr(>|t|)    
(Intercept) 20.970254   2.197534  9.5426 < 2.2e-16 ***
gender       1.258158   1.096269  1.1477  0.252112    
age          0.165203   0.090385  1.8278  0.068680 .  
TBSA        -0.100953   0.057614 -1.7522  0.080860 .  
guilt        2.529493   0.835401  3.0279  0.002699 ** 
anger        3.448395   0.627695  5.4937 9.042e-08 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 8.2869 on 272 degrees of freedom
Standard errors: standard 
Multiple R-squared remains 0.175 

Generalized order-restricted information criterion: 
    Loglik    Penalty      goric 
-3596.9874     5.9454  7205.8656 

Step 3 – evaluate the hypothesis with the GORIC

out.fiml <- goric(fit.mis, hypotheses = list(H1 = H1), missing = "fiml")
out.fiml
restriktor (0.7): generalized order-restricted information criterion: 

Results:

Values:
        model          loglik          penalty          goric
1          H1       -3596.987            5.945       7205.866
2  complement       -3601.148            6.555       7215.404

Weights:
        model  loglik.weights  penalty.weights  goric.weights
1          H1           0.985            0.648          0.992
2  complement           0.015            0.352          0.008

Conclusion:
The order-restricted hypothesis 'H1' has 117.84 times more support than its
complement.

---

Additional information:

- It is advisable to compare the log-likelihood values (loglik) and/or
  weights (loglik.weights) of the best hypothesis with that of the other
  specified/informative hypotheses. More details can be found in the
  vignette 'Guidelines_GORIC_output' (to open it, run
  vignette("Guidelines_GORIC_output", package = "restriktor")) and in the
  decision tree on https://github.com/rebeccakuiper/Tutorials (the file
  'Decision tree - Interpretation.pdf').

- The benchmark() function can be used to label the height of the output,
  for example, the height of the ratio(s) of weights (e.g., to say whether
  that value denotes medium, high, or very large evidence). More details
  can be found in the vignette 'Guidelines_GORIC-benchmarks'; to open it,
  run vignette("Guidelines_GORIC-benchmarks", package = "restriktor").

\(H_1\) is 117.84 times more supported than its complement: strong support for positive effects of guilt and anger.

ImportantLog-likelihoods are not comparable between methods

With FIML, the reported log-likelihood is that of the joint normal model of all variables, based on all cases. It is therefore on a completely different scale than the log-likelihood after listwise deletion. Only compare GORIC values and weights within one analysis.

Auxiliary variables

Variables that are not part of your model, but are related to the missingness or to the incomplete variables, can improve the FIML estimates. Add them with the argument auxiliary; the model itself does not change:

restriktor(fit.mis, constraints = H1, missing = "fiml",
           auxiliary = c("aux1", "aux2"))