Applies a 2D moving average smooth to the trends over age and period, and fills any remaining missing values by approximating the age pattern within a particular year.
Examples
if (FALSE) { # \dontrun{
test_data <- data.frame(expand.grid(age = c(12:40, 42:89), year = 2001:2016))
setDT(test_data)
test_data[ , prob := runif(nrow(test_data))]
test_data[sample(1:nrow(test_data), 100, replace = F), prob := NA]
data_sm <- p_smooth(test_data, "prob", 3)
} # }
