/*
Code to accompany:
BUILDING AN EMPIRICAL BODY OF EVIDENCE:
DEVELOPING RAPPORT WITH REVIEWERS AND
OVERCOMING SKEPTICISM IN STRATEGIC MANAGEMENT RESEARCH
Appearing in: RESEARCH METHODOLOGY IN STRATEGY AND MANAGEMENT VOLUME 15
by Timothy J. Quigley
*/
//APPENDIX 1. STATA CODE FOR 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’ //capture the b-value of the i-th model and save 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. STATA CODE FOR OUTLIER EXAMPLE
clear
set obs 100
gen y = rnormal()
gen x = rnormal()
reg y x // significant at p,50.05 ; 1 in 20
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