Dear Statalist:
Consider a panel data set with monthly data in which the variable $x$ in month $t+1$ reports an outcome of month $t$. Suppose the panel is unbalanced such that Jan, Feb, and Apr, but not Mar, are observed.
To sync outcomes with calendar dates, I use the forward operator in this example:
***
gen outcome = f.x
***
Given that Mar is not in my data set, I am dropping the information about the outcome (reported in Apr) even though it is observed.
I am looking for a clever way to generate an observation for Mar that contains this information. The fillin command would be an option to fill in all gaps in the panel, but given that my data set is very large I only want to fill in obs for which the outcome is available.
Thanks,
Peter
Consider a panel data set with monthly data in which the variable $x$ in month $t+1$ reports an outcome of month $t$. Suppose the panel is unbalanced such that Jan, Feb, and Apr, but not Mar, are observed.
To sync outcomes with calendar dates, I use the forward operator in this example:
***
gen outcome = f.x
***
Given that Mar is not in my data set, I am dropping the information about the outcome (reported in Apr) even though it is observed.
I am looking for a clever way to generate an observation for Mar that contains this information. The fillin command would be an option to fill in all gaps in the panel, but given that my data set is very large I only want to fill in obs for which the outcome is available.
Thanks,
Peter
Comment