Box Cox transformation

General help and assistance with jamovi. Bug reports can be made at our issues page: https://github.com/jamovi/jamovi/issues . (If you're unsure feel free to discuss it here)
Post Reply
Alpha
Posts: 5
Joined: Tue Dec 01, 2020 6:09 pm

Box Cox transformation

Post by Alpha »

Hi,
I'd like to run a Box Cox transformation in Jamovi, the BOXCOX function doesn't work unless I specify the lambda but is there a solution to make Jamovi calculate the lambda ?
Thanks a lot!
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Box Cox transformation

Post by jonathon »

could you double check you're using a recent version of jamovi. i'm pretty sure BOXCOX() will calculate the lambda for you if you don't specify it.

jonathon
Alpha
Posts: 5
Joined: Tue Dec 01, 2020 6:09 pm

Re: Box Cox transformation

Post by Alpha »

My bad, I tried on another dataset and it works without specifying the lambda.
However, it doesn't work on the dataset I'm currently working on, unless I specify a lambda higher or equal to 0, but this dataset contains a lot of 0 values. Could this be the reason why it doesn't work without specifying the lambda?
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Box Cox transformation

Post by jonathon »

try the (undocumented) function VBOXCOXLAMBDA() and see what lambda value is being calculated. this is what the BOXCOX function uses in the background.

jonathon
Alpha
Posts: 5
Joined: Tue Dec 01, 2020 6:09 pm

Re: Box Cox transformation

Post by Alpha »

I tried it but the cells stay empty
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Box Cox transformation

Post by jonathon »

this is the function we use:

https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.boxcox.html

does anything in the docs hint at what the problem could be?

jonathon
Alpha
Posts: 5
Joined: Tue Dec 01, 2020 6:09 pm

Re: Box Cox transformation

Post by Alpha »

Thanks for the link, at first I thought it might be because of the 0 values in my dataset but it doesn't seem to be the problem.
I've read that lambda can be negative but in the link you sent the box cox formulas are mentionned for lambda >0 or =0, and when I specify the lambda myself it works unless I specify a negative value. Would it be possible that the problem comes from the fact that the lambda for my values is negative and the function doesn't work with negative values for lambda ?
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Box Cox transformation

Post by jonathon »

at a guess, the scipy people would argue that boxcox is undefined for negative lambda values.

it looks as though it's a different transformation for negative data:

https://www.statisticshowto.com/box-cox-transformation/

either way, it looks as though we don't support negative lambda values, sorry.

jonathon
Alpha
Posts: 5
Joined: Tue Dec 01, 2020 6:09 pm

Re: Box Cox transformation

Post by Alpha »

Okay, thanks a lot for your time!!
Post Reply