data(dataqol)
# Estimation of the scores using the 'scoring.QLQC30' function:
score_dataqol=scoring.QLQC30(dataqol,id="Id",time="time")
# Merge of "score_dataqol" dataframe with the important
# variables of the dataqol dataframe as follows:
info=dataqol[,c("Id","time","date","death","Arm")]
dataqol_final=merge(score_dataqol,info,by=c("Id","time"))
# Then we reorganized the obtained "dataqol_final" dataset in order that
# the "date" variable appeared in the third position:
dataqol_final=dataqol_final[,c(1:2,18,3:17,19:20)]
# Finally, in order to apply the "TTD" function, the dataset has to be sorted by
# patient's identification number "Id" and HRQoL measures ("time"):
dataqol_final=dataqol_final[order(dataqol_final$time),]
dataqol_final=dataqol_final[order(dataqol_final$Id),]
# Time to "QL" score deterioration with a minimal clinically important difference
# of 5 points at least as compared to the baseline score:
ttd1=TTD(dataqol_final, score="QL", MCID=5)Run the code above in your browser using DataLab