Conference PaperPDF Available

Recurrent-Event Survival Analysis: 33-year Follow-up of Lymphohaematopoietic Cancer Risk in Ontario

Authors:

Abstract

Ontario and other Canadian jurisdictions have never had occupational disease surveillance systems to identify high-risk industries and target prevention efforts. The Occupational Disease Surveillance System (ODSS) was created to identify patterns and monitor trends in work-related disease in Ontario. In this study, we examined existing patterns and emerging trends in work-related lymphohaematopoietic (LH) cancer by industry groups using recurrent-event survival analysis. This paper will give examples of the counting process syntax and programming statements that apply to Recurrent-Event analysis in PROC PHREG.
Paper-3893
Recurrent-Event Survival Analysis: 33-year Follow-up of Lymphohaematopoietic
Cancer Risk in Ontario
Mamadou Dakouo, Jill MacLeod, Paul Demers, Occupational Cancer Research
Center, Ontario Canada
ABSTRACT
Ontario and other Canadian jurisdictions have never had occupational disease surveillance
systems to identify high-risk industries and target prevention efforts. The Occupational Disease
Surveillance System (ODSS) was created to identify patterns and monitor trends in work-related
disease in Ontario. In this study, we examined existing patterns and emerging trends in work-
related lymphohaematopoietic (LH) cancer by industry groups using recurrent-event survival
analysis. This paper will give examples of the counting process syntax and programming
statements that apply to Recurrent-Event analysis in PROC PHREG.
INTRODUCTION
Lymphohaematopoietic (LH) neoplasia represents one of the most common cancers induced by
chemical, physical, and infectious agents. LH represent a heterogeneous group of hematopoietic
and lymphoid cell disorders including Lymphoma, Hodgkin Lymphoma, Non-Hodgkin Lymphoma
and Myeloma [1]. A circumstance in which LH cancer may occur more than once for a given
subject is known as a “recurrent events. A common approach used to analyze recurring events
is the Counting Process (CP) approach. Modeling this type of data can be done using a Cox
Proportional Hazards (PH) model with the data layout constructed such that each subject has a
line of data corresponding to each recurrent event [2].
The Occupational Cancer Research Centre (OCRC) is exploring methods for occupational disease
surveillance in Ontario. The Occupational Disease Surveillance System (ODSS) is part of a larger
organizational program to identify patterns and monitor trends in work-related disease in
Ontario. In this study, we examined existing patterns and emerging trends in work-related LH
cancer by industry groups using recurrent event analysis in PROC PHREG for a cohort of Ontario
workers.
METHODOLOGY
DATA SOURCE
The ODSS cohort captures individuals with accepted Workplace Safety and Insurance Board
(WSIB) time-loss claims between 1983 and 2014 who are followed for disease in provincial
tumour registry, physician billing and hospitalization data. This analysis utilized WSIB time-loss
claims from 1983 to 2014 linked to Ontario Cancer Registry data (1964-2016) in the ODSS. We
used the standard tumour registry case definitions of cancer. Cohort entry corresponded to the
date of an accepted time-loss claim, and workers were subsequently followed-up for new
incidence of LH cancer.
The WSIB codes industry and occupation associated with a compensation claim using two
hierarchical coding systems, the Standard Industrial Classification (SIC) 1970 and the Canadian
Classification and Dictionary of Occupations (CCDO) 1970, respectively. This allows the risk of
disease to be examined by occupation and industry at different levels of granularity (Division,
Major and Minor levels). This study examined the risk of LH among Ontario workers at the
industry Major level.
COUNTING PROCESS APPROACH
We used the Counting Process (CP) approach in the Cox proportional hazards (PH) model to
conduct the recurrent events analysis. The standard Cox PH model formula is usually written as:
hi (t)= λ0(t)exp(β1xi1+…+βkxik)
This equation says that the hazard for individual i at time t is the product of two factors:
1. A function λ0(t) that is left unspecified, except that it can’t be negative
2. A linear function of a set of k fixed covariates, which is then exponentiated
The function λ0(t) , called the baseline hazard function ,can be regarded as the hazard function
for an individual whose covariates all have values of 0 [3]. The exponential expression of k fixed
covariates is the exponential of the sum of the k explanatory X variables [2].
The primary difference in the way the Cox model is used for analyzing recurrent event data versus
nonrecurrent (one time interval per subject) data is the way multiple time intervals on the same
subject are treated in the formation of the likelihood function maximized for the model.
For recurrent event survival data, a subject with more than one time interval remains in the risk
set until his or her last interval, after which the subject is removed from the risk set. For subjects
with two or more intervals, the different lines of data contributed by the same subject are treated
in the analysis as if they were independent contributions from different subjects, even though
they represent outcomes for the same subject. In contrast, for nonrecurrent event data, each
subject is removed from the risk set at the time of failure or censorship. The different lines of
data are treated as independent because they come from different subjects.
Table 1. Data Layout for the Counting Process Approach
worker_id= Worker identity; adcancer= LH Cancer status, adcancer _date=LH diagnostic
date, start_cancer_FC01_SICMAJ= Time start, time_cancer_FC01_SICMAJ= Time stop.
Table 1 displays the data set up to perform the counting process approach in PROC PHREG for 5
subjects with more than one LH diagnosis.
We adjusted the variances of estimated model coefficients for the likely correlation among
recurrent events on the same subject. Such adjusted variance estimates are called “robust
variance estimates” [2].
The non-informative censoring assumption and the proportional hazards assumption are very
important for the use of the Cox PH model.
The non-informative censoring assumption is met when the censored individuals are
representative of all who remained in the risk set at time t with respect to the rate of failure. The
non-informative censoring depends on the distribution of time-to-event and the distribution of
time-to-censorship [2].
The PH assumption is especially important for the covariate of interest [4]. The PH assumption
for a dichotomous variable means that the survival curves for two strata must have hazard
functions that are proportional over time (i.e. parallel hazard curves). The code of testing PH
assumption is shown below.
Worker_id
adcancer
Adcancer_date
start_cancer_FC01_SICMAJ
time_cancer_FC01_SICMAJ
XXXXXX1
1
11/29/2005
0
92
XXXXXX1
0
02/02/2011
92
155
XXXXXX2
1
02/19/2001
0
95
XXXXXX2
1
10/20/2011
95
223
XXXXXX3
1
01/12/2014
0
120
XXXXXX3
1
03/02/2014
120
122
XXXXXX4
1
07/10/2002
0
198
XXXXXX4
1
07/23/2002
198
198
proc lifetest data= adcaseandnoncasefinal method=km plots=(s,lls);
time TIME_cancer_FC01_SICMAJ * ADCANCER (0);
strata FC01_SICMAJ ;
run;
proc lifetest This procedure is used to obtain survival estimates and plots. By default, the
Kaplan-Meier method is used. It will generate output for the log rank and Wilcoxon test statistics
if stratifying by a covariate.
adcaseandnoncasefinal is the nalysis dataset name.
method=km km stands for Kaplan-Meier, it is also known as the product-limit. It is the default
method in proc lifetest to compute the survival estimates and plots. However, there are several
other methods.
Table 2. Other Methods of computing the survival estimates in proc lifetest
Method
DESCRIPTION
BRESLOW
If method=Breslow, the Breslow estimates will be computed.
FH
If method=fh, the Fleming-Harrington estimates will be computed.
LT
If method=lt, the life-table estimates (also known as actuarial estimates) will
be computed.
plots=(s,lls) this option produces the log-log survival curves and survival curves as well. If the
PH assumption is met the log-log survival curves will be parallel.
time TIME_cancer_FC01_SICMAJ*ADCANCER (0) The TIME statement defines the time-to-
event variable (TIME_cancer_FC01_SICMAJ) and the value for censorship (ADCANCER =0).
strata FC01_SICMAJ the industry group FC01_SICMAJ one specific major industry group. This
variable equals 1 if the worker is working in this industry, and 0 if they are not. Since there are
49 different industry groups, we create a dummy variable for each one. The value equals 1 if a
subject is working in a given industry, otherwise the value equals 0. The strata statement
compares survival estimates for workers in the FC01_SICMAJ industry group versus workers in all
other industry groups. In addition, the strata statement provides the log rank test and Wilcoxon
test statistics.
We can control how variables are plotted by creating a dataset that contains the survival
estimates. Use the OUTSURV= option in the PROC LIFETEST statement to create a SAS data
containing the KM survival estimates. The option OUTSURV= survpar creates a dataset called
survpar containing the survival estimates in a variable called SURVIVAL. The code is shown in the
box below.
proc lifetest data=adcaseandnoncasefinalse method=km outsurv=survpar;
time Time_cancer_FC01_SICMAJ*adcancer(0);
strata FC01_SICMAJ;
run;
proc gplot data=survpar;
title 'k-m plot by Industry group';
plot survival*Time_cancer_FC01_SICMAJ=FC01_SICMAJ/vaxis=axis1 haxis=axis2;
run;
The dataset survpar contains the survival estimates but not the log(-(log)) of the survival
estimates. We create the dataset survpar2 from survpar and defines a new log-log variable called
LLS. The proc gplot is used to create the survival curves. The code is shown in the box below.
We assumed that the data involve only time-independent variables satisfying the PH assumption.
PERFORMING COX PH FOR RECURRENT EVENT
The Counting Process model was used to perform birth year-adjusted, sex-stratified Cox PH
regression for recurrent events among workers in 49 industry groups. We created a dummy
variable and estimated the risk of LH cancer within one industry versus all other industry groups.
We developed a SAS macro program to perform the regression model for 49 industry groups (see
the complete code in Appendix). For simplicity, the code below shows how to perform recurrent-
event analysis in PROC PHREG for one industry group.
proc phreg the proc phreg can be used for survival data using a counting process data layout.
covs(aggregate) The covs(aggregate) option in proc phreg statement requests the robust
sandwich estimate for the covariance matrix. We specified the keyword aggregate enclosed in
parentheses after the COVS option, to request a sum up of the score residuals for each distinct
id pattern in the computation of the robust sandwich covariance estimate. This aggregate option
has no effects if the id statement is not specified.
proc phreg data=adcaseandnoncasefinal covs(aggregate);
model (START_cancer_FC01_SICMAJ, TIME_cancer_FC01_SICMAJ) *ADCANCER(0)
=FC01_SICMAJ YEAR_ birth;
id worker_id;
run;
data survpar2;
set survpar;
LLS=log(-log(survival));
run;
symbol1 color=blue ;
symbol2 color=red ;
proc gplot data=survpar2;
title 'cumulative hazard plot by industry group';
plot lls*Time_cancer_FC01_SICMAJ=z/vaxis=axis1 haxis=axis2;
run;
model (START_cancer_FC01_SICMAJ, TIME_cancer_FC01_SICMAJ) *ADCANCER(0)
=FC01_SICMAJ YEAR_ birth the model statement indicates that the time intervals for each
observation are defined by the variables START_cancer_FC01_SICMAJ and
TIME_cancer_FC01_SICMAJ and that ADCANCER=0 denotes a censored observation.
id worker_id The id statement defines worker_id as the variable representing each subject.
RESULTS
A total of 2188302 workers were included in the analysis. A total of 14352 LH cancers were
diagnosed among 14238 workers. There were 114 workers with more than one LH diagnoses.
Table 2 HRs for LH cancer for selected industries major level
Table 2 presents the Hazard Ratios (HR), 95% confidence intervals, the number of cases, and the
number of workers among females, males and both sexes combined (see the complete Table in
Appendix A). An increased risk of LH cancer was observed among workers in tobacco products
(for both sexes), storage (male only), electric power (male only), and transportation (male only)
industries.
CONCLUSION
The recurrent events Cox PH model is particularly useful for outcomes that may occur more than
once for a given subject, such as LH cancer.
HR(95% CI) Cases (Workers) HR(95% CI) Cases (Workers) HR(95% CI) Cases (Workers)
[15] Tobacco Products Industries 2.24 (1.11, 4.49)* 8 (435) 1.89 (1.10, 3.25)* 13 (683) 2.02 (1.32,.3.10)** 21 (1118)
[37] Storage 1.70 (0.76, 3.81) 6 (1455) 1.51 (1.18, 1.92)*** 68 (9176) 1.52 (1.21,.1.92)*** 74 (10631)
[39] Electric Power, Gas and Water Utilities 1.14 (0.65, 2.01) 12 (2249) 1.19 (1.03, 1.38)* 184 (20167) 1.19 (1.03, 1.37)* 196 (22416)
[36] Transportation 1.11 (0.89, 1.39) 80 (18621) 1.09 (1.02, 1.17)* 858 (117426) 1.09 (1.02,.1.17)** 938 (136047)
[48] Amusement an d Recreati on Services 1.11 (0.77, 1.62) 28 (8359) 1.08 (0.83, 1.41) 56 (11813) 1.09 (0.88, 1.35) 84 (20172)
[28] Transportation Equipment Industries 0.94 (0.79, 1.13) 124 (23963) 1.10 (1.03, 1.17)** 966 (103896) 1.08 (1.01, 1.14)* 1090 (127859)
[50] Personal Services 1.21 (0.91, 1.63) 45 (6809) 0.91 (0.64, 1.28) 34 (6154) 1.06 (0.85, 1.32) 79 (12963)
[41] Retail Trad e 1.01 (0.92, 1.10) 532 (112779) 1.07 (1.00, 1.14)* 1065 (175784) 1.05 (1.00, 1.11) 1597 (288563)
Female
Male
Overall
REFERENCES
1. National Center for Environmental Assessment Office of Research and Development U.S.
Environmental Protection Agency Washington, D.E., Lymphohematopoietic Cancers Induced by
Chemicals and Other Agents: Overview and Implications for Risk Assessment. 2012, National
Center for Environmental Assessment
2. Kleinbaum, D.G. and M. Klein, Survival Analysis: A Self‐Learning Text, Third Edition. 2012: New
York, NY : Springer New York 2012.
3. Allison, P.D., Survival Analysis Using SAS®: A Practical Guide, Second Edition. . 2010: Cary, NC: SAS
Institute Inc.
4. Rena Jie Sun, D.C., Analysis of Survival Data with Recurrent Events Using SAS. SAS GLOBAL FORUM
2010.
ACKNOWLEDGEMENTS
We would like to thank Dr. Nathan DeBono, Chloe Logar-Henderson, Sharara Shakik, and Hunter
Warden for their thoughtful review of this paper. We would also like to thank the funders for
their continued support.
CONTACT INFORMATION
Mamadou Dakouo, Research Associate BiostatisticianOccupational Cancer Research Center-
525 University Avenue Toronto, Canada,
mamadou.dakouo@cancercare.on.ca
DISCLOSURE
The views expressed in this research are those of the authors and do not necessarily reflect the
official policy or position of Cancer Care Ontario.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or
trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.
Other brand and product names are trademarks of their respective companies.
Appendix
Appendix A. Tale 3. Output table for 49 industry groups
HR(95% CI) Cases (Workers)
HR(95% CI)
Cases (Workers)
HR(95% CI) Cases (Workers)
[1/2/3] Agriculture 0.79 (0.55, 1.12) 31 (8689) 0.85 (0.71, 1.00) 132 (26431) 0.83 (0.71, 0.97)* 163 (35120)
[4/5 ] Forestry -- 0 (449) 0.87 (0.69, 1.10) 73 (9851) 0.86 (0.68, 1.08) 73 (10300)
[6/7/8] Fishing and Trapping -- 0 (33) -- <5 (391) -- <5 (424)
[9] Metal Mines -- <5 (247) 1.28 (1.10, 1.48)** 187 (13637) 1.28 (1.11, 1.48)*** NR (13884)
[10/11] Non-Metal Mines -- <5 (63) 1.19 (0.66, 2.14) 11 (1026) 1.23 (0.70, 2.17) NR (1089)
[12] Quarries and Sand Pits -- 0 (102) 1.29 (0.92, 1.80) 35 (3923) 1.27 (0.91, 1.77) 35 (4025)
[13] Services Incidental to Mining -- 0 (67) 0.83 (0.55, 1.24) 25 (4580) 0.82 (0.55, 1.23) 25 (4647)
[14] Food and Beverage Industries 0.87 (0.74, 1.03) 148 (27453) 0.94 (0.86, 1.04) 436 (61363) 0.92 (0.85, 1.00) 584 (88816)
[15] Tobacco Products Industries 2.24 (1.11, 4.49)* 8 (435) 1.89 (1.10, 3.25)* 13 (683) 2.02 (1.32, 3.10)** 21 (1118)
[16] Rubber and Plastics Products Industries 0.81 (0.66, 1.01) 84 (18121) 0.87 (0.76, 1.00)* 206 (35583) 0.85 (0.76, 0.96)** 290 (53704)
[17] Leather Industries 0.42 (0.23, 0.76)** 11 (3481) 1.11 (0.72, 1.72) 21 (2205) 0.71 (0.50, 1.01) 32 (5686)
[18] Textile Industries 0.72 (0.54, 0.97)* 46 (8881) 0.91 (0.71, 1.15) 71 (10437) 0.82 (0.69, 0.99)* 117 (19318)
[19] Knitting Mills 0.94 (0.59, 1.48) 18 (2332) 0.65 (0.27, 1.55) 5 (963) 0.85 (0.56, 1.28) 23 (3295)
[20] Clothing Industries 0.82 (0.62, 1.08) 51 (7381) 0.66 (0.40, 1.10) 15 (2757) 0.78 (0.61, 0.99)* 66 (10138)
[21] Wood Industries 0.74 (0.46, 1.22) 16 (4165) 1.03 (0.90, 1.18) 215 (34012) 1.01 (0.88, 1.15) 231 (38177)
[22] Furniture and Fixture Industries 0.98 (0.71, 1.36) 36 (5535) 0.89 (0.76, 1.04) 157 (24731) 0.90 (0.78, 1.04) 193 (30266)
[23] Paper and Allied Industries 0.80 (0.55, 1.18) 27 (5179) 0.95 (0.82, 1.12) 159 (20108) 0.93 (0.80, 1.07) 186 (25287)
[24] Printing, Publishing and Allied
1.03 (0.78, 1.37) 50 (8681) 0.93 (0.76, 1.12) 108 (17320) 0.96 (0.82, 1.12) 158 (26001)
[25] Primary Metal Industries 0.98 (0.59, 1.62) 15 (2494) 1.05 (0.95, 1.16) 389 (39656) 1.04 (0.95, 1.15) 404 (42150)
[26] Metal Fabricating Industries (except
Machinery and Transportation Equipment
Industries)
0.83 (0.67, 1.02) 90 (18837) 0.92 (0.85, 0.99)* 681 (108917) 0.90 (0.84, 0.97)** 771 (127754)
[27] Machinery Industries (except Electrical
Machinery)
0.86 (0.56, 1.31) 22 (4717) 1.04 (0.93, 1.17) 312 (37148) 1.03 (0.92, 1.14) 334 (41865)
[28] Transportation Equipment Industries 0.94 (0.79, 1.13) 124 (23963) 1.10 (1.03, 1.17)** 966 (103896) 1.08 (1.01, 1.14)* 1090 (127859)
[29] Electrical Products Industries 0.88 (0.72, 1.07) 97 (15409) 0.97 (0.84, 1.12) 188 (23158) 0.94 (0.83, 1.05) 285 (38567)
[30] Non?Metallic Mineral Products
Industries
1.04 (0.67, 1.62) 20 (2696) 0.95 (0.81, 1.10) 165 (22229) 0.95 (0.83, 1.10) 185 (24925)
[31] Petroleum and Coal Products -- 0 (85) 1.01 (0.52, 1.94) 9 (1074) 0.96 (0.50, 1.85) 9 (1159)
[32] Chemical and Chemical Products
Industries
0.76 (0.53, 1.09) 29 (6154) 1.09 (0.91, 1.30) 123 (15405) 1.00 (0.86, 1.18) 152 (21559)
[33] Miscellaneous Manufacturing
0.87 (0.65, 1.18) 43 (7567) 0.97 (0.79, 1.19) 92 (13946) 0.93 (0.79, 1.11) 135 (21513)
[34] General Contractors 0.71 (0.41, 1.23) 13 (4339) 0.99 (0.90, 1.08) 479 (70483) 0.98 (0.89, 1.07) 492 (74822)
[35] Special-Trade Contractors 1.17 (0.77, 1.79) 22 (4861) 0.92 (0.86, 0.99)* 850 (140513) 0.93 (0.87, 1.00)* 872 (145374)
[36] Transportation 1.11 (0.89, 1.39) 80 (18621) 1.09 (1.02, 1.17)* 858 (117426) 1.09 (1.02, 1.17)** 938 (136047)
[37] Storage 1.70 (0.76, 3.81) 6 (1455) 1.51 (1.18, 1.92)*** 68 (9176) 1.52 (1.21, 1.92)*** 74 (10631)
[38] Communication 1.32 (1.05, 1.65)* 77 (10858) 1.04 (0.89, 1.22) 168 (20132) 1.11 (0.98, 1.27) 245 (30990)
[39] Electric Power, Gas and Water Utilities 1.14 (0.65, 2.01) 12 (2249) 1.19 (1.03, 1.38)* 184 (20167) 1.19 (1.03, 1.37)* 196 (22416)
[40] Wholesale Trade 0.94 (0.78, 1.13) 116 (27092) 1.01 (0.93, 1.09) 718 (124159) 1.00 (0.93, 1.07) 834 (151251)
[41] Retail Trade 1.01 (0.92, 1.10) 532 (112779) 1.07 (1.00, 1.14)* 1065 (175784) 1.05 (1.00, 1.11) 1597 (288563)
[42] Finance Industries 0.81 (0.43, 1.50) 10 (1649) 0.93 (0.63, 1.38) 25 (3288) 0.89 (0.64, 1.24) 35 (4937)
[43/44] Insurance and Real Estate 1.24 (0.93, 1.65) 48 (7120) 1.07 (0.87, 1.32) 90 (11998) 1.12 (0.95, 1.33) 138 (19118)
[45] Education and Related Services 1.29 (1.15, 1.43)*** 364 (59341) 1.34 (1.21, 1.48)*** 392 (39631) 1.32 (1.23, 1.42)*** 756 (98972)
[46] Health and Welfare Services 1.16 (1.08, 1.25)*** 897 (149471) 1.08 (0.94, 1.23) 216 (29169) 1.15 (1.07, 1.22)*** 1113 (178640)
[47] Religious Organizations 1.31 (0.59, 2.91) 6 (791) 1.28 (0.61, 2.69) 7 (672) 1.29 (0.75, 2.23) 13 (1463)
[48] Amusement and Recreation Services 1.11 (0.77, 1.62) 28 (8359) 1.08 (0.83, 1.41) 56 (11813) 1.09 (0.88, 1.35) 84 (20172)
[49] Services to Business Management 0.96 (0.78, 1.17) 96 (27177) 1.15 (1.03, 1.28)* 327 (66729) 1.10 (1.00, 1.21) 423 (93906)
[50] Personal Services 1.21 (0.91, 1.63) 45 (6809) 0.91 (0.64, 1.28) 34 (6154) 1.06 (0.85, 1.32) 79 (12963)
[51] Accommodation and Food Services 0.95 (0.85, 1.07) 352 (86144) 0.96 (0.86, 1.08) 316 (67313) 0.95 (0.88, 1.03) 668 (153457)
[52] Miscellaneous Services 1.05 (0.87, 1.25) 119 (23361) 0.99 (0.86, 1.14) 190 (36468) 1.01 (0.91, 1.14) 309 (59829)
[53] Federal Administration 0.83 (0.65, 1.05) 67 (14561) 0.98 (0.84, 1.14) 163 (18201) 0.93 (0.82, 1.06) 230 (32762)
[54] Provincial Administration 1.05 (0.87, 1.28) 105 (18366) 1.08 (0.94, 1.24) 205 (25423) 1.07 (0.95, 1.19) 310 (43789)
[55] Local Administration 1.17 (1.00, 1.37)* 166 (35687) 1.16 (1.06, 1.26)*** 604 (74088) 1.16 (1.08, 1.25)*** 770 (109775)
[56] Other Government Offices 1.03 (0.67, 1.59) 21 (2331) 1.34 (1.13, 1.59)*** 140 (9862) 1.29 (1.10, 1.51)** 161 (12193)
Female
Male
Overall
Appendix B. SAS macro program to perform the COX PH for 49 industry groups
%macro hrs_sicmaj (
liborgnldsn=cancer , /*LIBRARY for input DATASETS */
liboutput=lymheam, /*LIBRARY for output DATASETS */
dsnoriginal= , /*Input dataset name*/
dsnspe_cancer= , /*Output dataset name*/
cancer=, /*Cancer type, Example. LH cancer */
sex= /*Sex*/
);
proc Sql noprint;
/*MAJOR LEVEL*/
select distinct name into: var_sicmaj separated by " "
from dictionary.columns
where libname = %upcase("&liborgnldsn") and memname =
%upcase("&dsnoriginal") and name like %nrstr("FC_%_SICMAJ");
Select count(name) into :count_var_sicmaj
From dictionary.columns
Where libname=%upcase("&liborgnldsn" ) and memname =
%upcase("&dsnoriginal") and name like %nrstr("FC_%_SICMAJ");
quit;
data &liboutput..Z_HR_sicmaj_&cancer&sex;
length PARAMETER $28 HR_CI $27 PROBCHISQ 6.4 Number_CASES&sex umber_Workers&sex
6.;
run;
%do ii=1 %to &count_var_sicmaj;
%let var_sicmaj_bin = %scan(&var_sicmaj, &ii, ' ');
ods output ParameterEstimates=HR_&cancer._&var_sicmaj_bin&sex;
proc phreg data=&liboutput..&dsnspe_cancer covs(aggregate);
class &var_sicmaj_bin (param=ref ref = "0");
where num_sex=&sex and time_cancer_&var_sicmaj_bin>0;
model
(start_cancer_&var_sicmaj_bin,time_cancer_&var_sicmaj_bin)*adcancer(0)=&var_sicmaj_bin
year_new_bd_ocr/risklimits;
id worker_id;
hazardratio &var_sicmaj_bin / diff=ref;
run;
/*FORMATTING OUTPUT*/
data &liboutput..HR_&cancer._&var_sicmaj_bin&sex;
length PARAMETER $ 15. HR_CI $ 35.;
set HR_&cancer._&var_sicmaj_bin&sex ( keep = PARAMETER HAZARDRATIO
HRLOWERCL HRUPPERCL PROBCHISQ where = (PARAMETER = "&var_sicmaj_bin" ) );
R_HAZARDRATIO = put(HAZARDRATIO, 4.2);
R_HRLOWERCL = put(HRLOWERCL, 4.2);
R_HRUPPERCL = put(HRUPPERCL, 4.2);
if 0.01<=PROBCHISQ<0.05 then
HR_CI = strip(R_HAZARDRATIO) || " (" || strip(R_HRLOWERCL) || ", " ||
strip(R_HRUPPERCL) || ")" || "*";
else if 0.001<=PROBCHISQ<0.01 then
HR_CI = strip(R_HAZARDRATIO) || " (" || strip(R_HRLOWERCL) || ", " ||
strip(R_HRUPPERCL) || ")" || "**";
else if PROBCHISQ<0.001 then
HR_CI = strip(R_HAZARDRATIO) || " (" || strip(R_HRLOWERCL) || ", " ||
strip(R_HRUPPERCL) || ")" || "***";
else HR_CI = strip(R_HAZARDRATIO) || " (" || strip(R_HRLOWERCL) || ", " ||
strip(R_HRUPPERCL) || ")";
drop HAZARDRATIO HRLOWERCL HRUPPERCL R_HAZARDRATIO R_HRLOWERCL
R_HRUPPERCL;
run;
/*COUNTING WORKERS AND CASES*/
proc Sql noprint;
create table workers_&var_sicmaj_bin&sex as
select count(distinct(WORKER_ID)) as Number_Workers&sex
from &liboutput..&dsnspe_cancer
where NUM_SEX=&sex and TIME_cancer_&var_sicmaj_bin>0 and
&var_sicmaj_bin=1;
create table cases_&var_sicmaj_bin&sex as
select count(distinct (WORKER_ID)) as Number_CASES&sex
from &liboutput..&dsnspe_cancer
where NUM_SEX=&sex and TIME_cancer_&var_sicmaj_bin>0 and
&var_sicmaj_bin=1 and adcancer=1;
create table cases_work_&var_sicmaj_bin&sex as
select Number_Workers&sex , Number_CASES&sex
from cases_&var_sicmaj_bin&sex , workers_&var_sicmaj_bin&sex;
quit;
/*MERGING TABLE*/
proc Sql noprint;
create table HR_&cancer._&var_sicmaj_bin&sex as
select*
from &liboutput..HR_&cancer._&var_sicmaj_bin&sex,
cases_work_&var_sicmaj_bin&sex
;
quit;
proc Append base=&liboutput..Z_HR_sicmaj_&cancer&sex
data=HR_&cancer._&var_sicmaj_bin&sex force;
run;
%end;
%mend hrs_sicmaj;
/*Calling MACRO */
%hrs_sicmaj (
liborgnldsn=cancer ,
liboutput=lymheam, /*DEFINE LIBRARY WHERE ARE DATASETS */
dsnoriginal=dsn_n2188302,
dsnspe_cancer=adcaseandnoncasefinal,
cancer=lymheam ,
sex=1
)
%hrs_sicmaj (
liborgnldsn=cancer ,
liboutput=lymheam, /*DEFINE LIBRARY WHERE ARE DATASETS */
dsnoriginal=dsn_n2188302,
dsnspe_cancer=adcaseandnoncasefinal,
cancer=lymheam ,
sex=0
)
ResearchGate has not been able to resolve any citations for this publication.
Analysis of Survival Data with Recurrent Events Using SAS
  • Rena Jie Sun
Rena Jie Sun, D.C., Analysis of Survival Data with Recurrent Events Using SAS. SAS GLOBAL FORUM 2010.