‚Z”Šw‚ÌŽ¿–âƒXƒŒiˆãŽÒE“Œ‘呲ê—pj Part438 (991Ú½)
㉺‘OŽŸ1-V
’Šo‰ðœ •KŽ€Áª¯¶°(–{‰Æ) (‚×) Ž©ID Ú½žx ‚ ‚Ú[‚ñ

863: 06/03(‰Î)00:31 ID:CfA5PBxZ(1/2) AAS
x = c(-0.86, -0.3, -0.05, 0.73)
n = c(5, 5, 5, 5)
y = c(0, 1, 3, 5)
(data = cbind(x, n, y))
(response = cbind(y, n - y) )
results = glm(response ~ x, family = binomial(link="logit") )
summary(results)
b=MASS::mvrnorm(1e5,results$coef,S=vcov(results))
# log(p/(1-p)) = b1+b2*x
LD = function(b1,b2,p=0.5) (log(p/(1-p)) - b1)/b2
LD50=mapply(LD,b[,1],b[,2])
hist(LD50)
quantile(LD50,c(0.025,0.5,0.975))
HDInterval::hdi(LD50)
864: 06/03(‰Î)23:40 ID:CfA5PBxZ(2/2) AAS
k=10
m=400
Nmax=1000
sim = \(){
N=sample(m:Nmax,1)
if(max(sample(1:N,k))==m) return(N)
}
N=NULL
while(length(N)<1000) N=c(N,sim())
summary(N)
quantile(N,c(0.5,0.95))
㉺‘OŽŸ1-VŠÖŽÊ”——õÝžx—ð
½Úî•ñ ÔÚ½’Šo ‰æ‘œÚ½’Šo —ð‚Ì–¢“ǽÚ

‚Ê‚±‚ÌŽè ‚Ê‚±TOP 0.030s