云计算SurvivalAnalysis解析
程序员文章站
2022-04-12 21:17:24
云计算SurvivalAnalysis解析。
rnos <- runif(100)
which(rnos<= 0.1)
which(rnos<= 0.1)[1]
de...
云计算SurvivalAnalysis解析。
rnos <- runif(100)
which(rnos<= 0.1)
which(rnos<= 0.1)[1]
death1 <- numeric(30)
for (i in 1:30){
rnos <- runif(100)
death1[i] <- which(rnos<= 0.1)[1]
}
death1
1/mean(death1)
death2 <- numeric(30)
for (i in 1:30) {
rnos <- runif(100)
death2[i] <- which(rnos<= 0.2)[1] }
1/mean(death2)
death <- c(death1,death2)
factory <- factor(c(rep(1,30),rep(2,30)))
plot(factory,death,xlab="factory",ylab="age at failure",col="wheat3")?
model1 <- glm(death~factory,Gamma)
summary(model1)
rm(death)
下一篇: 关于C语言中 || 和 &&的用法实例