Hello community,
I am trying to determine Maximum likelihood estimates with stata using the "program" command. Unfortunately I either receive a warning that it is not feasible to find values or that some regions are flat or discontinuous. However, I am following an approach from a paper and cannot see any reason why it shouldn't work. To provide you with some details, please find the exact Code below:
program define bias
args lnf b
quietly replace `lnf' =(1-five*`b')/(1-0.05*`b')*(1/pvalue)
end
ml model lf bias (pvalue=) [aweight=1/numtest]
ml max
The variable "five" is an indicator which is 1 when a p-value is below or equal to 0.05 and 0 otherwise. I am trying to estimate "b" by maximizing the log likelihood function.
I saw coding examples including the expression "$ML_y1"; but even if I replaced "pvalue" by this term I would still get an error message.
I am extremly grateful for every hint and for every help with my Code from you!
Kind regards
Mascha
I am trying to determine Maximum likelihood estimates with stata using the "program" command. Unfortunately I either receive a warning that it is not feasible to find values or that some regions are flat or discontinuous. However, I am following an approach from a paper and cannot see any reason why it shouldn't work. To provide you with some details, please find the exact Code below:
program define bias
args lnf b
quietly replace `lnf' =(1-five*`b')/(1-0.05*`b')*(1/pvalue)
end
ml model lf bias (pvalue=) [aweight=1/numtest]
ml max
The variable "five" is an indicator which is 1 when a p-value is below or equal to 0.05 and 0 otherwise. I am trying to estimate "b" by maximizing the log likelihood function.
I saw coding examples including the expression "$ML_y1"; but even if I replaced "pvalue" by this term I would still get an error message.
I am extremly grateful for every hint and for every help with my Code from you!
Kind regards
Mascha
Comment