rainbow_test

Function rainbow_test 

Source
pub fn rainbow_test(
    y_json: &str,
    x_vars_json: &str,
    fraction: f64,
    method: &str,
) -> String
Expand description

Performs the Rainbow test for linearity via WASM.

The Rainbow test checks whether the relationship between predictors and response is linear. A significant p-value suggests non-linearity.

§Arguments

  • y_json - JSON array of response variable values
  • x_vars_json - JSON array of predictor arrays
  • fraction - Fraction of data to use in the central subset (0.0 to 1.0, typically 0.5)
  • method - Method to use: “r”, “python”, or “both” (case-insensitive, defaults to “r”)

§Returns

JSON string containing test statistic, p-value, and interpretation.

§Errors

Returns a JSON error object if parsing fails or domain check fails.