Econometrics blog

Dec 30, 2015

Generating with matching value


 This is how to generate a variable with number matching:

#delimit;
egen poten_indo = anymatch(digit4n), values(
7201    7207    7113    8419    8003    8311    1804    1703    2902    6114    0906    3906    7305    4401    7208    6111    6406    5503    1605    0802    1212    8007    8538    7407    5205    0801 
);
#delimit cr

Jan 13, 2015

Cubic spline interpolation

We can interpolate missing data by using cubic spline in stata

first, install this package in stata:
ssc install csipolate

this is an example:
 Setup
        . webuse ipolxmpl1

    List the data
        . list, sep(0)

    Create y1 containing a natural cubic spline interpolation of y on
    x for missing values of y
        . csipolate y x, gen(y1)

    List the result
        . list, sep(0)