Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Replace missing values with correspondance

    In a panel data I have two variables among many, one is ID (some industry codes) and other has value like financing. Some of the codes have missing values. Like codes D1 to D20 has values then D21 to D23 don't. How do I replace those missing values with some of those which are there, like D3 value to be copied for D21 and D15 for D22? So no pattern or sequencial replacing, random manual matching. Any easy code?
    I tried this:
    replace financing = financing[rownumber of D3] if code == "D21"

    and it seems to be working. My issue is if there's any way to get it linked with variable and observation rather than row number since row number would keep changing with editing of data.

  • #2
    I can't follow this, but if there isn't a systematic rule for what is replaced with what, then there can't be systematic code. That is, why replace D21 values with D3 value, and so on?

    Comment

    Working...
    X