I am trying to plot a continuous variable effect as an odds ratio (OR curve over a continuous variable with restricted cubic spline) using clogit(conditional logistic regression) in R.
ddist$limits["Adjust to","var1"] <- 30 model <- clogit(case ~ rcs(var1, 4) + strata(statu), data = data1) predicted <- Predict(model, var1, ref.zero=TRUE, fun=exp)
But I keep getting an error message:
Error in Predict(model, var1, ref.zero=TRUE, fun=exp): predictor(s) not in model: var1
When I am running this using LRM, I don't see this error message though. Am I supposed to use different codes when using clogit?