BOXCOX transformation, empty cells for some variables

Discuss statistics related things
Post Reply
elvira
Posts: 3
Joined: Wed Apr 20, 2022 7:47 am

BOXCOX transformation, empty cells for some variables

Post 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
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: BOXCOX transformation, empty cells for some variables

Post by jonathon »

attach a data set?

jonathon
elvira
Posts: 3
Joined: Wed Apr 20, 2022 7:47 am

Re: BOXCOX transformation, empty cells for some variables

Post 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 268 times
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: BOXCOX transformation, empty cells for some variables

Post by jonathon »

hi,

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

jonathon
elvira
Posts: 3
Joined: Wed Apr 20, 2022 7:47 am

Re: BOXCOX transformation, empty cells for some variables

Post by elvira »

No worries. Thanks for getting back, that makes sense.

Elvira
mlevenston
Posts: 4
Joined: Fri Jun 18, 2021 9:16 pm

Re: BOXCOX transformation, empty cells for some variables

Post 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.
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: BOXCOX transformation, empty cells for some variables

Post by jonathon »

does this look like an appropriate fix?

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

with thanks
acbgacbg
Posts: 1
Joined: Tue May 30, 2023 7:38 am

Re: BOXCOX transformation, empty cells for some variables

Post 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!
sandro98
Posts: 1
Joined: Sat Sep 30, 2023 2:39 pm

Re: BOXCOX transformation, empty cells for some variables

Post 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?
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: BOXCOX transformation, empty cells for some variables

Post by jonathon »

this has been incorporated into the latest versions of jamovi.

jonathon
Post Reply