Skip to content

Instantly share code, notes, and snippets.

@MJacobs1985
Created November 9, 2022 16:17
Show Gist options
  • Save MJacobs1985/39c541a3a5fb8b8e249635ebccf80a88 to your computer and use it in GitHub Desktop.
Save MJacobs1985/39c541a3a5fb8b8e249635ebccf80a88 to your computer and use it in GitHub Desktop.
total$timef <-as.factor(total$time)
total$BMI<-total$Weight_at_consultation/((total$Length_at_consultation/100)^2)
## Order data and remove duplicates
head(total%>%group_by(Patientnr,time)%>%arrange(Patientnr,time));dim(total)
total<-total[!duplicated(total),];dim(total)
## The time and Survtime need to be on the same scale for joint modelling - transform to weeks
total$SurvTimeWeek<-total$SurvTime/7
pancreas$SurvTimeWeek<-pancreas$SurvTime/7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment