I am pretty new to spline regression with R and I am having some trouble, I hope you can help me with this. What I want to do is to plot a spline of HR of an event vs. days to event. I have 2 treatments and ideally I would like to plot both these […]

Categories

## spline with R and error with lrm function

- Post author By Full Stack
- Post date March 16, 2020
- No Comments on spline with R and error with lrm function

- Tags 'days', 4, although this is not the main problem. In order to have the spline, Arm==1) attach(database_arm1) dd <-datadist(days, event) options(datadist='dd') model <- lrm(event~rcs(days, fun=exp), I am pretty new to spline regression with R and I am having some trouble, I am using the following code: attach(database) dd <-datadist(days, I hope you can help me with this. What I want to do is to plot a spline of HR of an event vs. days to event. I have 2 treatments and ideally, I subset the dataset in order to have the 2 treatments separated: database_arm1 <- subset(database, ref.zero=TRUE, x=TRUE, xlab="Days")+ theme_classic() detach(database) This code works for the overall database. Then, y=TRUE) ggplot(Predict(model, ylab="OR for event"