HI
I have the dataset counting 161 observations. The dataset looks as following:
ID_2 NAME_2 innovation
31462 Region 1 .3636364
31463 Region 2 .25
31464 Region 3 .4
31465 Region 4 .1428571
31466 Region 5 NA
31467 Region 6 0
31468 Region 7 0
31469 Region 8 .3333333
31470 Region 9 .4
31471 Region 10 1
31472 Region 11 NA
.....
I would like to replace missing values of varible innovation (NA) with the average value of few observations of variable innovation. Hypothetically, Region 5 has missing value of innovaiton. I would like to replace this missing value with the average innovation of Region 3, 7 and 10 (which are neigbouring regions of region 5).
How can I do that?
Thank you!
I have the dataset counting 161 observations. The dataset looks as following:
ID_2 NAME_2 innovation
31462 Region 1 .3636364
31463 Region 2 .25
31464 Region 3 .4
31465 Region 4 .1428571
31466 Region 5 NA
31467 Region 6 0
31468 Region 7 0
31469 Region 8 .3333333
31470 Region 9 .4
31471 Region 10 1
31472 Region 11 NA
.....
I would like to replace missing values of varible innovation (NA) with the average value of few observations of variable innovation. Hypothetically, Region 5 has missing value of innovaiton. I would like to replace this missing value with the average innovation of Region 3, 7 and 10 (which are neigbouring regions of region 5).
How can I do that?
Thank you!
Comment