##### script for slidedeck c6 ##### ##### Create graphics for Neg Bin ##### ### Preamble # two colors ito1 = "#E1EBEE" ## background ito2 = "#00AAE4" ## selected ##### ### Ex: The Ace of Spades xx = seq(0,150) yy = dnbinom(xx, 1, 1/52) par(bg="transparent") par(xpd=NA) par(xaxs="i", yaxs="i") par(family="serif",las=1) par(mar=c(3.5,4,0,0)+0.5) par(font.lab=2, cex.lab=1.1) plot.new() plot.window( xlim=c(0,110), ylim=c(0,0.025)) yyVals = seq(0,0.025,length=6) segments(-0.5,yyVals,600,yyVals, lty=3, col="grey") segments(-0.5,0,600,0) axis(1, at=seq(0,120,20) ) axis(2, at= yyVals) title(xlab="Number of Failed Draws", line=2.50) title(ylab="Probability", line=3.25) #segments(xx,0,xx,yy) points(xx,yy, pch=21, bg=ito2) mtext(side=1, at=107, text=". . .", line=0.75) ### Calculations dnbinom(0, 1, 1/52) dnbinom(9, 1, 1/52) dnbinom(99, 1, 1/52) ##### End of File