| .fit.chisq | R Documentation |
tidyfitCalculates Pearson's Chi-squared test on a 'tidyFit' R6 class. The function can be used with classify.
## S3 method for class 'chisq'
.fit(self, data = NULL)
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). |
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.
A fitted 'tidyFit' class model.
Johann Pfitzinger
.fit.cor and m methods
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.