adjusted residuals?

Everything related to development of the jamovi platform
starcrossing
Posts: 7
Joined: Sat Apr 13, 2019 1:34 am

adjusted residuals?

Post by starcrossing »

Hello,
I was wondering if Jamovi can compute standardized/adjusted standardized residuals for post-hoc comparisons when running chi square tests?
If not, I think it would be a really useful feature to add. In my case (and I guess also in the case of many social science students who work mainly with categorical data) this is literally the only thing that is keeping me from switching from SPSS to jamovi for good.
Thanks,
Simona
User avatar
MAgojam
Posts: 421
Joined: Thu Jun 08, 2017 2:33 pm
Location: Parma (Italy)

Re: adjusted residuals?

Post by MAgojam »

Hi, Simona.
At the moment jamovi, does not yet satisfy your request, but surely he will do it in the near future.
Request #494 "Adjusted Residuals in chi-square tests" is still open, see here:
https://github.com/jamovi/jamovi/issues/494

When I need it, I use a little R code with the excellent Rj module.
Look at the screenshot I enclose, if it can help you.
ScreenShot.png
ScreenShot.png (136.52 KiB) Viewed 19397 times
Cheers,
Maurizio.
starcrossing
Posts: 7
Joined: Sat Apr 13, 2019 1:34 am

Re: adjusted residuals?

Post by starcrossing »

Dear Maurizio,
thank you very much for the reply, I'll check out the module you suggested.

Cheers,
Simona
andremonezi
Posts: 3
Joined: Thu Jun 13, 2019 1:57 pm

Re: adjusted residuals?

Post by andremonezi »

Dear all,

Did you conclude the development of this feature (standardized/adjusted standardized residuals).

Thank you
nas2782
Posts: 6
Joined: Sun Mar 27, 2022 9:20 pm

Re: adjusted residuals?

Post by nas2782 »

MAgojam wrote:Hi, Simona.
At the moment jamovi, does not yet satisfy your request, but surely he will do it in the near future.
Request #494 "Adjusted Residuals in chi-square tests" is still open, see

When I need it, I use a little R code with the excellent Rj module.
Look at the screenshot I enclose, if it can help you.
ScreenShot.png
Cheers,
Maurizio.
Hi Maurizio,

Would you be able to help out with adjusting this code if I were using summary data where each variable has its count as a separate column, rather than the code for raw data that you provided?

Thank you!
User avatar
MAgojam
Posts: 421
Joined: Thu Jun 08, 2017 2:33 pm
Location: Parma (Italy)

Re: adjusted residuals?

Post by MAgojam »

Hey @nas2782,
if i understand your request, this could be the suggestion with some line of code for Rj.
With the table of adjusted standardized residuals and the table of corrected p values Bonferroni.
Rj_chi2_ph.PNG
Rj_chi2_ph.PNG (124.77 KiB) Viewed 6053 times
Cheers,
Maurizio
nas2782
Posts: 6
Joined: Sun Mar 27, 2022 9:20 pm

Re: adjusted residuals?

Post by nas2782 »

Hi Maurizio,

sorry for the delay, this was very helpful thank you so much! As a follow up question, I was wondering if it were possible to use Rj to perform similar analyses (adjusted standardized residuals and corrected p values) once I add in layers into the contingency table. For these analyses I do have the raw data rather than counts if that eases things.

Thanks again!
User avatar
MAgojam
Posts: 421
Joined: Thu Jun 08, 2017 2:33 pm
Location: Parma (Italy)

Re: adjusted residuals?

Post by MAgojam »

Hi @nas2782,
it would be useful (for me better) if I could attach an .omv file with (invented) data similar to yours, so I can return it to you with Rj code suggesting a possible use for what you are looking for.

Cheers,
Maurizio
nas2782
Posts: 6
Joined: Sun Mar 27, 2022 9:20 pm

Re: adjusted residuals?

Post by nas2782 »

Hi Maurizio,

Please find the omv file attached.
data sample.omv
(38.73 KiB) Downloaded 211 times
Essentially, what I created was a contingency table where:
rows = year_grouped
columns = circumstance
layers = region

to compare the proportions of circumstances within different regions over time. in such contingency table, the chi squared gave p <0.001 for the south region, so I'd then like to do adjusted residuals within the south.

Hopefully that makes sense.

Really appreciate your help!
User avatar
MAgojam
Posts: 421
Joined: Thu Jun 08, 2017 2:33 pm
Location: Parma (Italy)

Re: adjusted residuals?

Post by MAgojam »

Hey @nas2782,
I am attaching your file with some code in Rj, which I hope is what you were looking for.

I may ask you, but if you are interested in understanding the relationship between all three of your categorical variables without one necessarily being the "response", haven't you thought about trying a loglinear model?

Cheers,
Maurizio
Rj_data_sample.omv
(40.55 KiB) Downloaded 238 times
Post Reply