Announcement

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

  • Merging multiple cross tabulations that use a common grouped variable

    Greetings. I'm trying to merge 4-5 cross tabulations, that use a common group variable as one of the 2 variables in the cross-tabs, into one table. Additional context -assume the framework is variable "A" with 3 categories forming the columns, while 4-5 other variables, also with 3-4 subcategories, form rows. Can this be created by a commands similar to "tab2," or is this better addressed via command series associated with program such as "tabout"?

  • #2
    You've yet to get an answer, and my guess is that while you know you want this is too abstract for many to understand. A concrete data example always beats a lengthy verbal explanation in which we're asked to imagine data. Please see the FAQ Advice, especially #12.

    Why not translate into an example using nlswork, which has several categorical variables? Here distinct is from the Stata Journal.

    Code:
    . webuse nlswork
    (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
    
    . distinct
    
    ---------------------------------
              |     total   distinct
    ----------+----------------------
       idcode |     28534       4711
         year |     28534         15
     birth_yr |     28534         14
          age |     28510         33
         race |     28534          3
          msp |     28518          2
      nev_mar |     28518          2
        grade |     28532         19
     collgrad |     28534          2
     not_smsa |     28526          2
       c_city |     28526          2
        south |     28526          2
     ind_code |     28193         12
     occ_code |     28413         13
        union |     19238          2
       wks_ue |     22830         61
      ttl_exp |     28534       4744
       tenure |     28101        270
        hours |     28467         85
     wks_work |     27831        105
      ln_wage |     28534       8173
    ---------------------------------
    groups (also Stata Journal) is a framework for cross-combinations of an arbitrary number of variables. https://www.statalist.org/forums/for...updated-on-ssc gives the flavour.

    I am very likely misreading what you want, which brings us back to the request for a concrete example.

    Comment


    • #3
      Thanks Professor! Upon second reading, I can see how the post is abstract to others. My apologies. However, I don't think you misread. The groups framework may do the trick. I will work with it and let you know how it goes.

      Comment

      Working...
      X