lik.ratio | R Documentation |
lik.ratio()
performs the Likelihood ratio test and is used in chapters 12 and 13 of "Applied Nonparametric Statistical Methods" (5th edition)
lik.ratio(
x,
y,
max.exact.cases = 10,
nsims.mc = 1e+05,
seed = NULL,
do.exact = TRUE,
do.asymp = FALSE,
do.mc = FALSE
)
x |
Factor of same length as y |
y |
Factor of same length as x |
max.exact.cases |
Maximum number of cases allowed for exact calculations (defaults to |
nsims.mc |
Number of Monte Carlo simulations to be performed (defaults to |
seed |
Random number seed to be used for Monte Carlo simulations (defaults to |
do.exact |
Boolean indicating whether or not to perform exact calculations (defaults to |
do.asymp |
Boolean indicating whether or not to perform asymptotic calculations (defaults to |
do.mc |
Boolean indicating whether or not to perform Monte Carlo calculations (defaults to |
An ANSMtest object with the results from applying the function
# Example 12.2 from "Applied Nonparametric Statistical Methods" (5th edition)
lik.ratio(ch12$infection.site, ch12$district, do.exact = FALSE, do.asymp = TRUE)
# Example 13.12 from "Applied Nonparametric Statistical Methods" (5th edition)
chemo.side.effect.3 <- ch13$chemo.side.effect
levels(chemo.side.effect.3) <- list("Side-effect" = c("Hair loss",
"Visual impairment", "Hair loss & Visual impairment"), "None" = "None")
lik.ratio(ch13$chemo.drug, chemo.side.effect.3, seed = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.