genodds {genodds}R Documentation

Generalized Odds Ratios

Description

Performs Agresti's Generalized Odds Ratios (GenOR) for two-group ordinal data.

Usage

genodds(response, group, strata=NULL,
        alpha=0.05,ties="split",
        nnt=FALSE,verbose=FALSE,upper=TRUE)

Arguments

response

A (non-empty) vector. Gives the outcome measure. If a factor, level order is used to determine ranking of outcomes.

group

A factor vector of equal length to response. Gives the groups for the test. Must take on exactly 2 values.

strata

An optional factor vector of equal length to response. Gives treatment blocks to separate comparisons.

alpha

The acceptable type 1 error used in the test.

ties

A string specifying how ties should be treated. See Details.

nnt

A boolean. If TRUE, then print number needed to treat in addition to generalized odds ratios.

verbose

A boolean. If TRUE, then print both pooled odds and relative risk ratio matrices regardless of result of statistical test.

upper

A boolean specifying if the upper triangle of relative risk ratios should be printed. If FALSE, lower triangle is used instead.

Details

Agresti's generalized odds ratios (GenOR) calculates the odds that, if a pair of observations are randomly selected from two groups, the outcome in one group is higher than the other. This implementation determines the direction of this comparison using factor levels. Odds are given with reference to observations corresponding to the higher group level resulting in a higher value in response. The opposite direction can be calculated by either calculating 1/genodds, or by specifying response=1-response in function input.

If nnt=TRUE, the Number Needed to Treat (NNT) is printed. NNT is a health economics measure and is related to generalized odds ratios through the formula NNT=1+2/(GenOR-1). It measures the expected number of patients required for a treatment to have impacted a patient's outcome. In this implementation, a positive NNT occurs when GenOR>1 and corresponds to the number needed to treat in the higher group level to observe a higher response value, while a negative NNT occurs when GenOR<1 and corresponds to the number needed to treat in the higher group level to observe a lower response value. If the confidence interval for GenOR straddles 1, the confidence interval for NNT is given as the union of disjoint intervals.

ties changes how ties are treated. If "split" is provided, then ties are equally split between favoring both groups (following the approach set out by O'Brien et. al. (2006)). If "drop" is provided, then ties are ignored (following the approach set out by Agresti (1980)). By default, "split" is used.

If strata is specified, generalized odds ratios are calculated separately for each individual strata. If in-stratum odds ratios are not significantly different from each other (with significance level alpha), these odds are pooled to obtain a global odds ratio which is adjusted for strata. If in-stratum odds ratios are significantly different, a matrix containing the relative risk ratios between stratum is printed, along with Z-scores corresponding to the significance of these differences. If verbose=TRUE is supplied, both pooled odds and relative risk ratios are printed regardless of if the between-stratum odds ratios are significantly different.

Options verbose, nnt and upper may be re-specified when using print method.

Value

A list with class "Genodds" containing the following:

pooled_lnodds

The pooled log(odds).

pooled_lnconf.int

(1-alpha)% Confidence intervals for pooled log(odds).

pooled_SElnodds

Standard error of pooled log(odds).

pooled_SElnnull

Standard error of pooled log(odds) under the null hypothesis.

pooled_p

The p-value of the test of pooled log(odds) = 1.

pooled_rel_statistic

Statistic of test that strata odds are equal.

pooled_rel_p

p-value for test that strata odds are equal.

relative_lnodds

A matrix giving the log of the ratio of odds between strata (generalized relative risk ratio).

relative_selnodds

A matrix containing the standard error of the log(relative risk ratio).

results

A list containing a summary of each strata measure.

param.record

A list containing parameters used in the test.

References

Agresti, A. (1980). Generalized odds ratios for ordinal data. Biometrics, 59-67.

O'Brien, R. G., & Castelloe, J. (2006, March). Exploiting the link between the Wilcoxon-Mann-Whitney test and a simple odds statistic. In Thirty-first Annual SAS Users Group International Conference.

Churilov, L., Arnup, S., Johns, H., Leung, T., Roberts, S., Campbell, B. C., Davis, S. M. & Donnan, G. A. (2014). An improved method for simple, assumption-free ordinal analysis of the modified Rankin Scale using generalized odds ratios. International Journal of Stroke, 9(8), 999-1005.

Examples

# Use the alteplase dataset provided by package and calculate genodds
df <- alteplase
x <- genodds(df$mRS,df$treat,df$time)
x
print(x,nnt=TRUE)


[Package genodds version 1.0.0 Index]