how to calculate Chi-squared 2x2 test (Fischer’s exact test, two-tailed) to get an p value using sas.
Basic
Proc freq data=have;
tables var1*var2 / chisq fisher;
run;
how to calculate for below data
(PERCENTAGES) | |||
A | 10 | 0 | 0 |
b | 16 | 31.16556 | 29.49382 |
c | 12.89 | 3.96325 | 12.35552 |
d | 33.42764 | 37.29058 | 28.69669 |
e | 31.25851 | 23.25707 | 24.27262 |
f | 3.353243 | 4.323545 | 5.181347 |
Total | 100 | 100 | 100 |
Chi-Square is for count data, you don't appear to have count data.
That is also NOT 2x2 data.
2000 | 2001 | 2002 | |
(PERCENTAGES) | |||
A | 0.104789 | 0 | 0 |
B | 29 | 31 | 29.9 |
c | 2. | 3 | 12.4 |
d | 33 | 37 | 28.7 |
e | 31 | 23 | 24.3 |
f | 3 | 4 | 5.2 |
Total | 100 | 100 | 100 |
i need to calculate 2000 vs 2001;2001vs 2002 ...
Do you have actual counts or possibly even better data with one record per observation?
You can get significantly different results comparing percentages when the percentages are the same but the group counts differ significantly.
this is the only data availble ....
Then you need to explain your question. You need the N's even if it's just the total and you back calculate the N based on percentages.
If you don't have N's you can calculate the variance and you can't do any tests.
There's a difference between tossing two coins and getting two heads versus tossing a coin 100 times and getting 100 heads.
|
2000-2005 | 2006-2010 |
C | 277 | 162 |
d | 898 | 448 |
for this type of p value, you want to calculate a Chi-squared 2x2 test (Fischer’s exact test, two-tailed). So for example, for C, you would do…
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.