winthander
dosefit<-function(ir,bw){
c<-5
ef<-1
ed<-12.9
at<-70
dose<-(c*ir*ef*ed)/(bw*at)
return(dose)
}
N<-10000
for(i in 1:N)
{ir<-sample(c(0.5,0.75,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5),1,replace=TRUE)
bw<-sample(c(seq(46.8,101.7,1)),1,replace=TRUE)
dose<-dosefit
}
本来是想模拟蒙特卡罗一下的,就是出不来结果,第一次写的小程序,请大家帮我看看是不是问题很大?
模拟的公式是dose<-(c*ir*ef*ed)/(bw*at),变量只有ir和bw