Announcement

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

  • programming a stata command to use the svy: prefix

    Does anyone know of a howto or an introduction to enabling a user-written command to accept the svy: prefix? I am mainly looking for programming syntax suggestions, not substantive issues of using survey weights and calculating heteroskedastic variances.

    I have read the section "Writing programs for use with svy" in the Stata .pdf manual entry [P] program properties. It says there that all programs using the svy: prefix must be eclass programs. I am creating a graphing command that first executes an estimation command which can accept the svy: prefix which I want to pass to it. Is it true that I cannot use the svy: prefix in this case (since I am not creating an eclass program - this is a graph, not an estimation, command)? Do I have to make do, for example, with an -svy- option for my command? That seems unfortunate.


    Thanks,
    John
    Last edited by John Gallup; 05 May 2018, 23:01.

  • #2
    You can look inside the asdoc ado file and see how I have done that.
    ssc install asdoc
    Regards
    --------------------------------------------------
    Attaullah Shah, PhD.
    Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
    FinTechProfessor.com
    https://asdocx.com
    Check out my asdoc program, which sends outputs to MS Word.
    For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

    Comment


    • #3
      Thanks, Attaullah. Of course! You can just use -syntax anything- and then use -gettoken- looking for ":". I was getting wrapped up in the -program ..., properties()- when using -svy:- before an estimation command, which is a different problem.

      Comment

      Working...
      X