Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Is there a quick way of customizing linear interpolation?


From   Halit Akturk <[email protected]>
To   [email protected]
Subject   st: Is there a quick way of customizing linear interpolation?
Date   Sat, 17 Jul 2010 20:40:30 -0500

Hi all,
I am a Stata 11 user. Is there any way to customize ipolate command in
Stata in a quick way? I like to do linear interpolation but I have a
constraint. I like to fill in the missing observations as long as the
missing observations happen at most 2 times consequtively. For
instance, say I have the following data where "." stands for missing
observation:
1, 4, 5, ., 7, ., ., ., 9, ., ., 15.
The usual Stata's ipolate gives: 1, 4, 5, 6, 7, 7.5, 8, 8.5, 9,11, 13, 15.
The ipolate will fill in all of the missing observations. I don't
wanna do that. I like to fil in the missing values as long as they are
at most 2 observations consequtively. So the customized linear
interpolation (which is what I am looking for) should give me the
following result:
1, 4, 5, 6, 7, ., ., ., 9, 11, 13, 15. I hope I explained what I am
looking for well.

I will appreciate any help. Thank you...

Halit Akturk
Department of Economics
Vanderbilt University
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index