Runs linearity tests for multi-level ordered categories.
run_linearity_tests.RdRuns linearity tests for multi-level ordered categories.
Examples
lin <- run_linearity_tests()
#> Testing linearity for: age
#> Testing linearity for: frailty
#> Testing linearity for: life_expectancy
#> Testing linearity for: disability_cardiovascular
#> Testing linearity for: disability_pulmonary
#> Testing linearity for: disability_renal
#> Testing linearity for: disability_neurological
#> `geom_smooth()` using formula = 'y ~ x'
#> `geom_smooth()` using formula = 'y ~ x'
#> `geom_smooth()` using formula = 'y ~ x'
#> `geom_smooth()` using formula = 'y ~ x'
#> `geom_smooth()` using formula = 'y ~ x'
#> `geom_smooth()` using formula = 'y ~ x'
#> `geom_smooth()` using formula = 'y ~ x'
#> `geom_smooth()` using formula = 'y ~ x'
#> `geom_smooth()` using formula = 'y ~ x'
#> `geom_smooth()` using formula = 'y ~ x'
#> `geom_smooth()` using formula = 'y ~ x'
#> `geom_smooth()` using formula = 'y ~ x'
#> `geom_smooth()` using formula = 'y ~ x'
#> `geom_smooth()` using formula = 'y ~ x'
lin$summary_table
Linearity Diagnostics for Ordered Covariates
1 Likelihood-ratio test comparing linear vs. level-specific coeficients model.
2 Wald test for the quadratic (x²) term in a polynomial model.
3 Akaike Information Criterion; lower values indicate better relative model support.