Artur,

 

If you’re restricting the sample to one country, is it still a panel? Wouldn’t OLS work in that case? Or am I missing something?

 

PS

 

From: gretl-users-bounces@lists.wfu.edu [mailto:gretl-users-bounces@lists.wfu.edu] On Behalf Of artur tarassow
Sent: Tuesday, February 19, 2013 7:56 AM
To: Gretl list
Subject: [Gretl-users] panel estimation based on restricted sample

 

Hey everybody,

I've got a panel data set including data for several countries over time. In a first stage I run a RE-estimation based on the full sample. Next I want to estimate the same model for a single country by restricting the data:

<hansl>
smpl country="UK" --restrict --replace
panel Y const X --random-effects
<\hansl>

But gretl states "This estimator requires panel data". Instead, this works:

<hansl>
smpl country="UK" --restrict --replace
setobs ID year --panel-vars
panel Y const X --random-effects
<\hansl>

Fine so far. Since I want to add all country-specific estimations (for several dependent variables) into a single table (modeltab), I include the code into a loop function, but unfortunately the "setbobs"-command does not work within a loop environment.
Does anyone have a solution to solve this issue, or would it be possible to allow the "setobs"-command to work within a loop-function?

Cheers,
Artur