[Rd] Are r2dtable and C_r2dtable behaving correctly?
peter dalgaard
pdalgd at gmail.com
Fri Aug 25 19:15:02 CEST 2017
> On 25 Aug 2017, at 12:04 , Peter Dalgaard <pdalgd at gmail.com> wrote:
>
>> There are three possible matrices, and these come out in proportions 1:4:1, the one with all cells filled with ones being
>> most common.
>
> ... and
>
>> dhyper(0:2,2,2,2)
> [1] 0.1666667 0.6666667 0.1666667
>> dhyper(0:2,2,2,2) *6
> [1] 1 4 1
>
> so that is exactly what you would expect.
And, incidentally, this is the "statistician's socks" puzzle from introductory probability:
A statistician has 2 white socks and 2 black socks. Late for work a dark November morning, he puts on two socks at random. What is the probability that he goes to work with different colored socks?
--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
More information about the R-devel
mailing list