Hello everyone,
I am trying to replace missing values with the corresponding median, bearing in mind that this Median must varies across a class variable (CountryCode)
so I have something like
CountryCode AGE US 12 US 10 US . FR 11 FR . NL 10
etc...
in the above example I am trying to replace the missing in Age by the medians AGE within each Country (US, FR, NL)
Have tried a coupld of sulutions that will relace with the median across the whole sample but nothing that actually take into account the class variable CountryCode)
Thanking you in advance,