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)
the maximum likelihood estimate for log odds ratio.
the maximum conditional likelihood estimate for log odds ratio.
profile likelihood support interval (k
=6.8) corresponding to a 95% confidence interval based on a normal approximation.
conditional likelihood support interval (k
=6.8) corresponding to a 95% confidence interval based on a normal approximation.
profile likelihood ratio.
conditional likelihood ratio.
p-value based on the profile LR statistic.
p-value based on the conditional LR statistic.
p-value from Pearson's Chi-squared test.
p-value from Fisher's exact test.
p-value from Pearson's Chi-squared test with continuity correction.
the number of success for treatment 1.
the number of success for treatment 2.
the sample size for treatment 1.
the sample size for treatment 2.
grid for evaluating a parameter of interest to obtain values for likelihoods. The default is 0.01.
Leena Choi <naturechoi@gmail.com>
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.
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.
profilelike.plot
, profilelike.summary
, profilelike.glm
(fit <- LR.pvalue(y1=20, y2=30, n1=50, n2=50, interval=0.01))
Run the code above in your browser using DataLab