recode.check {BCRA}  R Documentation 
A function to recode the relative risk covariates and check errors.
recode.check(data, Raw_Ind=1)
data 
A data set containing all the required input data needed to perform risk projections,
such as initial age, projection age, BrCa relative risk covariates and race. See 
Raw_Ind 
The raw file indicator with default value 1.

This function is to recode the following relative risk covariates. Recoded RR covariates
are named as NB_Cat
, AM_Cat
, AF_Cat
and NR_Cat
for N_Biop
,
AgeMen
, Age1st
and N_Rels
, respectively.
N_Biop:  The number of biopsies. 
AgeMen:  Age at menarchy. 
Age1st:  Age at first live birth. 
N_Rels:  The number of first degree relatives with BrCa. 
See the following table for recoding details.
Covariate  Raw Value  Recoded to 
N_Biop  0 or 99 (unk or not applicable)  0 
1  1  
2,3,4 ... and not 99  2  
AgeMen  14,15,16 ... or 99 (unk)  0 
12,13  1  
11 and younger  2  
Age1st  19 and younger or 99 (unk)  0 
20,21,22,23,24  1  
25,26,27,28,29 or 98 (nulliparous)  2  
30,31,32 ... and not 98 and not 99  3  
N_Rels  0 or 99 (unk)  0 
1  1  
2,3,4 ... and not 99  2  
This function is also used to check consistency and errors of input data.
Let set_T1_missing
and set_T2_missing
be the checking variables for T1
and T2
.
The constraint on T1
and T2
is 20<=T1<T2<=90. If it is violated,
set_T1_missing
and set_T2_missing
and the absolute risk will be set to
the missing value NA
.
Let RacCat
be the checking variable for Race
. If the Race
value is not
included in the 11 races defined, the absolute risk will be set to the missing value NA
and RacCat
will be set to "U" (undefined). The corresponding character of Race
CharRace
will be set to "??".
Let set_HyperP_missing
and set_R_Hyp_missing
be the checking variables for
HypPlas
and R_Hyp
. Consistency patterns for the number of Biopsies and Hyperplasia are:
Requirment (A)  N_Biops =0 or 99, then HypPlas MUST = 99 (not applicable). 
Requirment (B)  N_Biops >0 and <99, then HypPlas = 0, 1 or 99. 
If ANY of the above 2 REQUIREMENTS is violated, NB_Cat
, set_HyperP_missing
and
set_R_Hyp_missing
will be set to the corresponding character "A" or "B" and the absolute
risk will be set to the missing value NA
.
The consequences to the relative risk (RR) for the above two requirements are:
(A) N_Biops
=0 or 99, HypPlas
=99 (not applicable) inflates RR by 1.00.
(B) N_Biops
>0 and <99, HypPlas
=0 (no) inflates RR by 0.93;
N_Biops
>0 and <99, HypPlas
=1 (yes) inflates RR by 1.82;
N_Biops
>0 and <99, HypPlas
=99 (unk) inflates RR by 1.00.
For remaining relative risk covariates, AgeMen
, Age1st
and N_Rels
:
AgeMen  Age at menarchy must be postive integer less than or equal to initial age T1. 
NOTE: (1) For AfricanAmerican women AgeMen<=11 are grouped with AgeMen=12  
or 13. (2) For US Born Hispanic women AgeMen is not included in the RR model  
and all values for this variable are recoded to 0.  
Age1st  Age at 1st live birth must be postive integer greater than equal to AgeMen 
and less than or equal to initial age T1.  
NOTE: (1) For AfricanAmerican women, Age1st is not included in the RR model  
and all values for this variable are recoded to 0. (2) For US Born and Foreign  
Born Hispanic women, the recoding for this variable follows:  
Age1st  19 and younger or 99 (unk)  0 
20  29  1  
30+ or 98 (nulliparous) and not 99  2  
N_Rels  The number of 1st degree relatives with BrCa must be 0,1,2.... 
NOTE: For AsianAmericans Race=611 and HispanicAmericans (US and foreign born),  
the number of 1st degree relative coded value of 2 gets grouped with 1.  
A data frame containing the error indictors, recoded covariates as well as other checking variables defined for checking the consistency of the input data.
data(exampledata) recode.check(exampledata)