Stata code accompanying “Building an Empirical Body of Evidence: Developing Rapport with Reviewers and Overcoming Skepticism in Strategic Management Research,” in Research Methodology in Strategy and Management, Volume 15. (Paper)
Appendix 1. Random data regressions
clear
//set the number of observations
set obs 1000
//create a variable in dataset to capture betas, p-values, and confidence interval
gen b = .
gen p = .
gen ci_l = .
gen ci_h = .
//loop from 1 to 100
forvalues i = 1/100 {
gen y`i' = rnormal() //generate y1 through y100
gen x`i' = rnormal() //generate x1 through x100
reg y`i' x`i' //run regression predicting y_i with x_i
mat b = r(table) //save results table
replace b = b[1,1] if _n==`i' //b-value of the i-th model, saved to i-th row
replace p = b[4,1] if _n==`i' //p-value
replace ci_l = b[5,1] if _n==`i' //low side of confidence interval
replace ci_h = b[6,1] if _n==`i' //high side of confidence interval
}
//count how many p-values are <= 0.05
count if p<=.05
Appendix 2. Outlier example
clear
set obs 100
gen y = rnormal()
gen x = rnormal()
reg y x //significant at p <= 0.05 about 1 in 20 times
set obs 104 //add 4 more observations to the data
//generate the 4 outliers
replace y = 2.5 in 101
replace x = 2.5 in 101
replace y = -3.0 in 102
replace x = -3.5 in 102
replace y = 3.5 in 103
replace x = 3.0 in 103
replace y = -2.5 in 104
replace x = -2.5 in 104
reg y x //significant at p <= 0.05 nearly every time
scatter y x