1 of 20

Data management: Preparing your data for analysis

Tigist W. (MD, MPH)

November, 2022

2 of 20

Content

  • Definition of data management
  • Data coding
  • Data cleaning
  • Data processing and organization

3 of 20

Data management: Definition

  • Collected data…………Analyzed (to answer our research question)

            • Coded
            • Cleaned and validated
            • Stored
            • Processed and organized

  • Data management software: Epi Info, SPSS, STATA, SAS…

4 of 20

Data coding

  • Raw data πŸ‘ͺ Group (categorize) πŸ‘ͺ Assign codes (0,1,2…)

  • Purpose
    • Statistical software read numerical codes rather than non-numerical information

5 of 20

Data coding cont…

  • Categorical variables
    • Three possible types

1. Already coded (Structured questions)

E.g., Gender: 1. Male, 2. Female

2. Partly coded (Semi-structured questions)

E.g., Drug discontinuation reasons: 1. Drug side effect, 2. Unavailability of Drug, 3. Cost of drug, 4. Other, Specify______________

2. Uncoded (Open ended questions)

E.g., Drug discontinuation reasons:________

  • Numeric variables
    • All are uncoded (Open ended questions)

E.g., Age (in years):_______

Possible types of questions

6 of 20

  • Creating codes
    • Partly open ended questions (other group responses)
    • Entirely open ended questions

    • Numerical values
      • E.g., Age (in years) ____ πŸ‘ͺ 10-19, 20-29, 30-39, …
      • How to create the categories?
        • Statistics (Sturges rule) Vs Science (clinically meaningful categories)

Drug discontinuation reasons

Frequency (%)

Drug side effect

120 (30%)

Unavailability of Drug

95 (23.8%)

Cost of drug

83 (20.8%)

Other

  • Religion

85 (21.3%)

  • Other reasons

17 (4.25%)

Total study population

400 (100%)

Data coding cont…

7 of 20

Data coding: Coding tips cont…

  • Give each data entry a unique ID

  • Create functional (analyzable) group
    • E.g., Which of the following symptoms do you have? 1. Fever, 2. Cough, 3. SOB, 4. Headache
      • Do you have fever: 1. No, 2. Yes
      • Do you have cough: 1. No, 2. Yes
      • Do you have SOB: 1. No, 2. Yes
      • Do you have Headache: 1. No, 2. Yes

    • 0, 1 or 1, 2πŸ‘ͺ Dependent variable code: 0, 1

  • Mutually exclusive, exhaustive, and precisely defined categories
    • E.g., Age category
      • 20-29, 30-39, 40-49 Vs 20-30, 30-40, 40-50

8 of 20

Data coding: Coding tips cont…

    • Consistent coding E.g.,
    • Fever: 1. No, 2. Yes and Cough: 1. No, 2. Yes
      • Fever: 1. No, 2. Yes and Cough: 1. Yes, 2. No
    • Hypertension: 1. No, 2. Yes,
    • BMI: 1. Normal, 2. Underweight, 3. Over weight 4. Other
      • Hypertension: 1. No, 2. Yes
      • BMI: 1. Underweight, 2. Normal, 3. Over weight

  • Giving the reference category the smallest code for all variables.

  • Missing value coding

- Give it a unique code

9 of 20

Practice

Data coding

https://forms.gle/qRjBGVL4qA2spgTT9

9

10 of 20

Data cleaning οΏ½(data cleansing/ wash/ scrubbing)

  • Detecting and managing errors

  • Has to be done carefully not to lose valid data.

11 of 20

Data cleaning cont…

12 of 20

Practice

Data cleaning

https://forms.gle/mcan91AaMcGivMc56

12

13 of 20

Data processing and organization (preliminary analysis)

  • Step 1: After data is coded and cleaned, run frequency for all variables to check the following;
    • Small frequencies
      • Responses with < 5%
    • Coding errors

  • Step 2: Then do Data transformation as needed
    • Creating new codes
      • To code partly/entirely open ended questions & numeric variables
    • Merging groups
      • To handle small frequencies
    • Recoding
      • To create new categories and correct wrong/inconsistent codes

14 of 20

Data processing and organization: Handling small frequencies

  • Handling small frequencies

  • What to do?
    • Transform the dataπŸ‘ͺ Merging, recoding…
    • Do not consider for further analysis

Drug discontinuation reasons

Frequency (%)

Drug side effect

160 (40.0%)

Unavailability of Drug

15 (3.75%)

Cost of drug

17 (4.25%)

Religion

105 (26.25%)

Lack of family support

103 (25.75%)

Total study population

400 (100%)

15 of 20

Data processing and organization: Data transformation

  • Creating new codes
    • Coding open ended questions
    • Coding numerical values
    • Creating new codes from other response groups
    • Creating other group from already assigned categories

Drug discontinuation reasons

Frequency (%)

Drug side effect

120 (30%)

Unavailability of Drug

95 (23.8%)

Cost of drug

83 (20.8%)

Other

  • Religion

85 (21.3%)

  • Other reasons

17 (4.25%)

Total study population

400 (100%)

Drug discontinuation reasons

Frequency (%)

Drug side effect

160 (40.0%)

Unavailability of Drug

15 (3.75%)

Cost of drug

17 (4.25%)

Religion

105 (26.25%)

Lack of family support

103 (25.75%)

Total study population

400 (100%)

16 of 20

Data processing and organization: Data transformation cont…

  • Merging groups
    • In to a new labeled group
    • Adding already assigned response into already created other group.

Drug discontinuation reasons

Frequency (%)

Drug side effect

160 (40.0%)

Unavailability of Drug

15 (3.75%)

Cost of drug

17 (4.25%)

Religion

105 (26.25%)

Lack of family support

103 (25.75%)

Total study population

400 (100%)

Drug discontinuation reasons

Frequency (%)

Drug side effect

190 (47.5%)

Unavailability of Drug

169 (42.3%)

Cost of drug

12 (3.0%)

Other reasons summed up

29 (7.25%)

Total study population

400 (100%)

17 of 20

Data processing and organization: Data transformation cont…

  • Recoding
    • Dependent variable wrongly coded.
      • E.g., 1 and 2πŸ‘ͺ 0 and 1

    • To correct inconsistently coded responses
      • E.g., the question Gender can be coded differently as; 1. Male, 2. Female OR 0. Male, 1. Female OR 1. Female, 2. Male

    • Recoding variables when we create or merge new categories

18 of 20

Practice

Data processing and organization

https://forms.gle/faHPwdS1Rjmgvyxw5

18

19 of 20

Become an independent researcher

@ Medical Research Lounge

Join our telegram group πŸ‘‰ https://t.me/Medical_Research_Lounge

Subscribe to our you tube channel πŸ‘‰ https://youtube.com/@medicalresearchlounge

Website πŸ‘‰ http://www.medicalresearchlounge.com/

Follow us on TikTok πŸ‘‰ https://vm.tiktok.com/ZMFDhH4Ta/

Follow us on LinkedIn πŸ‘‰ https://www.linkedin.com/company/medical-research-lounge?lipi=urn%3Ali%3Apage%3Ad_flagship3_company_admin%3BmwZnimq%2BQmG%2Bt8bUXcSjLw%3D%3D

19

20 of 20

End