window push version 10.0 window push set more on window push log using Framingham.TimeDependent.log, replace window push * Framingham.TimeDependent.log window push * window push * Perform hazard regressions of gender on CHD risk window push * using age as the time variable. Explore models window push * with time dependent covariates for sex window push * window push use C:\WDDtext\2.20.Framingham.dta, clear window push generate time= followup/365.25 window push generate male = sex==1 window push label define male 0 "Women" 1 "Men" window push label values male male window push * window push * Calculate the relative risk of CHD for men relative to women using window push * age as the time variable. window push * window push generate exitage = age+time window push stset exitage, enter(time age) failure(chdfate) window push stcox male window push * window push * Perform hazard regression with time dependent covariates for sex window push * window push tabulate chdfate male window push * window push * Split each patient's record into one or more records so that each window push * record describes one epoch with constant covariates for the epoch. window push * window push generate exit = exitage window push stset exit, id(id) enter(time age) failure(chdfate) window push list id male age exit chdfate if id == 924 window push stsplit enter, at(50 60 70 80) window push list id male enter exit chdfate if id == 924 window push replace enter=age if id~=id[_n-1] window push generate male1 = male*( exit <= 50) window push generate male2 = male*(enter >= 50 & exit <= 60) window push generate male3 = male*(enter >= 60 & exit <= 70) window push generate male4 = male*(enter >= 70 & exit <= 80) window push generate male5 = male*(enter >= 80) window push list id male? enter exit chdfate if id == 924 window push generate testmale = male1 + male2 + male3 + male4 + male5 window push tabulate chdfate testmale, missing window push more window push stset exit, id(id) enter(time enter) failure(chdfate) window push stcox male? window push test male1 = male2 = male3 = male4 = male5 window push lincom male1 - male2 window push lincom male2 - male3 window push lincom male3 - male4 window push lincom male4 - male5 window push generate male34 = male3 + male4 window push summarize male34 window push stcox male1 male2 male34 male5 window push test male1 = male2 = male34 = male5 window push lincom male1 - male2 window push lincom male2 - male34 window push lincom male34 - male5 window push log close