dot-fit.chisq: Pearson's Chi-squared test for 'tidyfit'

.fit.chisqR Documentation

Pearson's Chi-squared test for tidyfit

Description

Calculates Pearson's Chi-squared test on a 'tidyFit' R6 class. The function can be used with classify.

Usage

## S3 method for class 'chisq'
.fit(self, data = NULL)

Arguments

self

a 'tidyFit' R6 class.

data

a data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr).

Details

Hyperparameters:

None. Cross validation not applicable.

Important method arguments (passed to m)

The function provides a wrapper for stats::chisq.test. See ?chisq.test for more details.

Implementation

Results can be viewed using coef.

Value

A fitted 'tidyFit' class model.

Author(s)

Johann Pfitzinger

See Also

.fit.cor and m methods

Examples

# Load data
data <- tidyfit::Factor_Industry_Returns
data <- dplyr::mutate_at(data, dplyr::vars(-Date, -Industry), dplyr::ntile, n = 10)

# Within 'classify' function
fit <- classify(data, Return ~ ., m("chisq"), .mask = c("Date", "Industry"))
tidyr::unnest(coef(fit), model_info)


tidyfit documentation built on Oct. 3, 2024, 5:06 p.m.