Announcement

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

  • How to run Multiple Chisquare test

    I am running many nxr table with a single outcome, how do I compress the syntax instead of running it one by one e.g tab vi v2, chi2, tab v3 v2, chi2, tab v4 v2, chi2. Will it be possible to include exact syntax?

  • #2
    Just a loop, I guess

    Code:
    foreach j in 1 3 4 { 
          tab v2 v`j', chi2
    }

    Comment


    • #3
      Nick Cox , thank you. It worked. One more thing, there are some of them with fewer cell count. How do I include in the code to discriminate between chi2 and fisher exact. Thank you.

      Comment


      • #4
        You need either to specify both options or a rule to decide which you want.

        Comment

        Working...
        X