1

I have a dataset with 4 variables and 5372 units. I want to impute missing values using multiple imputation. What is the best way to do that since I'm working with longitudinal data?

Here is an example of how my dataset is organized:

Data <- data.frame(id = c("africa", "africa", "africa","europa", "europa", "europa", "america", "america", "america"), 
year = c(1980, 1981, 1982,1980, 1981, 1982, 1980, 1981, 1982), 
var1 = c(1, 8, 3, NA, 1, NA, 3, 1, NA), 
var2 = c(1, NA, 1, NA, 1, NA, 10, NA, 12))
kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
  • See [my answer](https://stats.stackexchange.com/a/101235/44269) to the question [Handling missing data in a time series](https://stats.stackexchange.com/q/101178/44269). – Alexis Jun 20 '20 at 17:12
  • Thanks! My problem is that I have missing values in all variables and I want to impute all of them. Is it possible to do that with multiple imputation? In the book example, only one of them has missings and the others are used to predict a model. – Ana Cláudia Gonçalves Jun 20 '20 at 17:26
  • This link will come in handy: https://bookdown.org/mwheymans/bookmi/multiple-imputation-models-for-multilevel-data.html. – Isabella Ghement Jun 20 '20 at 16:44

0 Answers0