80 likes | 185 Views
Lecture 2. Recap. R esults of our survey…. Are we smarter than chimps?. In each of the following pair one country has twice the child mortality rate than the other. Sri Lanka or Turkey Poland or South Korea Malaysia or Russia Pakistan or Vietnam Thailand or South Africa. Answers.
E N D
Recap • Results of our survey…
Are we smarter than chimps? • In each of the following pair one country has twice the child mortality rate than the other. • Sri Lanka or Turkey • Poland or South Korea • Malaysia or Russia • Pakistan or Vietnam • Thailand or South Africa
Answers • In each of the following pair one country has twice the child mortality rate than the other. • Sri Lanka or Turkey • Poland or South Korea • Malaysia or Russia • Pakistan or Vietnam • Thailand or South Africa • Collect data and draw a histogram
Chimps histogram plot(0:5,20*dbinom(0:5,5,.5),type="h",xlab="number of correct answers",ylab="average number of chimps")
What about uncertainty • 1000 classes of chimps simulated. • Classes ordered based on average performance • Will Show: Worst class, 2.5%, 5%, 25% nclass=1000 nchimps=20 nquestions=5 count1=matrix(0,nrow=nclass,ncol=nquestions+1) m1=rep(0,nclass) for (i in 1:nclass){ data1=rbinom(nchimps,nquestions,.5) count1[i,]=tabulate(data1,nquestions+1) m1[i]=mean(data1) } i1=order(m1) i2=order(count1[,1]) par(mfrow=c(2,2)) plot(0:5,count1[i1[1],],type="h",xlab="number of correct answers",ylab="average number of chimps",sub="1:1000") plot(0:5,count1[i1[25],],type="h",xlab="number of correct answers",ylab="average number of chimps",sub="25:1000") plot(0:5,count1[i1[50],],type="h",xlab="number of correct answers",ylab="average number of chimps",sub="50:1000") plot(0:5,count1[i1[250],],type="h",xlab="number of correct answers",ylab="average number of chimps",sub="250:1000")
Watch a movie • http://www.gapminder.org/videos/the-joy-of-stats/