This a brief analysis of the underlying data used to populate prevalence models to prodcuce practice level estimates.

1 Calculating summary data

1.1 For COPD

library(dplyr)
gp %>%
    filter(disease == "COPD") %>%
    select(disease, GP.Practice.Code, indicator, indicator1, value) %>%
    group_by(indicator, indicator1) %>%
    summarise(n= length(unique(GP.Practice.Code)), 
              mean = round(mean(value, na.rm = TRUE),2),
              sd = round(sd(value, na.rm = TRUE),2),
              min = round(min(value, na.rm = TRUE),2),
              max = round(max(value, na.rm = TRUE),2)) %>%
    knitr::kable()
indicator indicator1 n mean sd min max
age Total <40 7681 3796.51 2589.89 0 38071.00
age Total 40-50 7681 1039.65 646.42 0 8842.00
age Total 50-60 7681 983.96 625.71 0 8421.00
age Total 60-70 7681 792.28 553.33 0 5759.00
age Total 70-80 7681 544.89 413.01 0 4128.00
age Total 80+ 7681 346.85 279.65 0 2792.00
ethnicity Non-smokers 7681 0.46 0.09 0 0.80
gender Total Females 7681 3767.55 2352.15 0 29769.00
gender Total Males 7681 3736.59 2280.32 0 30606.00
imd IMD Quintile 1 (%) 7681 0.17 0.22 0 0.99
imd IMD Quintile 2 (%) 7681 0.18 0.16 0 1.00
imd IMD Quintile 3 (%) 7681 0.20 0.16 0 1.00
imd IMD Quintile 4 (%) 7681 0.22 0.17 0 1.00
imd IMD Quintile 5 (%) 7681 0.24 0.27 0 0.99
population Total All 7681 7504.14 4621.85 1 60375.00
smoking Current smokers 7681 0.21 0.07 0 0.51
smoking Ex-smokers 7681 0.32 0.08 0 0.66

1.2 For hypertension

indicator indicator1 n mean sd min max
age Total 16-24 8107 874.69 939.08 0.00 25616.00
age Total 25-34 8107 986.54 742.48 0.00 8456.00
age Total 35-44 8107 956.36 616.15 0.00 7547.00
age Total 45-54 8107 978.90 630.22 0.00 7319.00
age Total 55-64 8107 771.28 524.18 0.00 5242.00
age Total 65-74 8107 624.69 471.79 0.00 4332.00
age Total 75+ 8107 530.80 420.25 0.00 4074.00
bmi BMI <18.5kg/m2 (%) 8107 0.01 0.01 0.00 0.05
bmi BMI >18.5 <25kg/m2 (%) 8107 0.34 0.07 0.00 0.53
bmi BMI>25 <30kg/m2 (%) 8107 0.39 0.07 0.00 0.51
bmi BMI>30kg/m2 (%) 8107 0.22 0.05 0.00 0.35
education Foreign/Other (%) 8107 0.23 0.05 0.13 0.49
education No qualfications (%) 8107 0.35 0.13 0.08 0.89
education NVQ1/CSE other grade equiv (%) 8107 0.41 0.05 0.21 0.67
education NVQ2/GCE O Level equiv (%) 8107 0.48 0.08 0.25 0.77
education NVQ3/GCE A Level equiv (%) 8107 0.35 0.08 0.16 0.69
education NVQ4/NVQ5/Degree or equiv + Higher ed below degree (%) 8107 0.35 0.13 0.08 0.89
ethnicity African/Afro-Caribbean (%) 8107 0.04 0.07 0.00 0.44
ethnicity Mixed (%) 8107 0.02 0.02 0.00 0.10
ethnicity Other (%) 8107 0.04 0.04 0.00 0.27
ethnicity South Asian (%) 8107 0.07 0.11 0.00 0.69
ethnicity White (%) 8107 0.83 0.20 0.11 0.99
gender Total Female 8107 3502.63 2202.97 0.00 26554.00
gender Total Male 8107 3464.35 2129.27 48.00 25832.00
imd IMD Quintile 1 (%) 8107 0.17 0.22 0.00 1.00
imd IMD Quintile 2 (%) 8107 0.17 0.16 0.00 1.00
imd IMD Quintile 3 (%) 8107 0.20 0.16 0.00 1.00
imd IMD Quintile 4 (%) 8107 0.22 0.18 0.00 1.00
imd IMD Quintile 5 (%) 8107 0.24 0.27 0.00 1.00
limiting long term illness Limiting long-lasting disease (%) 8107 0.18 0.04 0.06 0.39
limiting long term illness No limiting long-lasting disease (%) 8107 0.82 0.04 0.61 0.94
occupational classification Higher Managerial, Administrative and Professional Occupations (%) 8107 0.20 0.09 0.03 0.63
occupational classification Intermediate Occupations (%) 8107 0.13 0.02 0.03 0.28
occupational classification Lower Managerial, Administrative and Professional Occupations (%) 8107 0.20 0.05 0.06 0.36
occupational classification Lower Supervisory and Technical Occupations (%) 8107 0.07 0.02 0.01 0.13
occupational classification Never Worked and Long-Term Unemployed (%) 8107 0.06 0.04 0.01 0.28
occupational classification Others (%) 8107 0.09 0.06 0.01 0.70
occupational classification Routine Occupations (%) 8107 0.11 0.04 0.02 0.27
occupational classification Semi-Routine Occupations (%) 8107 0.14 0.04 0.03 0.26
occupational classification Small Employers and Own Account Workers (%) 8107 0.09 0.03 0.02 0.27
population Total All 8107 6966.98 4322.62 102.00 52386.00
population Total People 8107 5723.26 3653.70 0.00 43017.00

1.3 For CHD

gp %>%
    filter(disease == "Coronary Heart Disease") %>%
    select(disease, GP.Practice.Code, indicator, indicator1, value) %>%
    group_by(indicator, indicator1) %>%
    summarise(n= length(unique(GP.Practice.Code)), 
              mean = round(mean(value, na.rm = TRUE),2),
              sd = round(sd(value, na.rm = TRUE),2),
              min = round(min(value, na.rm = TRUE),2),
              max = round(max(value, na.rm = TRUE),2)) %>%
    knitr::kable()
indicator indicator1 n mean sd min max
age Total 55-59 7541 460.71 290.79 0.00 3805.00
age Total 60-64 7541 395.62 260.62 0.00 2983.00
age Total 65-69 7541 406.44 292.63 0.00 2776.00
age Total 70-74 7541 311.59 234.25 0.00 2284.00
age Total 75-79 7541 240.37 178.49 0.00 1844.00
bmi BMI <18.5kg/m2 (%) 7541 0.01 0.01 0.00 0.05
bmi BMI >18.5 <25kg/m2 (%) 7541 0.35 0.05 0.23 0.53
bmi BMI>25 <30kg/m2 (%) 7541 0.41 0.04 0.30 0.51
bmi BMI>30kg/m2 (%) 7541 0.23 0.04 0.11 0.35
ckd Chronic Kidney Disease (%) 7541 0.04 0.02 0.00 0.27
ckd No Chronic Kidney Disease (%) 7541 0.96 0.02 0.73 1.00
diabetes Diabetes (%) 7541 0.07 0.02 0.00 0.20
diabetes No Diabetes (%) 7541 0.93 0.02 0.80 1.00
ethnicity Non white (%) 7541 0.17 0.20 0.00 0.89
ethnicity White (%) 7541 0.83 0.20 0.11 0.99
gender Total Female 7541 3801.39 2338.80 1.00 29769.00
gender Total Male 7541 3769.08 2266.91 0.00 30606.00
imd IMD Quintile 1 (%) 7541 0.17 0.22 0.00 0.99
imd IMD Quintile 2 (%) 7541 0.18 0.16 0.00 1.00
imd IMD Quintile 3 (%) 7541 0.20 0.16 0.00 1.00
imd IMD Quintile 4 (%) 7541 0.22 0.17 0.00 1.00
imd IMD Quintile 5 (%) 7541 0.24 0.27 0.00 0.99
physical acticity Physical Activity 1 (%) 7541 0.29 0.04 0.17 0.40
physical acticity Physical Activity 2 (%) 7541 0.15 0.02 0.00 0.22
physical acticity Physical Activity 3 (%) 7541 0.56 0.05 0.44 0.68
population Total All 7541 7570.47 4595.07 1.00 60375.00
population Total People 7541 6179.67 3817.83 1.00 49067.00
smoking Current smoker (%) 7541 0.21 0.07 0.00 0.51
smoking Not current smoker (%) 7541 0.79 0.07 0.49 1.00

1.4 For depression

gp %>%
    filter(disease == "Depression") %>%
    select(disease, GP.Practice.Code, indicator, indicator1, value) %>%
    group_by(indicator, indicator1) %>%
    summarise(n= length(unique(GP.Practice.Code)), 
              mean = round(mean(value, na.rm = TRUE),2),
              sd = round(sd(value, na.rm = TRUE),2),
              min = round(min(value, na.rm = TRUE),2),
              max = round(max(value, na.rm = TRUE),2)) %>%
    knitr::kable()
indicator indicator1 n mean sd min max
age Total 16-24 7681 830.24 1001.48 0.00 27447.00
age Total 25-34 7681 1078.92 803.98 0.00 9812.00
age Total 35-44 7681 1008.73 650.61 0.00 8327.00
age Total 45-54 7681 1066.89 667.88 0.00 9332.00
age Total 55-64 7681 846.47 552.44 0.00 6788.00
age Total 65-74 7681 708.95 527.66 0.00 5060.00
age Total 75+ 7681 584.13 455.83 0.00 4620.00
bmi BMI <18.5kg/m2 (%) 7681 0.01 0.01 0.00 0.05
bmi BMI >18.5 <25kg/m2 (%) 7681 0.35 0.05 0.23 0.53
bmi BMI>25 <30kg/m2 (%) 7681 0.41 0.04 0.30 0.51
bmi BMI>30kg/m2 (%) 7681 0.23 0.04 0.11 0.35
ethnicity Asian (%) 7681 0.07 0.11 0.00 0.69
ethnicity Black (%) 7681 0.04 0.07 0.00 0.44
ethnicity Mixed (%) 7681 0.02 0.02 0.00 0.10
ethnicity Other (%) 7681 0.04 0.04 0.00 0.27
ethnicity White (%) 7681 0.83 0.20 0.11 0.99
gender Total Female 7681 3767.55 2352.15 0.00 29769.00
gender Total Male 7681 3736.59 2280.32 0.00 30606.00
imd IMD Quintile 1 (%) 7681 0.17 0.22 0.00 1.00
imd IMD Quintile 2 (%) 7681 0.17 0.16 0.00 1.00
imd IMD Quintile 3 (%) 7681 0.20 0.16 0.00 1.00
imd IMD Quintile 4 (%) 7681 0.22 0.18 0.00 1.00
imd IMD Quintile 5 (%) 7681 0.24 0.27 0.00 1.00
limiting long term illness Limiting long-lasting disease (%) 7681 0.18 0.04 0.06 0.39
limiting long term illness No limiting long-lasting disease (%) 7681 0.82 0.04 0.61 0.94
occupational classification Higher Managerial, Administrative and Professional Occupations (%) 7681 0.18 0.07 0.04 0.48
occupational classification Intermediate Occupations (%) 7681 0.12 0.02 0.02 0.26
occupational classification Lower Managerial, Administrative and Professional Occupations (%) 7681 0.18 0.04 0.06 0.31
occupational classification Lower Supervisory and Technical Occupations (%) 7681 0.06 0.02 0.01 0.12
occupational classification Never Worked and Long-Term Unemployed (%) 7681 0.06 0.04 0.01 0.27
occupational classification Others (%) 7681 0.08 0.05 0.01 0.66
occupational classification Routine Occupations (%) 7681 0.10 0.04 0.02 0.27
occupational classification Semi-Routine Occupations (%) 7681 0.13 0.04 0.02 0.25
occupational classification Small Employers and Own Account Workers (%) 7681 0.09 0.03 0.02 0.26
population Total All 7681 7504.14 4621.85 1.00 60375.00
population Total People 7681 6124.32 3837.88 1.00 49067.00

1.5 For peripheral arterial disease

gp %>%
    filter(disease == "Peripheral arterial disease") %>%
    select(disease, GP.Practice.Code, indicator,  indicator1, value) %>%
    group_by(indicator, indicator1) %>%
    summarise(n= length(unique(GP.Practice.Code)), 
              mean = round(mean(value, na.rm = TRUE),2),
              sd = round(sd(value, na.rm = TRUE),2),
              min = round(min(value, na.rm = TRUE),2),
              max = round(max(value, na.rm = TRUE),2)) %>%
    knitr::kable()
indicator indicator1 n mean sd min max
age Total 55-59 7541 460.71 290.79 0.00 3805.00
age Total 60-64 7541 395.62 260.62 0.00 2983.00
age Total 65-69 7541 406.44 292.63 0.00 2776.00
age Total 70-74 7541 311.59 234.25 0.00 2284.00
age Total 75-79 7541 240.37 178.49 0.00 1844.00
bmi BMI <18.5kg/m2 (%) 7541 0.01 0.01 0.00 0.05
bmi BMI >18.5 <25kg/m2 (%) 7541 0.35 0.05 0.23 0.53
bmi BMI>25 <30kg/m2 (%) 7541 0.41 0.04 0.30 0.51
bmi BMI>30kg/m2 (%) 7541 0.23 0.04 0.11 0.35
ckd Chronic Kidney Disease (%) 7541 0.04 0.02 0.00 0.27
ckd No Chronic Kidney Disease (%) 7541 0.96 0.02 0.73 1.00
diabetes Diabetes (%) 7541 0.07 0.02 0.00 0.20
diabetes No Diabetes (%) 7541 0.93 0.02 0.80 1.00
ethnicity Non white (%) 7541 0.17 0.20 0.00 0.89
ethnicity White (%) 7541 0.83 0.20 0.00 0.99
gender Females 7541 3801.39 2338.80 1.00 29769.00
gender Males 7541 3769.08 2266.91 0.00 30606.00
imd IMD Quintile 1 (%) 7541 0.17 0.22 0.00 0.99
imd IMD Quintile 2 (%) 7541 0.18 0.16 0.00 1.00
imd IMD Quintile 3 (%) 7541 0.20 0.16 0.00 1.00
imd IMD Quintile 4 (%) 7541 0.22 0.17 0.00 1.00
imd IMD Quintile 5 (%) 7541 0.24 0.27 0.00 0.99
physical acticity Physical Activity 1 (%) 7541 0.29 0.04 0.17 0.40
physical acticity Physical Activity 2 (%) 7541 0.15 0.02 0.00 0.22
physical acticity Physical Activity 3 (%) 7541 0.56 0.05 0.44 0.68
population Total All 7541 7570.47 4595.07 1.00 60375.00
population Total People 7541 6179.67 3817.83 1.00 49067.00
smoking Current smoker (%) 7541 0.21 0.07 0.00 0.51
smoking Not current smoker (%) 7541 0.79 0.07 0.49 1.00

1.6 For stroke

gp %>%
    filter(disease == "Stroke") %>%
    select(disease, GP.Practice.Code, indicator, indicator1, value) %>%
    group_by(indicator, indicator1) %>%
    summarise(n= length(unique(GP.Practice.Code)), 
              mean = round(mean(value, na.rm = TRUE),2),
              sd = round(sd(value, na.rm = TRUE),2),
              min = round(min(value, na.rm = TRUE),2),
              max = round(max(value, na.rm = TRUE),2)) %>%
    knitr::kable()
indicator indicator1 n mean sd min max
age Total 55-59 7541 460.71 290.79 0.00 3805.00
age Total 60-64 7541 395.62 260.62 0.00 2983.00
age Total 65-69 7541 406.44 292.63 0.00 2776.00
age Total 70-74 7541 311.59 234.25 0.00 2284.00
age Total 75-79 7541 240.37 178.49 0.00 1844.00
bmi BMI <18.5kg/m2 (%) 7541 0.01 0.01 0.00 0.05
bmi BMI >18.5 <25kg/m2 (%) 7541 0.35 0.05 0.23 0.53
bmi BMI>25 <30kg/m2 (%) 7541 0.41 0.04 0.30 0.51
bmi BMI>30kg/m2 (%) 7541 0.23 0.04 0.11 0.35
ckd Chronic Kidney Disease (%) 7541 0.04 0.02 0.00 0.27
ckd No Chronic Kidney Disease (%) 7541 0.96 0.02 0.73 1.00
diabetes Diabetes (%) 7541 0.07 0.02 0.00 0.20
diabetes No Diabetes (%) 7541 0.93 0.02 0.80 1.00
ethnicity Non white (%) 7541 0.17 0.20 0.00 0.89
ethnicity White (%) 7541 0.83 0.20 0.00 0.99
gender Total Female 7541 3801.39 2338.80 1.00 29769.00
gender Total Male 7541 3769.08 2266.91 0.00 30606.00
imd IMD Quintile 1 (%) 7541 0.17 0.22 0.00 0.99
imd IMD Quintile 2 (%) 7541 0.18 0.16 0.00 1.00
imd IMD Quintile 3 (%) 7541 0.20 0.16 0.00 1.00
imd IMD Quintile 4 (%) 7541 0.22 0.17 0.00 1.00
imd IMD Quintile 5 (%) 7541 0.24 0.27 0.00 0.99
physical acticity Physical Activity 1 (%) 7541 0.29 0.04 0.17 0.40
physical acticity Physical Activity 2 (%) 7541 0.15 0.02 0.00 0.22
physical acticity Physical Activity 3 (%) 7541 0.56 0.05 0.44 0.68
population Total All 7541 7570.47 4595.07 1.00 60375.00
population Total People 7541 6179.67 3817.83 1.00 49067.00
smoking Current smoker (%) 7541 0.21 0.07 0.00 0.51
smoking Not current smoker (%) 7541 0.79 0.07 0.49 1.00
LS0tDQp0aXRsZTogJ1ByZXZhbGVuY2UgZXN0aW1hdGVzOiBzdW1tYXJ5IGlucHV0IHZhbHVlcyBieSBwcmFjdGljZScNCm91dHB1dDoNCiAgaHRtbF9ub3RlYm9vazogDQogICAgbnVtYmVyX3NlY3Rpb25zOiB5ZXMNCiAgICB0b2M6IHllcw0KICB3b3JkX2RvY3VtZW50OiBkZWZhdWx0DQotLS0NCg0KVGhpcyBhIGJyaWVmIGFuYWx5c2lzIG9mIHRoZSB1bmRlcmx5aW5nIGRhdGEgdXNlZCB0byBwb3B1bGF0ZSBwcmV2YWxlbmNlIG1vZGVscyB0byBwcm9kY3VjZSBwcmFjdGljZSBsZXZlbCBlc3RpbWF0ZXMuDQoNCmBgYHtyIFJlYWQgaW4gdGhlIGRhdGEsIGZpZy5oZWlnaHQ9MTIsIGZpZy53aWR0aD04LCBtZXNzYWdlPUZBTFNFLCB3YXJuaW5nPUZBTFNFLCBjYWNoZT1UUlVFfQ0KbGlicmFyeShyZWFkcikNCmxpYnJhcnkoZHBseXIpDQpsaWJyYXJ5KGtuaXRyKQ0Kc2V0d2QoIn4vUi9wcmltYXJ5X2NhcmUiKQ0KDQoNCmdwIDwtIHJlYWRfY3N2KCJzdW1HUC5jc3YiLCBwcm9ncmVzcyA9IEZBTFNFLCBjb2xfdHlwZXMgPSAiaWNjY2NkYyIpICMjIG5iIGl0cyA2NzdNYg0KDQpncCAlPiUgDQogICAgZ2dwbG90Mjo6Z2dwbG90KGFlcyhyZW9yZGVyKGluZGljYXRvcjEsaW5kaWNhdG9yKSwgIGxvZzEwKHZhbHVlKSkpICsNCiAgICBnZW9tX2JveHBsb3QoYWVzKGZpbGwgPSBkaXNlYXNlKSkgK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