Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: rolling prais regression in paneld dataset

Subject   st: rolling prais regression in paneld dataset
Date   Sun, 16 Jul 2006 12:59:47 -0400

Hi I am using Stata9's new rolling capability with prais regression
on a panel dataset (unbalanced panal with about 10,000 individuals
and roughly 15 years for each).

Stata-tech support helped me write a little program that collects,
in addition to coefficients of the regression, its predicted values
and residuals. But the program doesn't seem to work well, and I am
not sure where the bug is, I tried recontacting tech support, but
so far no answer. Here is my code, any help would be greately

tsset person year

program myforecast, rclass
	syntax [if]
	prais r exp `if'
	summ year if e(sample)
	local min=r(min)
	predict pred`min' if e(sample)
	predict resid`min' if e(sample), r
	return scalar n=r(N)
	return scalar rho=e(rho)

rolling rho=r(rho) n=r(n), window(15) ///
	saving(roll, replace): myforecast
save pred, replace

Olga Gorbachev Melloni
Economics Ph.D. Student
Columbia University

*   For searches and help try:

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