I am analysing profit function in structural modelling (sur) and looking for a way to obtain bootstrap standard errors in R. I am aware of the the package "boot" but how we could run it for a sur system?
The boot function will give you the standard error of bootstrapped statistics. It can also give you confidence intervals for a statistic.
With boot, you can bootstrap any statistic, provided you can figure out a way to express that statistic as a function in R. The following link has an example bootstrapping the confidence interval of the r-squared value from the lm function.
If "model" is our model object. The r-squared value happens to be found at summary(model)$r.squared. So you have to figure out where the statistic is that you want to bootstrap.
In this example, the boot function takes a subset of the data, runs the linear regression, extracts the r-squared, and repeats this 5000 times (in this case).
As written, the example uses the boot.ci function to obtain a confidence interval.
But the standard error can be found in the output of:
Thanks for providing this useful information. I am wondering how the system of equations with cross-equation restrictions can be entered into Result in a function for bootstrapping. I have 4 input demand equations and main profit equation that I am analysing using "systemfit". With all equation in a system with restrictions, my command to get summary statistics are as follows:
You'll need to isolate one statistic at a time, and bootstrap one at a time. str(summary(fitRsur)) will help you determine how to isolate one statistic from the results.