Skip to main content
. Author manuscript; available in PMC: 2014 Mar 2.
Published in final edited form as: Stata J. 2012 Oct 1;12(4):718–725.
program define deft2corr
capture log close
di “ ”
if ‘5’ == 1 {
    di “Exponentiated Estimate: ” exp (‘1’)
    di “95% CI LL: ” exp (‘1’ - 1.96* ‘2’* (sqrt (‘3’)/sqrt (‘4’) ) )
    di “95% CI LL: ”exp (‘1’ + 1.96* ‘2’* (sqrt (‘3’)/sqrt (‘4’) ) )
}
if ‘5’ == 0 {
    di “Estimate: ” ‘1’
    di “95% CI LL: ” ‘1’ - 1.96* ‘2’ * (sqrt (‘3’)/sqrt (‘4’) )
    di “95% CI LL: ” ‘1’ + 1.96* ‘2’ * (sqrt(‘3’)/ sqrt (‘4’) )
}
di “Z statistic: ” ‘1’ / (‘2’ * (sqrt (‘3’) / sqrt (‘4’) ) )
if ‘1’ / (‘2’ * (sqrt (‘3’) / sqrt (‘4’) ) ) > 0 di “p-value: ” 2 * (1- normal (‘1’ / (‘2’* (sqrt (‘3’) / sqrt(‘4’) ) ) ) )
if ‘1’ / (‘2’ * (sqrt (‘3’) / sqrt (‘4’) ) ) < = 0 di “p-value: ” 2 * (normal (‘1’ / (‘2’ * (sqrt (‘3’) / sqrt (‘4’) ) ) ) )
end
exit