p.cat: p-value calculator for categorical variables

Description Usage Arguments Details Value Author(s) Examples

View source: R/p.cat.R

Description

Calculate the p-value for categorial variables. The decision which test to use is equal to m.cat. The p-value is calculated using one of the three tests: Wilcoxon-Test, McNemar-Test, Chi-Squared-Test.

Usage

1
p.cat(x, group, paired = F, is.ordered = F, correct.cat = F, correct.wilcox = T, index = c(), create = "tex")

Arguments

x

Vector of the categorial variable.

group

Vector of the grouping variable.

paired

Logical. Is the categorial Variable paired?

is.ordered

Logical. Is the categorial Variable ordered?

correct.cat

Logical. Should correction be used in chi-sqared tests (see chisq.test)

correct.wilcox

Logical. Should correction be used in wilcoxon tests (see wilcox.test)

index

Optional. Label for the footnote. The footnotes aren't produced in this function.

create

Which output document should be produced in the following step (one of "pdf", "tex", "knitr", or "word"). Only usefull if index is not NULL.

Details

Wilcoxon-Test: A Test for a comparison of 2 (in)dependent, ordered samples. (see wilcox.test). Kruskal_wallis-Test: A Test for a comparison of more than 2 (in)dependent, ordered samples. (see kruskal.test). McNemar Test: A Test for a comparison of 2 or more than 2 dependent, not ordered samples. (see mcnemar.test). Chi-Squared Test: A Test for a comparison of 2 or more than 2 independent, not ordered samples. (see chisq.test).

Value

The p-value with index which test is ussed is returned.

Author(s)

Lorenz Uhlmann, Csilla van Lunteren

Examples

1
2
3
4
## Not run: 
p.cat(x=rep(1:5,20), group=rep(1:4,25))

## End(Not run)

vanLunteren/DescrTab documentation built on May 4, 2019, 10:56 a.m.