Big-Life-Lab / cchsflow

Variable transformation and harmonization for the Canadian Community Health Survey
https://big-life-lab.github.io/cchsflow/
Other
11 stars 7 forks source link

CCHS 2015 to 2018 shared variables for cardiovascular disease #96

Closed DougManuel closed 2 years ago

DougManuel commented 3 years ago

Introduction

We accept requests and PR for new variables. Providing information about your request helps discussion about whether and how to include the variable.

Is the variable an existing CCHS variable, or a derived variable?

Existing variables in CCHS 2015 to 2018 used for implementation of CVDPoRT algorithm .

What is the name of the variable?

Approximately, 12 - 15 variables. Description of variable

Variables covering sociodemographics, health behaviours, diseases.

Is it consistent across CCHS cycles? If not, explain changes between cycles

There are concerns about consistency with variables prior to 2015. As well, this project used CCHS shared data.

Which cycles is this variable found?

2015-2018.

Derived variables only. What variables are used to create this variable?

TBA

New variables will be added to cchs-shared branch.

abadereddeen commented 3 years ago

SAS code to prepare CCHS2017-2018 for CVDPoRT implementation: ***prepare CCHS2017_18;

**code variables in CCHS 2017/18 TO apply CVDPoRT 1)variables required to apply CVDPoRT: Age PackYears (Continuous) smoking category (4-level) drinking category (former (or never) vs current) drinks last week (Continuous) BMI (continuous) Physical Activity (METs hour/day)(Continuous) Education category (4-level) Diabetes (binary) HTN (binary)

2)variables required for excusions

self reported heart disease self reported stroke pregnant; # data codes; set CCHS17_18;

if ccc_090>1;// if ccc_085>1;// if MAC_025>1;/pregnancy/

age=DHH_AGE; sex=DHH_sex; /smoking/ smkrtype= SMKDVSTY ; /Type of smoker / n_years_smkd= SMKDVYCS; /Number of years smoked (current daily smokers) - (D)/ n_cig_frmr_dly_smkr= SMK_075; /Number of cigarettes per day (former daily smoker)/ age_strtd_frmr_dly_smk= SMK_040; /Age - started smoking daily (former daily smoker) - (G) / ever_dly_smkd= SMK_030; /Ever smoked daily / n_cig_occ_smkr= SMK_050; /Number of cigarettes per day (occasional smoker) / n_cig_dly_smkr= SMK_045; /Number of cigarettes per day (daily smoker)/ age_strtd_dly_smk= SMK_040; /Age - started smoking daily (daily smoker) - (G) / stpd_nvr_dly_smkr=SMK_060; /stopped smoking- never daily smoker / stpd_frmr_dly_smkr= SMK_080; /stopped smoking- former daily smoker / stpd_nvr_dly_smkr_3_11=SMK_070; /stopped smoking-3-11 years never daily smoker / stpd_frmr_dly_smkr_3_11=SMK_090; /stopped smoking 3-11 years- former daily smoker / hund_or_more_cig=SMK_020; / smoked 100 or more cigarettes life time / a_whole_cig_ever= SMK_025; / smoked a whole cigarettes ever / sr_type_of_smkr=SMK_005; / self reported type of smoker / age_frst_whl_cig=SMK_035; /age at first whole cigarette/ n_days_atl_1cig=SMK_055; / number of days smoked at least 1 cigarette/

/alcohol/

drnkr_type= ALCDVTTM; / Tyrpe of drinker/ n_drnks_lst_week=ALWDVWKY; / Number of drinks past week/ /A_dly_alc_cons=ALWDDLY; Average daily alcohol consumption / drnk_12_months= ALC_010; / Drank alcohol in past 12 months/

/asked only in territories/ Juice= FVCDVJUI; /How often do you usually drink fruit juices such as orange, grapefruit or tomato? / Fruit= FVCDVFRU; /Not counting juice, how often do you usually eat fruit?/ salad= FVCDVGRN; /How often do you (usually) eat green salad? / potato=FVCDVPOT; /How often do you usually eat potatoes, not including french fries, fried potatoes, or potato chips?/ carrot= FVCDVORA; /How often do you (usually) eat carrots?/ otherveg= FVCDVVEG; /Not counting carrots, potatoes, or salad, how many servings of other vegetables do you usually eat? /
totalveg=FVCDVTOT; /Daily consumption - total fruits and vegetables - (D)/

/**** Continous smoking variable **/

   **Time since quit;

        if stpd_frmr_dly_smkr>4 and stpd_frmr_dly_smkr_3_11>900
                then tsq_ds=.;
       else if stpd_frmr_dly_smkr=1 then tsq_ds=0.5;
         else if stpd_frmr_dly_smkr=2 then tsq_ds=1.5;
          else if stpd_frmr_dly_smkr=3 then tsq_ds=2.5;
           else if stpd_frmr_dly_smkr=4 and stpd_frmr_dly_smkr_3_11<900
           then tsq_ds=stpd_frmr_dly_smkr_3_11;
           else tsq_ds=.;
      if stpd_nvr_dly_smkr>4 and stpd_nvr_dly_smkr_3_11>900
                then tsq_nds=.;
       else if stpd_nvr_dly_smkr=1 then tsq_nds=0.5;
         else if stpd_nvr_dly_smkr=2 then tsq_nds=1.5;
          else if stpd_nvr_dly_smkr=3 then tsq_nds=2.5;
           else if stpd_nvr_dly_smkr=4 and stpd_nvr_dly_smkr_3_11<900
           then tsq_nds=stpd_frmr_dly_smkr_3_11;
           else tsq_nds=.;

If smkrtype =1 then do;     /*Daily smokers*/

    if age_strtd_dly_smk<900 and n_cig_dly_smkr<900  then
        packyears=max((age-age_strtd_dly_smk)*(n_cig_dly_smkr/20), 0.0137);
    else packyears=.;   
 end;

  /*Occasional smokers, it was discussed with team about splitting
 this group into always occasional vs current occ former daily
 decision don't split*/

 else If smkrtype=2 then do;    /* current occasional smokers */

        If n_cig_occ_smkr<900 and n_days_atl_1cig<90 and age_frst_whl_cig<900 then
        packyears=((max(n_cig_occ_smkr*n_days_atl_1cig/30,1)/20)*(age-age_frst_whl_cig));
        else packyears=.;

      end;

else if smkrtype=3 then do; /* Former daily, current non smokers*/

        if n_cig_frmr_dly_smkr<900 and age_strtd_frmr_dly_smk<900
        and (not missing(tsq_ds)) then
        packyears=max((age-age_strtd_frmr_dly_smk-tsq_ds)*n_cig_frmr_dly_smkr/20, 0.0137);
        else packyears=.;   

        end;
else if smkrtype in (4,5)   then do; /* former occasional, current non smokers, or exprimental smoker current non*/

         if hund_or_more_cig =1 then
                packyears=0.0137;
        else if hund_or_more_cig = 2 then
                packyears=0.007;
        end;        

else if smkrtype=6 then do; / Never Smoked/

                packyears=0;
        end;

else do; smoker=.; eversmoker=.; everdailysmoker=.; packyears=.; end;

**former smoker stopped in 5yr; if stpd_nvr_dly_smkr<4 or stpd_frmr_dly_smkr<4 or (stpd_nvr_dly_smkr=4 and stpd_nvr_dly_smkr_3_11 <=5) or (stpd_frmr_dly_smkr=4 and stpd_frmr_dly_smkr_3_11 <=5) then Frmr_smkr_in_5=1;

 else Frmr_smkr_in_5=0;

/stopped smoking more than 5 years ago/

 if (stpd_nvr_dly_smkr=4  and  stpd_nvr_dly_smkr_3_11 >5 and stpd_nvr_dly_smkr_3_11<900)  or

(stpd_frmr_dly_smkr=4 and stpd_frmr_dly_smkr_3_11>5 and stpd_frmr_dly_smkr_3_11<900 ) then Frmr_smkr_mt_5=1; else Frmr_smkr_mt_5=0;

if smkrtype=2 or smkrtype=1 then do; Frmr_smkr_mt_5=0 ; Frmr_smkr_in_5=0; end;

if smkrtype in (3,4,5) and Frmr_smkr_mt_5+Frmr_smkr_in_5=0 then do; Frmr_smkr_mt_5=. ; Frmr_smkr_in_5=. ; end;

if smkrtype in (1,2) then smoking_cat3=1;/current/ else if smkrtype in (3,4,5) then smoking_cat3=2;/former/ else if smkrtype =6 then smoking_cat3=3;/never/ else smoking_cat3=.;

if smoking_cat3=1 then smoking_cat4=1;/current/ else if smoking_cat3=2 and Frmr_smkr_in_5=1 then smoking_cat4=2;/former quit in 5yr/ else if smoking_cat3=2 and Frmr_smkr_mt_5=1 then smoking_cat4=3;/former quit more than 5yr/ else if smoking_cat3=3 then smoking_cat4=4;/never/ else smoking_cat4=.;

****Alcohol; if n_drnks_lst_week=996 then DrinksLastWeek=0; else if n_drnks_lst_week=999 then DrinksLastWeek=.; else DrinksLastWeek=n_drnks_lst_week;

if drnkr_type=3 then FormerDrinker=1; else if drnkr_type=9 then FormerDrinker=.; else FormerDrinker=0;

*redo PAADVMVA without Active transportation, please confirm; compared to original code, variables presenting Atcive transportation (PAA_005,PAA_015,PAA_020) where removed from PAADVMVA; if DOPAA = 2 then PAADVMVA1=99996; else if DHH_AGE<18 then PAADVMVA1=99996; else if (PAA_030 in (7,8,9) or PAA_035 in (7,8,9) or PAA_045 in (997, 998, 999) or PAA_050 in (9997, 9998, 9999) or PAA_060 in (7,8,9) or PAA_065 in (7,8,9) or PAA_075 in (997, 998, 999) or PAA_080 in (9997, 9998, 9999)) then PAADVMVA1=99999; else if (PAA_030 = 2 or PAA_035 = 2) and (PAA_060 = 2 or PAA_065 = 2) then PAADVMVA1=0; else PAADVMVA1=(PAA_04560 +PAA_050 +PAA_07560 +PAA_080);

***the following is provided by Jose; if DOPAA = 2 then PhysicalActivity = 99996;/inclusion flag*/

else if DHH_AGE < 18 then PhysicalActivity = 99996;/redundent/

else if PAADVMVA1 IN (99997, 99998, 99999) or PAADVVIG IN (99997, 99998, 99999) then PhysicalActivity = 99999;

else if PAADVMVA1 = 0 then PhysicalActivity = 0;

else if (0 < PAADVMVA1 <= 10080 and 0 =< PAADVVIG <= 10080) then PhysicalActivity = (((PAADVMVA1 - PAADVVIG)3 + PAADVVIG6)/7)/60;

if PhysicalActivity=99999 then PhysicalActivity=.;

**education;

education_cat3=EHG2DVH3; if (EHG2_01 in (1, 2) or EHG2_02 = 2) and (EHG2_03 = 2 or EHG2_04 = 1) then education_cat4=1;/NoHs/ else if ((EHG2_02 = 1 and EHG2_03 = 2) or EHG2_04 = 2) then education_cat4=2;/Hs/ else if EHG2_04 in (3, 4, 5, 6) then education_cat4=3;/Some ps/ else if EHG2_04 =7 then education_cat4=4;/ ps/ else education_cat4=.; **diseases; if CCC_095=1 then DM=1; else if CCC_095 in (2,6) then DM=0; else DM=.;

if CCC_065=1 then HTN=1; else if CCC_065 in (2,6) then HTN=0; else HTN=.;

***BMI ; if HWTDVBMI<900 then BMI=HWTDVBMI; else BMI=.;

run;

abadereddeen commented 3 years ago

prepare CCHS2017_SAScode.docx