Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

AW: st: Bootstrapping panel data

From   "Wrede" <[email protected]>
To   <[email protected]>
Subject   AW: st: Bootstrapping panel data
Date   Sun, 22 May 2005 00:54:20 +0200

Hi Jo,

Thanks for your immediate reply. 
I did the routine below and the tsset problem disappeared.

However, now the r(2000) problem occured: 
insufficient observations to compute bootstrap standard errors
no results will be saved

The panel is unbalanced. However, I made the panel equally spaced by filling
the remaining years with missing values.
Now I tried three things:
1. Using the panel, equally spaced (i.e. every unit has 5 years) but with
missing observations.
2. Using the panel, unequally spaced, with no missing observations.
3. Using just a fraction of the panel, the is equally spaced with no

1. and 2. generated the r(2000) problem stated above. 
3. worked.

However, all my test worked with the unbalanced und sometime unequally
spaced panel.
I do not want to use bootstrap with only a fraction of information I have
(this would be the exact opposite to the original intention of using

Do you know any solution to get around this problem?

Again, thank you very much for your immediate help.



Are your panel unequally spaced or are there gaps in years?
If so see the (copied and pasted) exchange I had
a while ago.

Hi Jo,
I had that problem once.  What you have to do is generate a new time
variable to avoid r(2000) (no observations error) and tsset using this new
one. For example: (notice that d73 to d98 are time dummies)

gen time2 =. ;

replace time2 = 1 if d73 == 1 ;
replace time2 = 2 if d78 == 1 ;
replace time2 = 3 if d83 == 1 ;
replace time2 = 4 if d88 == 1 ;
replace time2 = 5 if d93 == 1 ;
replace time2 = 6 if d98 == 1 ;

tsset panchayat time2 ;

Hope it works for you.


Monica L.

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of jyotsna puri
Sent: Monday, December 06, 2004 7:32 AM
To: [email protected]
Subject: RE: st: xtabond and 'no observations'

Hi all,

I am obviously not seeing something.

I have a dataset for a land variable (sr1tara), water(agwsc2), credit
(crbadu1). There are 'id' variables for villages and unbalanced data is
present for 6 years (maximum). I have tried to use the xtabond command and I
get 'no observations'. There is some thing that I am obviously carelessly
missing. Can someone help me out?

At the minimum I do the following (output below).
My questions:
1. Why am I getting 'no observations'?

2. Is this anything to do with the fact that my data is not balanced?
(Shouldnt be. The abdata.dta - the example dataset provided by stata for
xtabond is also unbalanced). I have obviously used other variables in other
commands but it dosent work for even this minimal list...

3. This may have something to do with the note after 'tsset' which says I
have data from 86 to 96, but with gaps.

I have two types of 'missingness'. This is an unbalanced
data - so all villages are not present for
all years. I have tried xtabond for villages that are only present for all 6
years. No avail.

There is also 'item non-response' i.e the village may be present but data
for sr1tara is missing. I have tried two options. In the first, filling up
with tsfill, full. In the second throwing out these observations completely,
and then filling up with tsfill, full.

I have also tried replacing 'missing' values
of sr1tara with zeros and then using the command.
No avail.


Jyotsna (Jo) Puri
[email protected]

----Original Message Follows----
From: "Wrede" <[email protected]>
Reply-To: [email protected]
To: <[email protected]>
Subject: st: Bootstrapping panel data
Date: Sat, 21 May 2005 23:26:07 +0200

Hi statalisters,
I am using panel data, which are tsset. I am using some xt commands like
xtabond etc. Now I want to bootstrap the sample and re-run the tests.

My problem:
STATA complains that my data are not tsset.

My code is:
bootstrap "xtabond vardep varexp, robust" _b[ld.vardep] _b[d.varexp]
_b[_cons], trace reps(100) cluster(id)

The trace gives back:
local tmax = r(tmax)
capture local id "`r(panelvar)'"
=capture local id ""
if "`id'"=="" {
= if ""=="" {
di as err "must tsset data and specify panelvar"
must tsset data and specify panelvar

However, I did tsset my data again and again. Any suggestions?

Thanks in advance

*   For searches and help try:

*   For searches and help try:

*   For searches and help try:

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