Home  /  Resources & support  /  Users Group meetings  /  1999 UK Stata Users Group meeting  /  Replaying estimation results

Replaying estimation results

  • replay() function simplifies programming an estimation command to replay results
  • replay() returns 1 if the first non-blank character in `0' is a comma or if `0' is empty

    Note:option set 1 are options affecting how results are displayed. option set 2 are options affecting the estimation results themselves.
        program define mycmd6, eclass
            local options "option set 1"
            if replay() {
                if "`e(cmd)'" != "mycmd6" {
                    error 301
                }
                syntax [, `options']
            }
            else {
                syntax varlist [if] [in] [, `options' option set 2]
                   ...code performing estimation, setting estimation results, etc...
                estimates local cmd "mycmd6"
            }
        
                                            /* code to display or redisplay results */
            ...code omitted that outputs header table above coefficients...
            estimates display
        end