2022년 11월 12일 토요일

ch.10 Chi-squared test

 easier R than SPSS with Rcmdr : Contents

 

ch.10 Chi-squared test


Let’s call the data ‘Arrests’.

 

There are many variables. Some are numeric variables, some are character variables.

Under ‘Original menu’, select ‘Two-way table’.

 

Select the nominal variables ‘employed’ and ‘released’.

Earlier we dealt with t-test and ANOVA and their nonparametric tests, and now we learn about chi-square tests for completely different nominal variables. The difference between the t-test and the ANOVA and their nonparametric tests was one nominal variable (group variable) and one continuous variable (numeric variable), and this time in the chi-square test both are nominal variables.

 

 On the ‘Statistics’ tab, select ‘Chi-squar e test~’ and ‘Fisher’s exact test’.

 

The Frequency table summarizes the material. You will see the results of the ‘Chi-squared test’ and ‘Fisher’s exact test’, below which you will see the odds ratio and its 95% confidence interval. Along with the value of p, these are also important.

 

 

Let’s do the other menu as well. It seems there are more options, but it’s essentially the same as the ‘Original menu’.

‘Pearson’s Chi-squared test with Yates’ continuity correction’ is called ‘Pearson’s Chi-squared test with X-squared = 201.54. In the previous menu, X-squared = 202.82, which is a bit different. If you do a continuity correction made by a man named ‘Yates’, X-squared value will always be a little smaller, and the p value will always be a little larger. And as the number of samples becomes more and more, the difference becomes very small.

The ‘Chi-squared test’ is basically created with the assumption of a large sample. ‘Fisher’s exact test’ can be used in both small and large samples, but the larger samples are, the more complex the calculation becomes, making it more suitable for small samples. Continuity correction brings the value of ‘Chi-squared test’ closer to the that of ‘Fisher’s exact test’. In any case, when it becomes a large sample, the p values will all be close.

The graph that fits the ‘Chi-squared test’ is a bar graph.

 

 

Select both variables in a similar way. It is recommended that you select the variable that causes you first, and then select the resulting variable later. If you look at the graph, you can see that there are more ‘released’ in the group where ‘employed’ is Yes.


If you change it to Percentage, the ratio shows that Yes is close to 90% in the group where employed is Yes, and around 70% in the group where No. 


 

If you select ‘side by side’, the sticks will appear side by side.


 

If you select ‘total’, the area of the bar will be proportional to the total number. Learn the different options by implementing them yourself.

If you already have a summary of the material, you can choose a different approach.

 

First, decide how many horizontal and vertical blanks you want to make (red square) and then enter a number (green square). Next, select the statistical test method (blue square). Very simple.


 

You can get the same result as we saw earlier.

 


easier R than SPSS with Rcmdr : Contents

=================================================

  • R data visualization book 2
https://tinyurl.com/R-plot-II-2  simple variables
https://tinyurl.com/R-plot-II-3-4   many variables / map
https://tinyurl.com/R-plot-II-5-6   time related / statistics related
https://tinyurl.com/R-plot-II-7-8   others / reactive chart 
 

 

댓글 없음:

댓글 쓰기