Announcement

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

  • Merging and Exporting Tables from Panel and Cross-Section Data in Stata

    Hello Stata Community,

    I am working with two different types of data frames in Stata: a panel dataset and a cross-sectional dataset. My goal is to create an identical table from each dataset and then merge these tables. The command I am using for each dataset is:
    Code:
    table digits (variable change_type), stat(mean data) nototal
    After generating these tables, I need to merge them by the profession code (the 'digits' variable) and export them. Any ideas on the best approach to do this ?

    Additionally, I am interested in enhancing the presentation of the final table. Specifically, I would like the first column to be divided into two sub-columns: one displaying the profession code digits and the other showing the label corresponding to each code. is it possible to do it, if so how might I do this?

    Thank you

  • #2
    Hi Walid,

    Without an example table or example data it's hard to picture your objective, but it sounds like what you want can be created using the customizable tables suite of commands, collect. The Stata manual contains an example that sounds very close to what you want: https://www.stata.com/manuals/tables.pdf#tablesExample6. With some time and effort, you should be able to modify this example to get what you want.

    Comment

    Working...
    X