.fit.chisq {tidyfit} | R 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
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)
[Package tidyfit version 0.7.1 Index]