Skip to main content

reset_test

Function reset_test 

Source
pub fn reset_test(
    y_json: &str,
    x_vars_json: &str,
    powers_json: &str,
    type_: &str,
) -> String
Expand description

Performs the RESET test for model specification error via WASM.

The RESET (Regression Specification Error Test) test checks whether the model is correctly specified by testing if additional terms (powers of fitted values, regressors, or first principal component) significantly improve the model fit.

§Arguments

  • y_json - JSON array of response variable values
  • x_vars_json - JSON array of predictor arrays
  • powers_json - JSON array of powers to use (e.g., [2, 3] for ŷ², ŷ³)
  • type_ - Type of terms to add: “fitted”, “regressor”, or “princomp”

§Returns

JSON string containing the F-statistic, p-value, and interpretation.

§Errors

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