program drop _all

use example,clear
hapipf a1 a2, ipf(l1*D) model(0)
hapipf a1 a2, ipf(l1+D) model(1) lrtest(0,1)
profhap a1 a2, ipf(l1+D) or(D 2 1) hapacc(0.00000000001) acc(0.0001)

use example2,clear
hapipf a1 a2 b1 b2, ipf(l1*l2) model(0)
hapipf a1 a2 b1 b2, ipf(l1+l2) model(1) lrtest(0,1)
  
use example3,clear
hapipf a1 a2, ipf(l1*S+S*D) confile(strata2) convars(l1 D S)
hapipf a1 a2, ipf(l1*S+S*D) confile(strata1) convars(l1 D)
hapipf a1 a2, ipf(l1*S*D) model(0)
hapipf a1 a2, ipf(l1*D+l1*S+S*D) model(1) lrtest(0,1)
profhap a1 a2, ipf(S*D+l1*S) or(D 1 2) by(S) acc(0.00001)
profhap a1 a2 b1 b2, ipf(S*D+l1*l2*S) or(D 1.1 2.2) by(S) acc(0.0001)
hapipf a1 a2 b1 b2, ipf(S*D+l1*l2*S) confile(strata3) convars(l1 l2 D)
hapipf a1 a2 b1 b2, ipf(S*D+l1*l2*S) confile(strata4) convars(l1 l2 D S)
hapipf a1 a2 b1 b2, ipf(S*D*l1*l2)
hapipf a1 a2 b1 b2, ipf(S*D+l1*l2*S+l1*l2*D) 
