logLikelihoodFNCH: Conditional log likelihood of 2x2 tables at one logOdds

View source: R/newsafe2x2Test.R

logLikelihoodFNCHR Documentation

Conditional log likelihood of 2x2 tables at one logOdds

Description

Given its total ya + yb, ya is Fisher's noncentral hypergeometric with odds exp(logOdds) on group A; logOdds = 0 is the hypergeometric null. Evaluated on the log scale, binomial coefficients plus logOdds times the feasible count normalised by log-sum-exp, so extreme logOdds give finite values where the plain density underflows to 0.

Usage

logLikelihoodFNCH(ya, yb, na, nb, logOdds)

Arguments

ya

positive observations/ events per data block in group A: a numeric with integer values between (and including) 0 and na, the number of observations in group A per block.

yb

positive observations/ events per data block in group B: a numeric with integer values between (and including) 0 and nb, the number of observations in group B per block.

na

number of observations in group A per data block, one value or one per block.

nb

number of observations in group B per data block, one value or one per block.

logOdds

numeric, one log odds ratio logit(thetaA) - logit(thetaB).

Value

A numeric vector, one log density per block.


safestats documentation built on Oct. 5, 2026, 9:07 a.m.