Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: missings question

From   "Riano, Alejandro" <>
To   "''" <>
Subject   st: missings question
Date   Wed, 19 Jun 2002 15:32:31 -0400

I have a panel dataset and i want to filter one of the series using the
Hodrick-Prescott filter. The problem is that for some countries the variable
that i have to filter has missing observations in a middle year (i.e i have
the observation from 1989 to 1994 and one missing on 1995 and then continues
again). I've ran the following do file:

sort codigo1
gen hpr=.
local i=1
while `i'<codigo1[_N] {
hpfilter rer if codigo1==`i' & rer~=.
replace hpr=H_rer if codigo1==`i'
drop H_
local i=`i'+1}
gen devhpr=rer-hpr

but when i got to the first country that have the missings in between i got
an error: 
"gaps in the data" 

do you know a way in which i could overcome this problem ?? or do you know
how could i identify the countries for which the missing values for my
variable are like this:

year  variable
89      x89
90      x90
91      x91
92       .
93      x93

and so on...

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index