How to calculate cube roots for negative values in Spotfire Statistica spreadsheets

book

Article ID: KB0138749

calendar_today

Updated On:

Products Versions
Spotfire Statistica 14.4

Description

In Statistica spreadsheets, directly using the x^(1/3) expression to calculate the cube root of a variable does not function correctly when the variable's value is negative. This occurs because the underlying Basic language, used in Statistica, treats a negative base with a fractional exponent as an error. For example, (-8)^(1/3) will fail instead of yielding the correct real cube root of -2. The real cube root is defined for negative numbers, requiring a sign-preserving form for accurate calculation.

Environment

OS:  Windows

Resolution

To correctly calculate the cube root for both positive and negative variable values in a Statistica spreadsheet, use the following expression:


= Sign(evaporation) * (Abs(evaporation) ^ (1 / 3))


Replace evaporation with the actual variable or cell reference for which you want to calculate the cube root. This formula preserves the sign of the original number while calculating the cube root of its absolute value, ensuring accurate results for all real numbers.

 

image.png

Issue/Introduction

This article provides the correct spreadsheet expression to calculate the cube root of variables in Statistica, addressing an issue where the standard x^(1/3) expression fails for negative numbers.