Stata: Data Analysis and Statistical Software
   >> Home >> Resources & support >> ser Group Meetings >> 5th K meeting

Writing extensions to predict, continued

  • usage: _pred_se "options your extension will handle" `0'
  • _pred_se returned results:
    s(done)  _pred_se handled a standard case
    s(varn)  name of new variable to generate
    s(typ)  datatype of new variable to generate
    s(rest)  command line for custom predictor to parse

  • Example:
           program define mycmd6_p
               local myopts "new-predict-options"
               _pred_se "`myopts'" `0'
               if `s(done)' { exit }
               local vtyp `s(typ)'
               local varn `s(varn)'
               local 0    `"`s(rest)'"'
               syntax [if] [in] [, `myopts' noOFFset]
               ...
           end
    
  • mycmd6_p must handle default case of no options specified
  • mycmd6_p also handles cases when one of the options in `myopts' is specified
Bookmark and Share 
Meetings
Stata Conference
User Group meetings
Proceedings
Like us on Facebook Follow us on Twitter Follow us on LinkedIn
Follow us
© Copyright 1996–2012 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index   |   View mobile site