if (FALSE) {
#The run is dependent on the output of the step3.est() function and CEP_t() function
#It is not recommended for run it.
t = 2 # the number of time points
K = ncol(Q) # the number of attributes
Z = dat1[, c(1,2)]
z_t1 = cbind(1, Z$gender) # Covariate at time 1
z_t2 = cbind(1, Z$gender, Z$intervention, apply(Z,1,prod)) # Covariates at time 2
beta = step3.output$beta
gamma_01 = step3.output$gamma_01
gamma_10 = step3.output$gamma_10
# Update classifications using the Bayes' Theorem
updated.class <- update.class(cep = cep, K = K, t = t, z_t1 = z_t1, z_t2 = z_t2,
beta = beta, gamma_01 = gamma_01, gamma_10 = gamma_10)
# The corrected and updated attribute prevalance
updated.class$att.prevalance
# The corrected and updated posterior probability
updated.class$post.prob
}
Run the code above in your browser using DataLab