Using the bootstrap technique to draw and save 1000 random samples from the nlswork and save them as a data frame. Given the panel structure of the nlswork data, the panel characteristics of the data must be specified as explained here. Panel characteristics of the nlswork data can be specified as shown below.
It is of note that "two cluster options in the bootstrap command line will be needed. The first option, cluster(idcode), identifies the original panel variable in the dataset, whereas the second, idcluster(newid), creates a unique identifier for each of the selected clusters (panels in this case). Thus if some panels were selected more than once, the temporary variable newid would assign a different ID number to each resampled panel. If the two clusters indicators are omitted, bootstrap will not take into account the panel structure of the data; rather, it will construct the simulated samples by randomly selecting individual observations from the pooled data."
It is of note that "two cluster options in the bootstrap command line will be needed. The first option, cluster(idcode), identifies the original panel variable in the dataset, whereas the second, idcluster(newid), creates a unique identifier for each of the selected clusters (panels in this case). Thus if some panels were selected more than once, the temporary variable newid would assign a different ID number to each resampled panel. If the two clusters indicators are omitted, bootstrap will not take into account the panel structure of the data; rather, it will construct the simulated samples by randomly selecting individual observations from the pooled data."
webuse nlswork, clear
generate newid = idcode
tsset newid year
generate newid = idcode
tsset newid year
Comment