* Calculate the mean and standard deviation, using 10 samples of * size 1000, from an empirical distribution, i.e. a bootstrap use U:\STATA\nhis_ch6.dta , clear // No longer available label var exfreqwR "Overall level of Physical Activity" drop if exfreqwR == . summarize exfreqwR postfile results samp mean sd using results, replace forvalue samp = 1/10 { preserve sample 1000, count summarize exfreqwR scalar mean=r(mean) scalar sd = r(sd) post results (`samp') (mean) (sd) restore } postclose results clear use results summarize mean