# This file is stored as lworld.R # This is code for analyzing the World Leisure # study of endometrial cancer. Ther are four # controls for each case and they are matched # on age. The file contains 315 records with # data on cases and controls from the Leisure # World study of endometrial cancer as related # to treatment with estrogens for menopausal # syptoms and other risk factors. See the # article by Mack et al in NEJM 294:1262-1267, # 1976 for a full description. # The variables are as follows: #Number Name Description Codes/Range #------------------------------------------------------------------------- # 1 GROUP Matched set indicator 1-63 # 2 CASE Case-control indicator 1 = Case; 0 = control # 3 AGE Age in years 55-84 # 4 AGEG Age group indicator 1 = 55-64; 2 = 65-74; 3 = 75+ # 5 EST Estrogen usage 1 = No; 2 = Yes # 6 GALL Gallbladder disease 1 = No; 2 = Yes # 7 HYP Hypertension 1 = No; 2 = Yes # 8 OB Obesity 1 = No; 2 = Yes; 3 = Unknown # 9 NON Non-estrogen drug 1 = No; 2 = Yes #------------------------------------------------------------------------- #The nine variables may be read either in free format or using the Fortran #format (1x,9f5.0). AGEG is based on the age of the case in each matched #set. # Enter the data into a data frame. set1 <- read.table("c:/stat565/lworld.txt", header=F, col.names=c("group", "case", "age", "ageg", "est", "gall", "hyp", "ob", "non")) set1$est <- set1$est-1 set1$gall <-set1$gall-1 set1$hyp <- set1$hyp-1 set1$non <- set1$non-1 set1$oby <- set1$ob set1$obu <- set1$ob set1$oby[set1$oby>2] <- 2 set1$oby <- set1$oby-1 set1$obu[set1$obu<3] <- 0 set1$obu <- set1$obu/3 # Load the survival analysis package library(survival) coxout <- coxph(Surv(group,case) ~ est + gall + hyp + non +oby+obu+strata(group), data=set1, method="exact") summary(coxout)