I want to impute some missing data. I am interested in the number of months someone was unemployed between ages 18-21. This variable is bounded at 0-48.
However, for some individuals, I have partial employment histories. For instance, I may observe an individual between ages 18-20 only. If this individual has sixth months unemployment during this time, I know months unemployed between ages 18-21 must be bounded at 6-18.
My questions are:
- How can I make sure my imputation is between the correct bounds?
- How can I take the existing information into account in my imputation?
I've looked at Stef Van Buuren's Flexible Imputation of Missing Data book (https://stefvanbuuren.name/fimd/), which discusses his
mice package in R. In Section 6.4.6, he suggests a procedure whereby values are first imputed then truncated if outside the bounds. I have two problems with this: 1. I can only set a bound that is constant across all observations (e.g. 0-48 not 6-18 where relevant); 2. the truncation can lead to a bimodal distribution with imputed data clustered at the bounds (see example code below with bounds at 4 and 6).
set.seed(43112) n <- 400 Y1 <- sample(1:10, size = n, replace = TRUE) Y2 <- sample(1:20, size = n, replace = TRUE) Y3 <- 10 + 2 * Y1 + 0.6 * Y2 + sample(-10:10, size = n, replace = TRUE) Y <- data.frame(Y1, Y2, Y3) Y[1:100, 1:2] <- NA md.pattern(Y, plot = FALSE) post <- make.post(Y) post["Y1"] <- "imp[[j]][, i] <- squeeze(imp[[j]][, i], c(4, 6))" imp <- mice(Y, method = "norm.nob", m = 1, maxit = 1, seed = 1, post = post) ggplot(data.frame(imp$imp$Y1),aes(x=X1))+geom_density()