Bootstrap Standard Error In Stata
Contents |
on statistics Stata Journal Stata Press Stat/Transfer Gift Shop Purchase Order Stata Request a quote Purchasing FAQs Bookstore Stata Press books Books standard error regression stata on Stata Books on statistics Stat/Transfer Stata Journal Gift Shop Training NetCourses
Standard Error Stata Output
Classroom and web On-site Video tutorials Third-party courses Support Updates Documentation Installation Guide FAQs Register Stata Technical
Standard Error Stata Command
services Policy Contact Publications Bookstore Stata Journal Stata News Conferences and meetings Stata Conference Upcoming meetings Proceedings Email alerts Statalist The Stata Blog Web resources Author Support Program Installation Qualification
Bootstrap Standard Error R
Tool Disciplines Company StataCorp Contact us Hours of operation Announcements Customer service Register Stata online Change registration Change address Subscribe to Stata News Subscribe to email alerts International resellers Careers Our sites Statalist The Stata Blog Stata Press Stata Journal Advanced search Site index Purchase Products Training Support Company >> Home >> Products >> Features >> bootstrap standard error estimates for linear regression Bootstrap sampling & estimation Order Stata Bootstrap sampling and estimation Bootstrap of Stata commands Boostrap of user-written programs Standard errors and bias estimation Stata’s programmability makes performing bootstrap sampling and estimation possible (see Efron 1979, 1982; Efron and Tibshirani 1993; Mooney and Duval 1993). We provide two options to simplify bootstrap estimation. bsample draws a sample with replacement from a dataset. bsample may be used in user-written programs. It is easier, however, to perform bootstrap estimation using the bootstrap prefix. bootstrap allows the user to supply an expression that is a function of the stored results of existing commands, or you can write a program to calculate the statistics of interest. bootstrap then can repeatedly draw a sample with replacement, run the user-written program, collect the results into a new dataset, and present the results. The user-written calculation program is easy to write because every Stata command saves the statistics it calculates. For instance, assume that we wish to obtain the bootstrap estimate of the standard error of the median of a variable called mpg.
on statistics Stata Journal Stata Press Stat/Transfer Gift Shop Purchase Order Stata Request a quote Purchasing FAQs Bookstore Stata Press books Books on Stata Books on statistics Stat/Transfer Stata Journal bootstrap standard error matlab Gift Shop Training NetCourses Classroom and web On-site Video tutorials Third-party courses Support Updates bootstrap standard error formula Documentation Installation Guide FAQs Register Stata Technical services Policy Contact Publications Bookstore Stata Journal Stata News Conferences and meetings Stata bootstrap standard error heteroskedasticity Conference Upcoming meetings Proceedings Email alerts Statalist The Stata Blog Web resources Author Support Program Installation Qualification Tool Disciplines Company StataCorp Contact us Hours of operation Announcements Customer service Register Stata online Change registration http://www.stata.com/features/overview/bootstrap-sampling-and-estimation/ Change address Subscribe to Stata News Subscribe to email alerts International resellers Careers Our sites Statalist The Stata Blog Stata Press Stata Journal Advanced search Site index Purchase Products Training Support Company >> Home >> Resources & support >> FAQs >> Guidelines for bootstrap samples The following question and answer is based on an exchange that started on Statalist. How large should the bootstrapped http://www.stata.com/support/faqs/statistics/bootstrapped-samples-guidelines/ samples be relative to the total number of cases in the dataset? Title Guidelines for bootstrap samples Author William Gould, StataCorpJeff Pitblado, StataCorp Note: This FAQ has been updated for Stata 14. bootstrap is based on random draws, so results are different from previous versions because of the new 64-bit Mersenne Twister pseudorandom numbers. Question: I am running a negative binomial regression on a sample of 488 firms. For various reasons [...], I decided to use the bootstrapping procedure in Stata on my data. Are there general guidelines that have been proposed for how large the bootstrapped samples should be relative to the total number of cases in the dataset from which they are drawn? Answer: When using the bootstrap to estimate standard errors and to construct confidence intervals, the original sample size should be used. Consider a simple example where we wish to bootstrap the coefficient on foreign from a regression of weight and foreign on mpg from the automobile data. The sample size is 74, but suppose we draw only 37 observations (half of the observed sample size) each time we resample the data 2,000 times. . sysuse auto, clear . set seed 3957574 . bootstrap _b[foreign], size(37)
about any statistic you can calculate. The results of almost all Stata commands can be bootstrapped immediately, and it's relatively straightforward to put any other results you've calculated in a form that can be bootstrapped. This article will show you how. If you're just https://www.ssc.wisc.edu/sscc/pubs/4-27.htm looking to bootstrap the results of a Stata command, all you'll need is a basic familiarity with Stata. However, if you need to calculate something else and then bootstrap it you'll need to write an official Stata program to do so. If you're not familiar with writing Stata programs (which are not the same as do files) you'll want to take a look at Programming in Stata, in particular the section on programs. Bootstrapping Results standard error from Stata Commands If there is a single Stata command that calculates the result you need, you can simply tell Stata to bootstrap the result of that command. As an example, load the automobile data that comes with Stata and consider trying to find the mean of the mpg variable. The summarize (sum) command will do exactly what you want: sysuse auto sum mpg But how will the bootstrap command find the number it needs bootstrap standard error in all that output? The answer is that you will tell it where to look in the return vector. The Return Vector In addition to the output you see on the screen or in your log, all Stata commands quietly put their results in a return vector. You can refer to this vector in subsequent commands, or in the case of bootstrap you can tell it what part of the return vector you care about. To see the current tables of the return vector, type return list The sum command is a basic command (as opposed to an estimation command) so its return vector is called r(). Looking over the list, you'll see that r(mean) is the number you want. You're now ready to actually carry out the bootstrap. The bootstrap Command Syntax The basic syntax for a bootstrap command is simple: bootstrap var=r(result): command Here var is simply what you want to call the quantity you're bootstrapping. You're welcome to choose any name you like as long as it meets the usual rules for a Stata variable name. In our case meanMPG would be appropriate. r(result)tells the bootstrap command to look in the r() vector for the particular result you're interested in. We're interested in r(mean). Finally command should be replaced by the actual command that calculates the result you want. I