This is a follow-up question to this one, but since it's a different question, and to increase searchability of the forum I'm posting it separately.
I'm setting up an estimation of a two-equation model using bayesmh. Some of the model's parameters are ~fixed effects, i.e. call bayes mh as:
But bayesmh drops these and writes:
I can work around this by using dummies, but I suspect this is telling me that something about doing this is bad.
My likelihood is:
I'm setting up an estimation of a two-equation model using bayesmh. Some of the model's parameters are ~fixed effects, i.e. call bayes mh as:
Code:
bayesmh (link=treatment x1 i.group) (bilink=treatment x2 i.group) ,/// llevaluator(mylikelihoodevaluator) /// prior({eco_link: treatment x1 i.group} {bilink: treatment x2 i.group},flat)
Code:
note: parameter link:1.group is omitted note: parameter link:2.group is omitted note: parameter bilink:1.group is omitted note: parameter bilink:2.group is omitted
My likelihood is:
Code:
program define mylikelihoodevaluator args lnf Xb1 Xb2 tempvar lnfj qui gen `lnfj' = . qui replace `lnfj' = ln(1-normal(`Xb1'))+ln(1-normal(`Xb2')) if $MH_y1==0 qui replace `lnfj' = ln(normal(`Xb1'))+ln(1-normal(`Xb1'))+ln(1-normal(`Xb2')) if $MH_y1==1 & $MH_y2==0 qui replace `lnfj' = ln(1-(1-normal(`Xb1')*normal(`Xb1'))*(1-normal(`Xb2'))) if $MH_y1==1 & $MH_y2==1 summarize `lnfj' if $MH_touse, meanonly if r(N) < $MH_n { scalar `lnf'=. exit } scalar `lnf' = r(sum) end
Comment