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
Creating a table with percentilesHi, I am very new to Stata and I would like to create a table for 3 variables displaying certain per…
How can I use the command captureHey, I want to use command capture to gen the variable years for all my databases that dont have it …
Correlation between two variables for every time unitHello everyone, I am completely new to Stata and I am trying to run an analysis for my dissertation.…
Converting Composite Categorical Variables to Binary VariablesHi all, I'm new to Stata and am running into trouble with setting up a dataset for use. The issue …
Append ignoring different variable namesI have a big dataset that I need to append: Dataset1 and Dataset2. I need to append Dataset2 from Da…
Subscribe to:
Post Comments (Atom)
0 Response to 'invalid name' error in logit MLE program
Post a Comment