Page 1 of 1

Generating lagged variables for panel data

Posted: Thu Apr 20, 2017 7:09 am
by Marc150
Is there something special that you have to do to generate lagged variables when using panel data?
When I try the very simple code

'series a=b(-1)' or

'genr a=b(-1)'

the series a ends up having a bunch of missing values, for reasons that I don't understand.

Thanks in advance,
Marc

Re: Generating lagged variables for panel data

Posted: Thu Apr 20, 2017 7:13 am
by EViews Gareth
No, nothing special. You are doing it correctly

Re: Generating lagged variables for panel data

Posted: Thu Apr 20, 2017 7:16 am
by startz
Remember that the first observation for each cross-section should be missing.

Re: Generating lagged variables for panel data

Posted: Thu Apr 20, 2017 7:29 am
by Marc150
Thanks (I've just realized that I was sampling only a subset of observations)

Re: Generating lagged variables for panel data

Posted: Mon Dec 30, 2024 6:54 pm
by NeweyWest
In panel data, if I use series Y=X(-1), many cross-sections have missing data. If I try frml Y=X(-1), the first observation of each cross-section should be missing but it's not.

Re: Generating lagged variables for panel data

Posted: Mon Dec 30, 2024 7:11 pm
by startz
When I try, I get the correct NAs. What version are you using? Can you post a short example?