Skip to content
Back to formatted view

Raw Message

Message-ID: <4EA93A0A.9060309@gmail.com>
Date: 2011-10-27T11:01:30Z
From: Duncan Murdoch
Subject: 2 x 3 Probability under the null
In-Reply-To: <CAGPwjHz3xT3GKig3VpUoNOnxko4DvVsNRtjcSm2wwx7X0PaTyQ@mail.gmail.com>

On 11-10-27 12:09 AM, Jim Silverton wrote:
> I have a 2 x 3 matrix called snp and I want to compute the following
> probability:
>
> choose(sum(snp[,1]), snp[1,1]) * choose(sum(snp[,2]), snp[1,2]) *
> choose(sum(snp[,3]), snp[1,3])/choose(sum(snp), sum(snp[1,]))
>
> but I keep getting Infs and NaNs. Is there a function that can do this in R?
>
>
>

Work in the log scale.  You're probably getting overflows.  lchoose() 
calculates the log of choose().

Duncan Murdoch