*********************************************************************** * * * exer7-1-do.txt * * * * PURPOSE: analysis of laryngeal cancer data * * * * DATE: 01/05/21 * * * *********************************************************************** *** *** input the data and label *** infile stage time age year status using larynx.dat label variable stage "stage at diagnosis" label variable time "time (years)" label variable age "age" label variable year "year of entry" label variable status "status" gen stage34 = stage recode stage34 1/2=0 3/4=1 stset time, failure(status) *** *** get the KM listing *** sts list, by(stage34) *** *** tests for stage34 *** sts test stage34, logrank sts test stage34, wilcoxon *** *** tests for stage *** sts test stage, logrank sts test stage, wilcoxon *** *** KM plots for stage34 and stage *** sts graph, by(stage34) lost sts graph, by(stage) *** *** Cox regression *** xi: stcox i.stage lrtest, saving(0) stcox stage lrtest, saving(1) lrtest, model(0) using(1) *** *** Cox model S(t) and KM *** stcoxkm, by(stage)