Hi listers!
I'm working on a database for my undergraduate thesis, but I'm facing a problem with missing values.
For some variables I do not have observations for the whole time serie, I would like to know if there is a command or a way to keep an observation constant until there is another observation different to a missing value, and keep it doing the same operation for all the observations.
Right now my database looks like this:
Country Year X
Mexico 2000 2
Mexico 2001 .
Mexico 2002 5
Mexico 2003 .
Mexico 2004 6
Mexico 2005 .
Mexico 2006 .
Mexico 2007 4
Mexico 2008 .
I would like it to look like this one:
Country Year X
Mexico 2000 2
Mexico 2001 2
Mexico 2002 5
Mexico 2003 5
Mexico 2004 6
Mexico 2005 6
Mexico 2006 6
Mexico 2007 4
Mexico 2008 4
Thank you!
I'm working on a database for my undergraduate thesis, but I'm facing a problem with missing values.
For some variables I do not have observations for the whole time serie, I would like to know if there is a command or a way to keep an observation constant until there is another observation different to a missing value, and keep it doing the same operation for all the observations.
Right now my database looks like this:
Country Year X
Mexico 2000 2
Mexico 2001 .
Mexico 2002 5
Mexico 2003 .
Mexico 2004 6
Mexico 2005 .
Mexico 2006 .
Mexico 2007 4
Mexico 2008 .
I would like it to look like this one:
Country Year X
Mexico 2000 2
Mexico 2001 2
Mexico 2002 5
Mexico 2003 5
Mexico 2004 6
Mexico 2005 6
Mexico 2006 6
Mexico 2007 4
Mexico 2008 4
Thank you!
Comment