欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  科技

云计算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)