Announcement

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

  • putexcel with svy tables

    I love putexcel, but I'm stumped on this one.

    I'm running a one-way table with svy: tabulate. Below are the related scalars, macros, and matrices.

    I can get the proportions into Excel (e(b)).

    Problem: I can't figure out how to get my row label into Excel (e(rowvlab)

    Tried:

    putexcel A2 = e(rowvlab)
    putexcel A2 = `e(rowvlab)"
    putexcel A2 = matrix(e(rowvlab))
    putexcel A2 = macro(e(rowvlab))



    Read manual, Googled a bit, searched form. Also read Chucks great 3-part blog post on putexcel, but I haven't been able to find reference on how to grab var labels. I suppose I could try grabbing them from an unweighted tab of the same var. Anywhere else they're stored I can grab from?


    Thanks!

    . ereturn list

    scalars:
    e(df_r) = 7403
    e(N_strata_omit) = 0
    e(singleton) = 0
    e(census) = 0
    e(stages) = 1
    e(N) = 7404
    e(N_strata) = 1
    e(N_psu) = 7404
    e(N_pop) = 4425894.999999999
    e(r) = 2
    e(c) = 1
    e(total) = 4425894.999999999
    e(mgdeff) = .
    e(cvgdeff) = .
    e(rank) = 1

    macros:
    e(cmdline) : "svy : tabulate j18_rec mode"
    e(cmd) : "tabulate"
    e(prefix) : "svy"
    e(cmdname) : "tabulate"
    e(marginsnotok) : "_ALL"
    e(estat_cmd) : "svy_estat"
    e(collab) : "label"
    e(colvlab) : "Survey Mode:"
    e(colvar) : "mode"
    e(rowvlab) : "Income (Recode)"
    e(rowvar) : "j18_rec"
    e(setype) : "cell"
    e(vcetype) : "Linearized"
    e(vce) : "linearized"
    e(wtype) : "pweight"
    e(wvar) : "finalwt_abs"
    e(wexp) : "= finalwt_abs"
    e(singleunit) : "missing"
    e(properties) : "b V"

    matrices:
    e(b) : 1 x 2
    e(V) : 2 x 2
    e(V_srs_col) : 1 x 1
    e(Deft_col) : 1 x 1
    e(Deff_col) : 1 x 1
    e(V_srs_row) : 2 x 2
    e(Deft_row) : 1 x 2
    e(Deff_row) : 1 x 2
    e(V_srs) : 2 x 2
    e(Deft) : 1 x 2
    e(Deff) : 1 x 2
    e(V_col) : 1 x 1
    e(V_row) : 2 x 2
    e(Col) : 1 x 1
    e(Row) : 1 x 2
    e(Prop) : 2 x 1
    e(Obs) : 2 x 1
    e(_N_strata_certain) : 1 x 1
    e(_N_strata_single) : 1 x 1
    e(_N_strata) : 1 x 1
    ****************************
    Survey Methodologist
    California Health Interview Survey

  • #2
    Seems they are not available in e() or r(). You can use the extended macro function to get the variable and value labels. For those interested, asdocx can export variable and value labels of tab and other commands to Excel.
    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 Attullah!
      ****************************
      Survey Methodologist
      California Health Interview Survey

      Comment

      Working...
      X