From pdalgd at gmail.com  Fri Aug 25 19:15:02 2017
From: pdalgd at gmail.com (peter dalgaard)
Date: Fri, 25 Aug 2017 19:15:02 +0200
Subject: [Rd] Are r2dtable and C_r2dtable behaving correctly?
In-Reply-To: <F3F2FF42-6F62-4A60-86CA-B7071EDA6429@gmail.com>
References: <CALxJP_bGTshNpaeb2KmuzL=RboY8fd7+N4YHs1_E6155iESQnQ@mail.gmail.com>
 <22943.57401.129802.474678@stat.math.ethz.ch> <1503652999326.82111@oulu.fi>
 <F3F2FF42-6F62-4A60-86CA-B7071EDA6429@gmail.com>
Message-ID: <D5EDB385-1D8A-4BCC-AAD2-39EBC5310D44@gmail.com>


> 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



[Rd] Are r2dtable and C_r2dtable behaving correctly?
peter dalgaard