Dear all,

I would like to understand the effect of censoring in a linear model therefore 
I am doing the following
 
 n <- 20
 cen <- sample(x=c(0,1), size=n-1, replace=TRUE, prob=c(0.8,0.2))
 cen <- c(cen,0)
 x <- rnorm(n,0,1)
 tt <- -1+x+log(-log(1-runif(n)))+0.5767
 y <- c()
 for(i in 1:n){
    y[i] <- min(tt[i],cen[i])
 }

 moda <- lm(tt~x)
 modb <- lm(y~x)
 
Is this simulation correct? Thank you in advance!

Samuel



      
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to