POLY_MODEL-cash-test: Test the null model

POLY_MODEL$testR Documentation

Test the null model

Description

This function test the null model. In this class, the test is either a F-test computed using stats::anova or a RESET test computed using lmtest::resettest.

Arguments

dat

Data frame. A data frame containing all variables needed by the null_formula.

null_formula

Formula. Formula for fitting the null model. Default is null_formula = self$null_formula.

alt_formula

Formula. Formula for fitting the alternative model. Only used in F-test. Default is alt_formula = self$alt_formula.

test

Character. A string representing the test. Either "F" or "RESET".

power

Integer. A vector of integers representing the power of the variables that should be included. Only used in RESET test. Default is 2:3.

power_type

Character. Argument passed to lmtest::resettest. "fitted", "regressor" or "princomp". Only used in RESET test. Default is "fitted".

Value

A list containing the test name, the test statistic and the p-value.

Examples


# Instantiate
mod <- poly_model(shape = 2, sigma = 0.5)

mod

dat <- mod$gen(100000)

# F-test
mod$test(dat, test = "F")

# RESET test
mod$test(dat, test = "RESET", power = 2:4)

TengMCing/visage documentation built on Aug. 28, 2024, 3:27 p.m.