Hello StataListers,
I am estimating a fractional logit model, where my dependent variable, y, is a proportion in the [0,1] interval, on two independent variables, x1 and x2.
I am using fracreg logit y x1 x2.
I would like to set up the likelihood function "manually", and estimate the model with ``ml''.
I know that if my y variable was binary (0 or 1), the the manual logit is estimated as below. However, I am not sure how this estimation needs to be adapted as y is continuous within [0,1].
program define mylogit
args lnf Xb
quietly replace `lnf' = -ln(1+exp(-`Xb')) if $ML_y1==1
quietly replace `lnf' = -`Xb' - ln(1+exp(-`Xb')) if $ML_y1==0
end
ml model lf mylogit (y=x1 x2)
ml maximize
Thank you all.
Costas
I am estimating a fractional logit model, where my dependent variable, y, is a proportion in the [0,1] interval, on two independent variables, x1 and x2.
I am using fracreg logit y x1 x2.
I would like to set up the likelihood function "manually", and estimate the model with ``ml''.
I know that if my y variable was binary (0 or 1), the the manual logit is estimated as below. However, I am not sure how this estimation needs to be adapted as y is continuous within [0,1].
program define mylogit
args lnf Xb
quietly replace `lnf' = -ln(1+exp(-`Xb')) if $ML_y1==1
quietly replace `lnf' = -`Xb' - ln(1+exp(-`Xb')) if $ML_y1==0
end
ml model lf mylogit (y=x1 x2)
ml maximize
Thank you all.
Costas