Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to keep track of resampled panels in a bootstrap? Clarification of a technical note needed.

    I am trying to implement a bootstrap, using a user-written (wrapper) program. The econometric task is to get correct standard errors due to a generated regressor -problem. I am bootstrapping both stages of the procedure.

    My program involves using two panel datasets, meaning that I need to keep careful track of the panels (sometimes called clusters) that I resample.

    What I find a bit confusing is the following Technical note in Stata Base Reference Manual Release 17, page 158:

    Similarly, when you have panel (longitudinal) data, all resampled panels must be unique
    in each of the bootstrap samples to obtain correct bootstrap estimates of statistics. Therefore,
    both cluster(panelvar) and idcluster(newpanelvar) must be specified with bootstrap, and
    i(newpanelvar) must be used with the main command. Moreover, you must clear the current xtset
    settings by typing xtset, clear before calling bootstrap.
    In particular, I would appreciate clarifying comments regarding the use of idcluster(newpanelvar) and i(newpanelvar).

    For example, if I wanted to include xtivreg with fixed effects in my wrapper program, how should I make use of these?

    In my two panel datasets, panelvar is firm_id and time-dimension is captured by year.

    What I am wondering, for example, are the following:

    Should I perhaps use xtset to declare the data to be panel, within the wrapper program? As in: xtset newpanelvar year.

    Or, should I somehow try to use i(newpanelvar)and t(year)as options to xtivreg?

    All kinds of clarifying examples and insights would be most welcome.

    Thanks in advance.
Working...
X