inline_stats | R Documentation |
Convenience functions to summarize statistical tests.
inl_anova(x, y = NULL, ..., details = TRUE, digits = 2L)
inl_ca(x, y = NULL, ..., details = TRUE, digits = 2L)
inl_chisq(x, y = NULL, ..., details = TRUE, digits = 2L)
inl_cuzick(x, y = NULL, ..., details = TRUE, digits = 2L)
inl_fisher(x, y = NULL, ..., details = TRUE, digits = 2L)
inl_jt(x, y = NULL, ..., details = TRUE, digits = 2L)
inl_kruskal(x, y = NULL, ..., details = TRUE, digits = 2L)
inl_kw(x, y = NULL, ..., details = TRUE, digits = 2L)
inl_logrank(object, ..., details = TRUE, digits = 2L)
inl_t(x, y = NULL, ..., paired = FALSE, details = TRUE, digits = 2L)
inl_wilcox(x, y = NULL, ..., paired = FALSE, details = TRUE, digits = 2L)
x |
numeric or factor-like variable, table, or a list depending on the statistic |
y |
(optional) group or stratification variable |
... |
additional arguments passed to the stat function |
details |
logical; if |
digits |
number of digits past the decimal point to keep |
object |
for |
paired |
logical; if |
x <- mtcars$vs
y <- mtcars$am
## t-test (two-sample)
t.test(x ~ y)
inl_t(split(x, y))
inl_t(x, y)
## t-test (paired)
t.test(x, y, paired = TRUE)
inl_t(x, y, paired = TRUE)
inl_t(list(x, y), paired = TRUE)
inl_t(c(x, y), factor(rep(1:2, each = length(x))), paired = TRUE)
## fisher's exact
fisher.test(x, y)
inl_fisher(x, y)
inl_fisher(table(x, y))
## chi-squared test for count data
chisq.test(table(x, y))
inl_chisq(x, y)
inl_chisq(table(x, y))
## wilcoxon rank-sum test
wilcox.test(mtcars$mpg ~ y)
inl_wilcox(mtcars$mpg, y)
inl_wilcox(split(mtcars$mpg, y))
## wilcoxon signed-rank test
wilcox.test(x, y, paired = TRUE)
inl_wilcox(x, y, paired = TRUE)
inl_wilcox(list(x, y), paired = TRUE)
inl_wilcox(c(x, y), factor(rep(1:2, each = length(x))), paired = TRUE)
## cuzick's trend test
cuzick.test(mpg ~ gear, mtcars)
inl_cuzick(mtcars$mpg, mtcars$gear)
inl_cuzick(split(mtcars$mpg, mtcars$gear))
## jonckheere-terpstra test
jt.test(table(mtcars$gear, mtcars$cyl))
inl_jt(mtcars$gear, mtcars$cyl)
inl_jt(table(mtcars$gear, mtcars$cyl))
## cochran-armitage test for trend
ca.test(table(mtcars$vs, mtcars$cyl))
inl_ca(mtcars$vs, mtcars$cyl)
inl_ca(table(mtcars$vs, mtcars$cyl))
## test for trend in proportions
kw.test(table(mtcars$gear, mtcars$cyl))
inl_kw(mtcars$gear, mtcars$cyl)
inl_kw(table(mtcars$gear, mtcars$cyl))
## log-rank test
library('survival')
s1 <- survdiff(Surv(time, status) ~ sex, colon)
s2 <- survdiff(Surv(time, status) ~ sex + strata(age), colon)
inl_logrank(s1)
inl_logrank(s2)
inl_logrank(Surv(time, status) ~ sex, data = colon)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.