Announcement

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

  • Cross tab analysis with three variables

    I have a question regarding cross tab analysis: is it possible to run a cross-tab analysis with three variables? As when I try to list three variables I keep getting feedback that there are "too many variables specified", is there any way to avoid this?

  • #2
    Code:
    bysort a: tab2 b c

    Comment


    • #3
      it is not clear what you want such a table to look like; a different option is to use the -table- command with either supercol or superrow; see the help file

      Comment


      • #4
        It's a little bit of work but what about the following:
        Code:
        sysuse auto, clear
        gen mpgdum=.
        replace mpgdum=0 if mpg<=22.1
        replace mpgdum=1 if mpg> 22.1
        
        levelsof rep78
        
        foreach i of numlist `r(levels)' {
          tab mpgdum for if rep78==`i', chi col nofreq
        }
        Here, rep78 is the control variable.

        Best,
        Alan

        Comment


        • #5
          Rich, Alan:
          I think "Margarethsa"s question is as simple as the answer I gave in post #2.

          Margarethsa:
          If an answer is satisfactory, it is a good habit to close the thread by telling it. Please also note this forum's preference for participants' full real names.

          Comment

          Working...
          X