SOCR / SOCRAT-issues

Project management for SOCRAT
2 stars 0 forks source link

Power Analysis: reimplement chi-squre with visualization #238

Open bradyzhu1102 opened 6 years ago

bradyzhu1102 commented 6 years ago

https://onlinecourses.science.psu.edu/statprogram/node/158 Test the independence of two categorical variables H0: the two categorical variables are independent H1: the two categorical variables are dependent

χ2=∑(O−E)^2/E O represents the observed frequency. E is the expected frequency under the null hypothesis and computed by E = (rowTotal x colTotl)/Sample Size

We will compare the value of the test statistic to the critical value of χ2α with degree of freedom = (r - 1) (c - 1), and reject the null hypothesis if χ2>χ2α.

Challenge: How to make sure that CSV file is a contingency table

bradyzhu1102 commented 6 years ago

Solution1: Chi-square for non-data driven mode only. Manually specify necessary statistics to calculate power

Manual Input Needed: w = effect size N = total number of observations df = degree of freedom alpha = significance level power = power

Note: one of (w, N, power) must be the target for calculation

bradyzhu1102 commented 6 years ago

img_0643 An updated scratch on Chi-Square test