Log of Splus Data Analyses Related to HW 2 & 3 ======================================= 3/9/03 #3.1 > round(unlist(ScorProfW(matrix(c(1601,510,162527,412368),ncol=2),.05, c(0,.03),npts=30)[2:4]),6) WaldInts1 WaldInts2 ScorInts1 ScorInts2 LRInts1 LRInts2 0.008032 0.009007 0.008043 0.009017 0.008458 0.009152 > round(unlist(ScorProfW(matrix(c(1601,510,162527,412368),ncol=2),.05, c(.5,10),npts=30,type="RR")[2:4]),4) WaldInts1 WaldInts2 ScorInts1 ScorInts2 LRInts1 LRInts2 7.2082 8.801 7.1494 8.7232 7.1915 8.7312 > round(unlist(ScorProfW(matrix(c(1601,510,162527,412368),ncol=2),.05, c(.5,10),npts=50,type="OR")[2:4]),4) WaldInts1 WaldInts2 ScorInts1 ScorInts2 LRInts1 LRInts2 7.1491 8.7231 7.2084 8.8012 7.2233 8.8095 #3.15 (b) > for(i in c(1:5,seq(10,80,10),seq(150,570,30))) cat("With theta=",i, ", ExtHyp prob of 15=",1-pExtHyp(14,15,15,22,i),"\n") With theta= 1 , ExtHyp prob of 15= 0.00109945027486269 With theta= 2 , ExtHyp prob of 15= 0.0122567830877285 With theta= 3 , ExtHyp prob of 15= 0.0363560434976881 With theta= 4 , ExtHyp prob of 15= 0.0688177364213567 With theta= 5 , ExtHyp prob of 15= 0.105241290372662 With theta= 10 , ExtHyp prob of 15= 0.280886169031004 With theta= 20 , ExtHyp prob of 15= 0.50439183188548 With theta= 30 , ExtHyp prob of 15= 0.625402113035335 With theta= 40 , ExtHyp prob of 15= 0.699557739175097 With theta= 50 , ExtHyp prob of 15= 0.749393546536196 With theta= 60 , ExtHyp prob of 15= 0.785119888953706 With theta= 70 , ExtHyp prob of 15= 0.811962734679643 With theta= 80 , ExtHyp prob of 15= 0.832859807904861 With theta= 150 , ExtHyp prob of 15= 0.906048958475889 With theta= 180 , ExtHyp prob of 15= 0.920903086231513 With theta= 210 , ExtHyp prob of 15= 0.931702915022108 With theta= 240 , ExtHyp prob of 15= 0.939908570308354 With theta= 270 , ExtHyp prob of 15= 0.946354339115316 With theta= 300 , ExtHyp prob of 15= 0.95155146463432 With theta= 330 , ExtHyp prob of 15= 0.955830680132932 With theta= 360 , ExtHyp prob of 15= 0.959415405308401 With theta= 390 , ExtHyp prob of 15= 0.962462001227197 With theta= 420 , ExtHyp prob of 15= 0.965083171233284 With theta= 450 , ExtHyp prob of 15= 0.9673622027066 With theta= 480 , ExtHyp prob of 15= 0.969361975633623 With theta= 510 , ExtHyp prob of 15= 0.971130851829377 With theta= 540 , ExtHyp prob of 15= 0.972706636123995 With theta= 570 , ExtHyp prob of 15= 0.974119307783109 ### The Cornfield (1956) exact interval is = (2.58,590) > 1-pExtHyp(14,15,15,22,2.58) ### = 0.02491509 > 1-pExtHyp(14,15,15,22,590) ### = 0.9749826 > for(i in c(1:5,seq(300,570,30))) cat("With theta=",i, " Score Stat is",round(NuisBinOR(matrix(c(15,7,0,8), ncol=2), thet=i)["Scorstat"],4),"\n") With theta= 1 Score Stat is 3.3029 With theta= 2 Score Stat is 2.3625 With theta= 3 Score Stat is 1.961 With theta= 4 Score Stat is 1.7241 With theta= 5 Score Stat is 1.5626 With theta= 300 Score Stat is 0.2372 With theta= 330 Score Stat is 0.2263 With theta= 360 Score Stat is 0.2168 With theta= 390 Score Stat is 0.2084 With theta= 420 Score Stat is 0.2009 With theta= 450 Score Stat is 0.1941 With theta= 480 Score Stat is 0.188 With theta= 510 Score Stat is 0.1825 With theta= 540 Score Stat is 0.1774 With theta= 570 Score Stat is 0.1727 ### Score interval is (3,Inf) ### Recoded NuisBinOR to avoid Inf loglik's > for(i in c(1:7,seq(300,570,30))) cat("With theta=",i, " LRstat is",round(NuisBinOR(matrix(c(15,7,0,8), ncol=2), thet=i)["LRstat"],4),"\n") With theta= 1 LRstat is 14.0672 With theta= 2 LRstat is 9.2209 With theta= 3 LRstat is 7.0125 With theta= 4 LRstat is 5.7053 With theta= 5 LRstat is 4.8287 With theta= 6 LRstat is 4.1954 With theta= 7 LRstat is 3.7143 With theta= 300 LRstat is 0.1132 With theta= 330 LRstat is 0.103 With theta= 360 LRstat is 0.0945 With theta= 390 LRstat is 0.0873 With theta= 420 LRstat is 0.0811 With theta= 450 LRstat is 0.0757 With theta= 480 LRstat is 0.071 With theta= 510 LRstat is 0.0669 With theta= 540 LRstat is 0.0632 With theta= 570 LRstat is 0.0599 ### LR profile interval is (6.71,Inf)