Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello guys,
I have been trying to show the result of chi-square test through R in Power BI.
"R script visual" didn't work and "Run R script" in "Edit Queries" didn't work either.
I searched online but I couldn't find any solution regarding this issue.
Could anyone please help me on this?
Thank you so much!
My 3 x 3 contingency table is like the following:
Asia Africa America
Disease A 31 14 45
Disease B 2 5 53
Disease C 53 45 2
Hi @WilliamT ,
Can you show your code so we can understand better of your issue?
Is your data just a 3x3 table in Power BI?
Thanks,
JC
@Anonymous
Thank you for your reply.
I grouped and unpivoted to a 3x3 contingency table in Power BI.
And my script at that point was just "chisq.test(dataset)" using R script.
But no error was shown but no result was shown either.
Thanks,
So you are getting empty space in the R visual after pressing "Run Script"?
Did you use any plot function to generate a graph/visual?
@Anonymous
Yes, I got an empty table after "Run Script" without any error message.
And I didn't use plot function since the result of chi square is something like :
"Pearson's Chi-squared test
X-squared = 2.0396, df = 1, p-value = 0.1533"
And the p-value above is the value I need for independence test.
Thank you!
User | Count |
---|---|
124 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
137 | |
116 | |
102 | |
71 | |
61 |