# NOT RUN {
data(RCI_sample_data)
## fitting models to sample
linear_fit <- lm(score ~ baseline + age + gender + education,
data = RCI_sample_data)
logistic_fit <- glm(cbind(score, 15 - score) ~ baseline + age + gender + education,
family = binomial,
data = RCI_sample_data)
## new patient data
new_patient <- data.frame("age" = 68,
"gender" = "male",
"score" = 9,
"baseline" = 11,
"education" = 12)
## calculating RCI for new patient without refitting model
RCI_newpatient(model = linear_fit, new = new_patient)
RCI_newpatient(model = logistic_fit, new = new_patient)
# }
Run the code above in your browser using DataLab