trend_test.RdComputes trend test based on the generalized linear model with logit link function (logistic regression) and the Wald test statistic.
trend_test(data, x, y, alpha = 0.05)
| data | tbl. Input data |
|---|---|
| x | character. Name of a categorical variable with r levels |
| y | character. Name of a categorical variable with 2 levels |
| alpha | double. The nominal level, Default: 0.05 |
tbl. Data frame with Wald test statistic and p-value as well as estimate for the trend (odds ratio) and associated Wald confidence intervals
Procedure as described in Fagerland, Lydersen, & Laake (2017).
The function is an adaptation of the Matlab script provided by Fagerland et
al. (2017) on the book's
website.
Fagerland, M., Lydersen, S., & Laake, P. (2017). Statistical analysis of contingency tables. London: Chapman and Hall.