LR.pvalue | R Documentation |
This function provides p-values based on likelihood ratio (LR) statistics for 2 x 2 tables.
LR.pvalue(y1, y2, n1, n2, interval=0.01)
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. |
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.
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 ( |
LI.norm.cond |
conditional likelihood support interval ( |
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. |
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.
Leena Choi <naturechoi@gmail.com>
profilelike.plot
, profilelike.summary
, profilelike.glm
(fit <- LR.pvalue(y1=20, y2=30, n1=50, n2=50, interval=0.01))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.