Page 1 of 1

BOXCOX transformation, empty cells for some variables

Posted: Wed Apr 20, 2022 7:53 am
by elvira
Hi,

I've seen this topic has been up before, but can't fix my issue through reading that earlier thread.

I'm trying to BOXCOX transform a couple of variables which are all pretty similar (no negative values, approx same amount of missing values, etc). Some of the variables get transformed, but some just turn all the cells empty. I'm not specifying the lamda, just using BOXCOX (variable). Anyone understanding why it works for some variables but not all of them?

Best,
Elvira

Re: BOXCOX transformation, empty cells for some variables

Posted: Wed Apr 20, 2022 9:48 am
by jonathon
attach a data set?

jonathon

Re: BOXCOX transformation, empty cells for some variables

Posted: Wed Apr 20, 2022 12:17 pm
by elvira
Attached it! Thank you so much for your help.
Reg_analyses.omv
Its the following variables the most to the right that the BOXCOX transformations doesnt work for: aU - Tran...; cF - Tran...; rF - Tran...; frust - Tran...; cyb - Tran....
(45.01 KiB) Downloaded 682 times

Re: BOXCOX transformation, empty cells for some variables

Posted: Tue Apr 26, 2022 1:11 am
by jonathon
hi,

sorry for the delay. i think these columns result in negative lambda values, for which boxcox is undefined.

jonathon

Re: BOXCOX transformation, empty cells for some variables

Posted: Wed Apr 27, 2022 6:11 am
by elvira
No worries. Thanks for getting back, that makes sense.

Elvira

Re: BOXCOX transformation, empty cells for some variables

Posted: Thu Apr 20, 2023 5:12 pm
by mlevenston
Following up on this earlier thread, I believe that this is an error in the Jamovi implementation. The Box-Cox transformation is undefined for negative data, but negative lambda values are allowed (lambda=-1 is an inverse transformation, etc.) and boxcox() in R has no problem with negative lambdas.

A user workaround is to create a new transformation using the Box-Cox formula:
($source^VBOXCOXLAMBDA($source)-1)/VBOXCOXLAMBDA($source)

This gives the same result as BOXCOX for positive lambdas, but also works for negative lambdas.

This appears to be a bug, it would be great if this could be addressed in a future update.

Re: BOXCOX transformation, empty cells for some variables

Posted: Wed Apr 26, 2023 6:27 am
by jonathon
does this look like an appropriate fix?

https://github.com/jamovi/jamovi/pull/1341/files

with thanks

Re: BOXCOX transformation, empty cells for some variables

Posted: Tue May 30, 2023 7:42 am
by acbgacbg
Hi! I'm experiencing the same problem where BOXCOX turns up empty for my variables. I've tried the alternative workaround posted above but it still doesn't work, the results are still blank. Any way to fix this? Thanks!

Re: BOXCOX transformation, empty cells for some variables

Posted: Sat Sep 30, 2023 2:41 pm
by sandro98
jonathon wrote: Wed Apr 26, 2023 6:27 am does this look like an appropriate fix?

https://github.com/jamovi/jamovi/pull/1341/files

with thanks
Hi! how can i add this link/file and run it on jamovi?

Re: BOXCOX transformation, empty cells for some variables

Posted: Sat Sep 30, 2023 10:06 pm
by jonathon
this has been incorporated into the latest versions of jamovi.

jonathon