****************************************************************************************************************
*BOOTSTRAP FCT*

program hlp_boot, rclass byable(recall)

syntax varlist [, p1(real 0) p2(real 0) p3(real 0) cpoint(real 0)]
tokenize `varlist'

quietly ttest `1', by( `2' )


local alpha11 = r(mu_1)-(`p3'/sqrt(1-(`p1')^2))*`p1'
local alpha21 = r(mu_2)-(`p3'/sqrt(1-(`p1')^2))*`p1'

local w1 = `p3'/sqrt(1-(`p1')^2)
local w2 = `p3'/sqrt(1-(`p1')^2)

*p1
quietly psn `cpoint' `alpha11' `w1' `p2'
local prp1 = r(psn)

*p2
quietly psn `cpoint' `alpha21' `w2' `p2'
local prp2 = r(psn)

return scalar prop1=`prp1'
return scalar prop2=`prp2'

end