Can anybody help with the following syntax:
with(predict(spl_bin,
dosex_bin,
xref_bin,
expo = TRUE),{
plot(get("rcs(dose,knots_bin)dose"),
pred,
type="l",
ylim=c(0.4,10),
ylab="cardiovascular disease relative risk",
xlab="alcohol consumption (g/d)",
log ="y",
bty="l",
las=1)
matlines(get("rcs(dose,knots_bin)dose"),
cbind(ci.ub, ci.lb),
col = 1,
lty = "dashed")
})
I have tried to fix the above-mentioned syntax with no success. The following message always came up:
> unexpected symbol in
"with(predict(spl_bin,dosex_bin,xref_bin,expo = TRUE),{plot(get("rcs(dose,knots_bin)dose"), pred,type="l", ylim=c(0.4,10), ylab="cardiovascular disease relative risk", xlab="alcohol consumption"
Any help will be appreciated. I am new with R and have so much to learn.