!
! Prentice lung cancer data (Prentice Biometrika 1973; 60: 279-288)
!
! survival time, died, trial therapy (n=standard),
! histology (SCC,SmCC,adenoCa,LCC), Karnofsky performance status,
! age at randomization, months from Dx to randomization, prior Rx
!
set data ../pedigrees
set loc time qua
set loc died aff
set loc therapy aff
set loc histol qua
set loc perform qua
set loc age qua
set loc delay qua
set loc priorRx aff
read ped lung.ped 
run
kap time died res
his time

set loc smcc aff
set loc adeno aff
set loc lcc aff
if histol eq 2 then smcc=y else smcc=n
if histol eq 3 then adeno=y else adeno=n
if histol eq 4 then lcc=y else lcc=n

set loc age.Rx qua
set loc age.perf qua
set loc age.del qua
set loc age.pri qua
set loc age2 qua
set loc age3 qua
set loc age4 qua
set loc del.pri qua
set loc del.perf qua
set loc delay2 qua
set loc delay3 qua
set loc delay4 qua
set loc perf.pri qua

age.Rx   = age*therapy
age.perf = age*perform
age.del  = age*delay
age.pri  = age*priorRx
del.pri  = delay*priorRx
del.perf = delay*perform
perf.pri = perform*priorRx

if histol eq 2 then delay2=delay else delay2=0
if histol eq 3 then delay3=delay else delay3=0
if histol eq 4 then delay4=delay else delay4=0
if histol eq 2 then age2=age   else age2=0
if histol eq 3 then age3=age   else age3=0
if histol eq 4 then age4=age   else age4=0


tab
regress time on therapy smcc adeno lcc perform age delay \
                priorRx delay2 delay3 delay4
regress time on therapy smcc adeno lcc perform age delay \
                priorRx age2 age3 age4 age.Rx age.perf

regress time on therapy smcc adeno lcc perform priorRx perf.pri 
regress time on smcc adeno lcc perform priorRx perf.pri 
