Dear all,
I have a panel dataset, by firm and year, the first year is 1981, I have a xvar variable I want to normalize it using its 1981 value. e.g. if xvar=10 in year 1982, and its 1981 value is 5, then after normalization, the xvar_norm=10/5.
Not all firms have 1981 xvar value, that is, I have gaps in the year for my firm data.
My question is how I construct the normalized series in reference to 1981 value.
My pretend data is here, actual data has 100,000 firm year records.
Thanks,
Rochelle
I have a panel dataset, by firm and year, the first year is 1981, I have a xvar variable I want to normalize it using its 1981 value. e.g. if xvar=10 in year 1982, and its 1981 value is 5, then after normalization, the xvar_norm=10/5.
Not all firms have 1981 xvar value, that is, I have gaps in the year for my firm data.
My question is how I construct the normalized series in reference to 1981 value.
My pretend data is here, actual data has 100,000 firm year records.
Code:
clear input int(firmid year) double xvar 1000 1981 .94022655 1000 1982 1.288908 1000 1983 1.3905064 1000 1984 1.6384722 1002 1982 2.3624953 1002 1983 2.5735009 1002 1984 3.2092887 1002 1985 3.1472486 1003 1981 2.8487526 1003 1982 2.8611921 1003 1983 2.8942158 1003 1984 2.7964259 1003 1985 3.0314453 end
Rochelle
Comment