Dear all,
I'n using Stata 13.1. I have a balanced panel data with 106 countries.
For each country I want to test if it demonstrates an inverted U shape over time in some variable. For this end I ran a loop which applies -Utest- command.
Yet, as an output I just want to see the P>|t| value of the U shape test for each country.
I tried the following code:
But it returns:
Albania
P>|t| =
Algeria
P>|t| =
Argentina
P>|t| =
and so on..
Any ideas how can I can receive the required output?
Many thanks for your time!
Anat
I'n using Stata 13.1. I have a balanced panel data with 106 countries.
For each country I want to test if it demonstrates an inverted U shape over time in some variable. For this end I ran a loop which applies -Utest- command.
Yet, as an output I just want to see the P>|t| value of the U shape test for each country.
I tried the following code:
Code:
gen long obs = _n
forval i = 1/106 {
su obs if country_code == `i', meanonly
di country[r(min)]
qui regress ir time time2 if country_code==`i'
qui utest time time2
local P>|t = e(P>|t)
di " P>|t| = "
}
Albania
P>|t| =
Algeria
P>|t| =
Argentina
P>|t| =
and so on..
Any ideas how can I can receive the required output?
Many thanks for your time!
Anat

Comment