Announcement

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

  • tabout with mix of labeled and non-labeled values

    Hi everyone.

    I need to one-way tabulate a large number of variables, so I thought I would use a combination of foreach and tabout.

    However, some of the variables have value lables, other do not, while some have a combination (e.g. 0 is labeled as "none", but the rest of the numbers are not labeled).

    The output for tabout shows the values ONLY if they have labels. Is there a way to make it show labels if they exist and actual values in the absence of labels?

    Alternatively, can I do this using a different command? All I want is to have the results of the tabulations (and maybe means and medians for some other variables) in an Excel file and not copy paste hundreds of times.

    Thank you so much for any advice.

    Laura
    Regards,
    Laura Cojocaru

  • #2
    I thought this was what tab1 did. Also check out tabstat.

    Comment


    • #3
      Thank you very much for the reply.

      Of course, I am aware of tabstat and tab1 but I did not think the results could be written into an Excel file? Can they? Am I missing something obvious in the tabstat and tab1 descriptions?

      If the results are only displayed on the screen, copy-pasting all at once messes the format too much, and copy-pasting one by one is too time consuming for several hundred variables.
      Regards,
      Laura Cojocaru

      Comment


      • #4
        It's not the sort of thing I do, but in general individual Stata commands of this kind are not documented in terms of how to export their results anywhere outside Stata. So, absence of comment doesn't mean absence of feature.

        A possibility often neglected is to collapse or contract the dataset to another and then export that as a dataset.

        Others should be able to give more guidance on copying to MS Excel.

        tabout is a user-written program from SSC.

        Comment


        • #5
          Thank you.

          I searched some more and I found a solution to at least the one way tabulation problem.

          In case, someone else needs it: ssc install fre

          It creates a decently looking Excel file, which for my purpose is just fine.

          I need to search some more for mean/median exports but I suspect that should be easily available.

          Thanks again, Mr. Cox.
          Regards,
          Laura Cojocaru

          Comment

          Working...
          X