Learn R Programming

ANSM5 (version 1.1.1)

logoddsratio.2x2: Perform Log odds ratio test

Description

logoddsratio.2x2() performs the Log odds ratio test and is used in chapter 13 of "Applied Nonparametric Statistical Methods" (5th edition)

Usage

logoddsratio.2x2(
  x,
  y,
  max.exact.cases = 10,
  nsims.mc = 1e+05,
  seed = NULL,
  do.exact = TRUE,
  do.asymp = FALSE,
  do.mc = FALSE
)

Value

An ANSMtest object with the results from applying the function

Arguments

x

Binary factor of same length as y

y

Binary factor of same length as x

max.exact.cases

Maximum number of cases allowed for exact calculations (defaults to 10)

nsims.mc

Number of Monte Carlo simulations to be performed (defaults to 100000)

seed

Random number seed to be used for Monte Carlo simulations (defaults to NULL)

do.exact

Boolean indicating whether or not to perform exact calculations (defaults to TRUE)

do.asymp

Boolean indicating whether or not to perform asymptotic calculations (defaults to FALSE)

do.mc

Boolean indicating whether or not to perform Monte Carlo calculations (defaults to FALSE)

Examples

Run this code
# Exercise 13.2 from "Applied Nonparametric Statistical Methods" (5th edition)
#logoddsratio.2x2(ch13$physical.activity[ch13$gender == "Boy"],
#  ch13$tv.viewing[ch13$gender == "Boy"], do.exact = FALSE, do.asymp = TRUE)
#logoddsratio.2x2(ch13$physical.activity[ch13$gender == "Girl"],
#  ch13$tv.viewing[ch13$gender == "Girl"], do.exact = FALSE, do.asymp = TRUE)

Run the code above in your browser using DataLab