Dear All,

I would like to replace missing values per household Each household should have a similar value but the values varies across households. Please find sample data here.

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str17 HHID int(wetindex potwetindex)
"1021000201"   .    .
"1021000203" 314 1175
"1021000203" 314 1175
"1021000203" 314 1175
"1021000203"   .    .
"1021000203"   .    .
"1021000207" 324 1175
"1021000207" 324 1175
"1021000207" 324 1175
"1021000207"   .    .
"1021000207"   .    .
"1021000212" 324 1173
"1021000212" 314 1168
"1021000212" 314 1168
"1021000212"   .    .
"1021000212"   .    .
"1021000213" 314 1163
"1021000213" 314 1163
"1021000213" 314 1163
"1021000213"   .    .
"1021000213"   .    .
end
label values wetindex ssa_lab
label def ssa_lab 314 "Tropic-warm/humid", modify
label def ssa_lab 324 "Tropic-cool/humid", modify


Thanks in advance.