Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • An error "plugin not loaded or not available: use the adoonly option" accur after "ml maximize"

    I am trying to learn how to use mdraws by Cappellari and Jenkins.When replicating the example test_trial_dta_100.do,an error accuered after the step ml maximize. the code as blow: *! version 1.0.0 27apr2006 clear all set more off cap log close * cd d:\home\stephenj\MYProjects\cappellari\egen\plugin \sj3 // cd log using test_trial_dta_100.log,replace ********* test_trial_dta_100 ********************** * * Three binary outcomes, one of which is incidentally truncated * * 100 halton draws, with antithetics * ************************************************** * which _gmvnp which mdraws use trial ta lph20 flph20, missing // gets initial values quietly{ probit retent1 female eta eta2 mat b1 = get(_b) mat coleq b1 = retent1 // Reset column names of matrix probit lph20 female eta eta2 mat b2 = get(_b) mat coleq b2 = lph20 probit flph20 female eta eta2 mat b3 = get(_b) mat coleq b3 = flph20 mat b0 = b1, b2, b3 } ********************** * PLUGIN & antithetics ********************** set rmsg on //Return messages mdraws, dr(100) neq(3) prefix(z) burn(10) antithetics set rmsg off global dr = r(n_draws) capture program drop myll program define myll args lnf x1 x2 x3 c21 c31 c32 tempvar sp2 sp3 k1 k2 k3 quietly { gen double `k1' = 2*$ML_y1 - 1 gen double `k2' = 2*$ML_y2 - 1 gen double `k3' = 2*$ML_y3 - 1 tempname cf21 cf22 cf31 cf32 cf33 C1 C2 su `c21', meanonly scalar `cf21' = r(mean) su `c31', meanonly scalar `cf31' = r(mean) su `c32', meanonly scalar `cf32' = r(mean) // constraints on diagonal elements scalar `cf22' = sqrt( 1 - `cf21'^2 ) scalar `cf33' = sqrt( 1 - `cf31'^2 - `cf32'^2 ) mat `C1' = (1, 0 , 0 \ `cf21', `cf22', 0 \ `cf31' , `cf32' , `cf33') mat `C2' = (1, 0 \ `cf21', `cf22') egen `sp3' = mvnp(`x1' `x2' `x3') if $ML_y1==1, /// chol(`C1') dr($dr) prefix(z) signs(`k1' `k2' `k3') egen `sp2' = mvnp(`x1' `x2' ) if $ML_y1==0, /// chol(`C2') dr($dr) prefix(z) signs(`k1' `k2') replace `lnf'= ln(`sp3') if $ML_y1==1 replace `lnf'= ln(`sp2') if $ML_y1==0 } end ml model lf myll (retent1: retent1 = female eta eta2) /// (lph20: lph20 = female eta eta2) /// (flph20: flph20 = female eta eta2) /// /c21 /c31 /c32 /// , missing title("3-var probit, 1 selection, MSL, $dr Halton draws") ml init b0 set rmsg on ml maximize set rmsg off everything is fine until: . ml maximize plugin not loaded or not available: use the adoonly option
    Anyone can help me understand why this happen?Thanks a lot.
Working...
X