ApplyLinearModel()

Summary

Computes a value for each row in a dataview and selection set by applying a set of user-provided coefficients to a list of independent fields. It optionally transforms the result based on the chosen method (regression, binary logit, or integer logit) and stores the output in the specified dependent field. The function can also export results to a report file.

Changes

Added to Version 2025

Syntax

ApplyLinearModel(array opts)

Argument Contents
Input.Zone Set The name of the view and selection set containing the data to be processed.
Global.Output to Report File Determines whether the function’s results are written to a report file (1 = Yes, 0 = No).
Global.Method Specifies the modeling method or transformation:
R = Regression (use linear predictor),
B = Binary Logit (logistic transformation),
I = Integer Logit (integer-based logistic).
Global.Coefficients An array of coefficients, where the first element is the constant term, and subsequent elements correspond to each independent field.
Field.Dependent The field name (or specification) where the computed values are stored.
Field.Independents An array specifying the independent fields used in the model, in the same order as the coefficients (after the constant).

Example

opts= null
opts.Input.[Zone Set] = "My Customers Layer|"
opts.Global.Method = "R"
opts.Global.[Output to Report File] = 0
opts.Global.Coefficients = {1,2,3}
opts.Field.Dependent = "My Customers Layer.QTR1.Data"
opts.Field.Independent ={"My Customers Layer.QTR1 Sales" , "My Customers Layer.QTR2 Sales"}

See Also

Function Summary
AppendToLogFileWithLimit() Appends text to the log file while respecting a message limit
GetLogFileName() Gets the name of the log file
ResetLogFile() Empties the log file

 

©2026 Caliper Corporation