Hi All:

I am new to ml command. Before writing a more complicated code, I am testing the code on logit panel data first.

I first reshape my long format into wide format. I have six waves.

The following is my code:
Code:
 program define mylogit

    args        lnf    b1_w1 b1_w2 b1_w3 b1_w4 b1_w5 xb1_w6 

    quietly replace `inf' =    y3*ln(invlogit(`b1_w1')+(1-y3)*ln(invlogit(-`b1_w1')+y4*ln(invlogit(`b1_w2')+(1-y4)*ln(invlogit(-`b1_w2')+y5*ln(invlogit(`b1_w3')+(1-y5)*ln(invlogit(-`b1_w3')+y6*ln(invlogit(`b1_w4')+(1-y6)*ln(invlogit(-`b1_w4')+y7*ln(invlogit(`b1_w5')+(1-y7)*ln(invlogit(-`b1_w5')+y8*ln(invlogit(`b1_w6')+(1-y8)*ln(invlogit(-`b1_w6')

end 
ml model lf mylogit (xb1_w1: $xvar1) (xb1_w2: $xvar2) (xb1_w3: $xvar3) (xb1_w4: $xvar4) (xb1_w5: $xvar5) (xb1_w6: $xvar6) 
ml maximize
When I ran it, it shows 'varlist required' in 'inf' function.

However, I could not figure out where the problem is.

Anyone who can help me to point out where the issue is?

Many thanks,

Connie