Description Usage Arguments Value Author(s) Examples
These functions are intended to compute from a cont_table
objects
covariation statistics, ie the covariance, the correlation
coefficient, variance decomposition and regression line.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | covariance(data, ...)
correlation(data, ...)
## S3 method for class 'cont_table'
covariance(data, ...)
## S3 method for class 'cont_table'
correlation(data, ...)
## S3 method for class 'cont_table'
anova(object, x, ...)
## S3 method for class 'anova.cont_table'
summary(object, ...)
regline(formula, data)
|
data, object |
a |
... |
further arguments. |
x |
the series for which the analyse of variance should be computed, |
formula |
symbolic description of the model, |
a numeric or a tibble
Yves Croissant
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # the covariance and the linear correlation coefficient are
# computed using only the `cont_table`
# First reduce the number of bins
wages2 <- wages %>%
dplyr::mutate(size = cut(as_bin(size), c(20, 50, 100)),
wage = cut(as_bin(wage), c(10, 30, 50)))
wages2 %>% cont_table(wage, size) %>% covariance
wages2 %>% cont_table(wage, size) %>% correlation
# For the analyse of variance, one of the two series should be
# indicated
wages2 %>% cont_table(wage, size) %>% anova(wage)
wages2 %>% cont_table(wage, size) %>% anova(wage) %>% summary
# For the regression line, a formula should be provided
wages2 %>% cont_table(wage, size) %>% regline(formula = wage ~ size)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.