Dear Statalist users,

I am trying to write a code in order to estimate a linear regression with boostrapped maximum likelihood estimator like this:
Code:
program lfols_lf
             args lnf lnsigma
             local y "$ML_y1"
             replace `lnf' = ln(normalden(`y', `xb',exp(`lnsigma')))
end

program  lfols
    syntax varlist
    gettoken y rhs : varlist
    ml model lf lfols_lf (`y'=`rhs')
    ml max
end

bootstrap _b: lfols y x1 x2 x3
I would like to know where the errors are.

Many thanks in advance for your reply.

Best ,
Emna