Regression Modeling with a logarithmic term

Regression Modeling with a logarithmic term

book

Article ID: KB0078818

calendar_today

Updated On:

Products Versions
Spotfire Analyst All supported versions

Description

If a linear regression model (generated using "Tools > Linear Regression..") contains a "log(x)" term, which of the functions in the Spotfire expression language should be used when building a calculated column that uses this logarithmic term?

Issue/Introduction

If a linear regression model (generated using "Tools > Linear Regression..") contains a "log(x)" term, which of the functions in the Spotfire expression language should be used when building a calculated column that uses this logarithmic term?

Environment

All supported environments

Resolution

When a linear regression model contains a "log(x)" term, the Spotfire expression language's "Ln()" function should be used in generating a calculated column that uses this logarithmic term.

Explanation:

In the background, the "Tools > Linear Regression..." feature in the Spotfire desktop client's main menu is implemented using a Spotfire data function that calls the Spotfire desktop client's built-in TIBCO Enterprise Runtime for R (TERR) statistical engine. In TERR, the log() function is the natural logarithm, the log10() function is the base-10 logarithm, and the logb() function is the user-defined-base logarithm, as shown in the following examples.

>
> log( 10 )
[1] 2.302585
>
>
> log10( 10 )
[1] 1
>
>
> logb( 10, 2 )
[1] 3.321928
>

In the expression language used for calculated columns in Spotfire itself, the corresponding functions are Ln() for the natural logarithm, Log10() for the base-10 logarithm, and Log() for the user-defined-base logarithm. If the natural logarithm of the [x] column was used in the model (using TERR's log() function), the calculated column must also use the natural logarithm of the [x] column (using Spotfire's Ln() function).