LR.pvalue: P-values based on LR statistics for 2 x 2 Tables

View source: R/LR.pvalue.R

LR.pvalueR Documentation

P-values based on LR statistics for 2 x 2 Tables

Description

This function provides p-values based on likelihood ratio (LR) statistics for 2 x 2 tables.

Usage

LR.pvalue(y1, y2, n1, n2, interval=0.01)

Arguments

y1

the number of success for treatment 1.

y2

the number of success for treatment 2.

n1

the sample size for treatment 1.

n2

the sample size for treatment 2.

interval

grid for evaluating a parameter of interest to obtain values for likelihoods. The default is 0.01.

Details

This function provides p-values based on the profile and conditional likelihood ratio (LR) statistics for 2 x 2 tables. The function also provides the profile and conditional likelihood support intervals (k=6.8) corresponding to a 95% confidence interval based on a normal approximation. For comparison purpose, p-values from Pearson's Chi-squared test, Fisher's exact test and Pearson's Chi-squared test with continuity correction are also provided.

Value

mle.lor.uncond

the maximum likelihood estimate for log odds ratio.

mle.lor.cond

the maximum conditional likelihood estimate for log odds ratio.

LI.norm.profile

profile likelihood support interval (k=6.8) corresponding to a 95% confidence interval based on a normal approximation.

LI.norm.cond

conditional likelihood support interval (k=6.8) corresponding to a 95% confidence interval based on a normal approximation.

LR.profile

profile likelihood ratio.

LR.cond

conditional likelihood ratio.

Pvalue.LR.profile

p-value based on the profile LR statistic.

Pvalue.LR.cond

p-value based on the conditional LR statistic.

Pvalue.chisq.test

p-value from Pearson's Chi-squared test.

Pvalue.fisher.test

p-value from Fisher's exact test.

Pvalue.chisq.cont.correction

p-value from Pearson's Chi-squared test with continuity correction.

Warning

Likelihood intervals, LRs and the corresonding p-values are not reliable with empty cells (y1=0 or y2=0) in 2 x 2 tables.

P-values from Pearson's Chi-squared test, Fisher's exact test and Pearson's Chi-squared test with continuity correction are provided only for comparison purpose. For more options, use chisq.test and fisher.test for these tests.

Author(s)

Leena Choi <naturechoi@gmail.com>

See Also

profilelike.plot, profilelike.summary, profilelike.glm

Examples

	(fit <- LR.pvalue(y1=20, y2=30, n1=50, n2=50, interval=0.01))

ProfileLikelihood documentation built on Aug. 25, 2023, 5:15 p.m.