If anyone can help it would be great. I'm trying to do a logistic MLE. I've written an ado with the log-likelihood function, but it keeps giving me an 'invalid name' error. Here's my program:
program mylogit_lf
version 15.0
args lnf xb
quietly replace 'lnf' = ln(invlogit( 'xb')) if $ML_y1 == 1
quietly replace 'lnf' = ln(invlogit(-'xb')) if $ML_y1 == 0
end
Here's the error after ml check:
------------------------------------------------------------------------------
-> mylogit_lf __000008 __000009
- `begin'
= capture noisily version 15: mylogit_lf __000008 __000009
---------------------------------------------------------------------------- begin mylogit_lf ---
- version 15.0
- args lnf xb
- quietly replace 'lnf' = ln(invlogit( 'xb')) if $ML_y1 == 1
= quietly replace 'lnf' = ln(invlogit( 'xb')) if FO_label == 1
' invalid name
------------------------------------------------------------------------------ end mylogit_lf ---
- `end'
= set trace off
------------------------------------------------------------------------------
I've tried with another more complicated program using the args -> tempvar -> gen double -> replace format, but this gives me the same error.
Some one please help?
Related Posts with 'invalid name' error in logit MLE program
Issue Installing PyStataHello! I'm launching Stata from Jupyter notebook (using Anaconda) on a Mac. I'm following this guid…
Year and Industry Fixed Effects in Cross-sectional logit regressionHi Everyone, I would appreciate your help on the below: I am using Stata 17. I have a cross-sectiona…
Creating different variables for firm-yearHi Statlist community, I have a dataset where I have different institutional investors for each yea…
Options starting with "no" doesn't work, bug or feature?I am defining a program that has non-required options. When the option starts with "no", it doesn't …
Options starting with "no" doesn't work, bug or feature?I am defining a program that has non-required options. When the option starts with "no", it doesn't …
Subscribe to:
Post Comments (Atom)
0 Response to 'invalid name' error in logit MLE program
Post a Comment