Chi-Squared Testing for Independence in R
HTML-код
- Опубликовано: 21 авг 2024
- Let's learn how to use the chisq.test() function in R to check the independence of categorical variables.
If this vid helps you, please help me a tiny bit by mashing that 'like' button. For more #rstats joy, crush that 'subscribe' button!
Clear and concise -- thanks
Great video! I am wondering how you would interpret the results of the chi-square using this specific example?
Thanks! In this example, the p-value is very small, so it's likely that these categorical variables are associated (ie, not independent). Here's a vid about the test itself: ruclips.net/video/tnmmCFv63s8/видео.html
Thank you!
amazing !
Thanks for you video! But how to do chi square test with multiple covariants?
Hello! Thank you so much for this its really clear and helpful!
so i was wondering, lets say i want to know if 5 kinds of animals randomly locate in 5 places or they are associated with the crops, I do this test and get a p-value, can i pairwise and continue see what exact crop associate with the carcasses? I dont know whether the pairwise is for independence test or for homogeneity test
Hi ,
I like all your videos they all are so informative and easy to understand .
I have a question if I need to draw a histogram of number of day and days categorized in three groups, how can we do so?
Hi! This should get you started: ruclips.net/video/FAvESE3WC30/видео.html
Thank you for your great video! But you would you calculate post-hoc analysis here? :)
Yes! I’m working on this vid now. Hopefully I’ll be able to post it within the month.
@@EquitableEquations that sounds great! Thank you very much. :)
Thank you for the video. What about the adjusted residuals? Is there a way to calculate that in R?
model$stdres will give you standardized residuals, but chisq.test doesn't include adjusted ones. Sigh.
@@EquitableEquations Interesting. I calculated the adjusted residual manually and got the same results as model$stdres in R.
I want to add an important point here. From R documentation, model$residuals is a Pearson residuals = (observed - expected) / sqrt (expected). model$stdres = (observed - expected) / sqrt (V), where V is "the standard error, SE" = expected*(1- row total) * (1-column total), and that "model$stdres" gives us the adjusted residuals.
THANK YOU! I followed through with everything you did in the video. when i ran the test for my research paper i got a message saying "Warning message:
In chisq.test(volunteers): Chi-squared approximation may be incorrect", what caused it? is there a way I can fix this? please help.
Hi! This warning comes up when at least one expected cell counts is very small, potentially making the chi-squared approximation inaccurate. Often it's ok to ignore this warning, but in more extreme cases you'd want to switch to the Fisher exact test.
@@EquitableEquations Makes sense. Thank you
how do we proceed if the sample size for "Type of volunteer" is different in each case and the available data is in percent form ?
Very interesting. I tried this for the dataset mydat
Depends whether you want the continuity correction or not, lol. There's a reason the default is TRUE ;-) Anyhow the numbers are usually very close to one another.
@@EquitableEquations Thanks for the response. My teachers was showing us how to do it by hand in an excel sheet and in order for the answers to lign-up I had to change correct to false. Aced the course though.
why there no "volunteer" option when i type in my rstudio?