Stan:
I think it is more realistic not to assume independence. No one should be
on the committee twice, right?
Ryan
------------------------------------------
Ryan T. Moore ~ Government & Social Policy
Ph.D. Candidate ~ Harvard University
On Tue, 11 Feb 2003, Stanislav Markus wrote:
Question 1(a) says that "committee assignment is
independent" which
means:
Pr(1st selected Democrat) = Pr (2nd selected Democrat | 1st selected
Democrat)
However, these probabilities are not the same:
Pr (1st selected Dem) = 45/100
Pr (2nd selected Democrat | 1st selected Democrat) = 44/99
So, in what sense is the assignment "independent"?
Thanks,
Stan
****************************
Stanislav Markus
Ph.D. Candidate
Harvard University
Department of Government
e: smarkus(a)fas.harvard.edu
t: 617.513.5407
-----Original Message-----
From: gov2001-l-admin(a)fas.harvard.edu
[mailto:gov2001-l-admin@fas.harvard.edu] On Behalf Of Kosuke Imai
Sent: Tuesday, February 11, 2003 9:21 AM
To: John Bright
Cc: Yongwook Ryu; gov2001-l(a)fas.harvard.edu
Subject: Re: [gov2001-l] re: Q1(a)
Yes, you need to come up with an index which separates democrats from
republicans.
Kosuke
On Tue, 11 Feb 2003, John Bright wrote:
Yongwook,
Your sequence "pool" is a list of 100 elements, with values from 1 to
100. I
think you want to change the values in your
sequence so that the
number of
elements that take on the value "1"
corresponds to the number of
democrats,
and the rest of the elements (which represent
republicans) take on the
value
"0" (or some other values that will
distinguish between the two).
Your if statement tests if the length of the unique sample is less
than 5.
As you have your sampling done now, the sample
contains all unique
numbers,
so you will never get less than 5 unique numbers
from your sample
(without
replacement). After you make the changes above
you will still want to
change
your if statement. You want to record the times
that all of the people
drawn
from the senate are democrats, or in terms of the
above coding
convention
(dems = 1), you want to record when your sample
contains all 1's.
Hope this help.
John.
On 2/11/03 2:25 AM, "Yongwook Ryu" <yryu(a)fas.harvard.edu> wrote:
> all,
>
> I wrote the following function for Q1(a), and got the obviously
wrong
answer.
> any idea as to what I did wrong?
>
>> sims<-1000
>> people<-5
>> pool<-seq(1,100,1)
>> same<-0
>> for(i in 1:sims){
> + comm<-sample(pool, people, replace=FALSE)
> + if(length(unique(comm))<people)
> + same<-same+1}
>> cat("probability of =5 people being in the same committee:",
same/sims, "\n")
probability of >=5 people being in the same committee: 0
yongwook
-----------------------------
Yongwook Ryu
PhD Candidate
Department of Government
Harvard University
Tel:617-493-3397
Email: yryu(a)fas.harvard.edu
-----------------------------
_______________________________________________
gov2001-l mailing list
gov2001-l(a)fas.harvard.edu
http://www.fas.harvard.edu/mailman/listinfo/gov2001-l
_______________________________________________
gov2001-l mailing list
gov2001-l(a)fas.harvard.edu
http://www.fas.harvard.edu/mailman/listinfo/gov2001-l
_______________________________________________
gov2001-l mailing list
gov2001-l(a)fas.harvard.edu
http://www.fas.harvard.edu/mailman/listinfo/gov2001-l
_______________________________________________
gov2001-l mailing list
gov2001-l(a)fas.harvard.edu
http://www.fas.harvard.edu/mailman/listinfo/gov2001-l