Hi everyone,
I am working on a project where there is a need to develop a program (codes) to evaluate whether Chi Squared test or Fisher's Exact test is suitable for the tabulated variables (2x2 table).
For example, there are to categorical variable A and B. Both are binary.
I am thinking to first -tab a b, mis col expected- ; second if any expected value for any cell is <5, then do -tab a b, mis col exact-, otherwise do -tab a b, mis col chi-. Although having the thought in mind, I have a hard time to realize it in Stata code and could not find any relevant information on google.
Please accept my sincere appreciation on any thoughts/insights you would like to share with me.
Kindly regards,
Mengmeng
I am working on a project where there is a need to develop a program (codes) to evaluate whether Chi Squared test or Fisher's Exact test is suitable for the tabulated variables (2x2 table).
For example, there are to categorical variable A and B. Both are binary.
I am thinking to first -tab a b, mis col expected- ; second if any expected value for any cell is <5, then do -tab a b, mis col exact-, otherwise do -tab a b, mis col chi-. Although having the thought in mind, I have a hard time to realize it in Stata code and could not find any relevant information on google.
Please accept my sincere appreciation on any thoughts/insights you would like to share with me.
Kindly regards,
Mengmeng
Comment