library(ggplot2)
data(CloudCeiling)
ggplot(CloudCeiling) + geom_line(aes(x=1:length(y), y=y)) +
labs(x="Time") + theme_bw()
# Proportion of censoring
prop.table(table(CloudCeiling$cc))
if (FALSE) {
# A censored regression model
## This may take a long time due to the number of censored observations.
## For other examples see help(ARCensReg).
x = as.matrix(rep(1, length(CloudCeiling$y)))
cc = CloudCeiling$cc
lcl = CloudCeiling$y
ucl = rep(Inf, length(CloudCeiling$y))
miss = which(is.na(CloudCeiling$y))
cc[miss] = 1
lcl[miss] = -Inf
AR_reg = ARCensReg(cc, lcl, ucl, CloudCeiling$y, x, p=1, tol=.001)}
Run the code above in your browser using DataLab