## ----setup, include = FALSE---------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment  = "#>",
  eval     = FALSE
)

## ----summary-table, eval=TRUE, echo=FALSE, results='asis'---------------------
summary_data <- data.frame(
  Country = c("Moldova 2021", "Mongolia 2019", "Georgia 2016",
              "Afghanistan 2018", "Algeria 2016", "Ukraine 2019",
              "Ecuador 2018", "Cabo Verde 2020", "Bahamas 2019",
              "**TOTAL**"),
  Compared = c(17, 15, 15, 14, 14, 14, 14, 15, 10, 128),
  Within_1pp = c(16, 15, 15, 14, 14, 13, 13, 14, 9, 123),
  CI_Overlap = c(17, 15, 15, 14, 14, 14, 14, 15, 10, 128),
  Match_Rate = c("94%", "100%", "100%", "100%", "100%", "93%",
                 "93%", "93%", "90%", "**96%**")
)

knitr::kable(
  summary_data,
  col.names = c("Country", "Indicators compared", "Within 1 pp",
                "CI overlap", "Match rate"),
  align = c("l", "c", "c", "c", "c"),
  caption = "Validation summary: stepssurvey vs. WHO fact sheets (9 countries)"
)

## ----moldova, eval=TRUE, echo=FALSE, results='asis'---------------------------
mda <- data.frame(
  Indicator = c(
    "Current tobacco use", "Current smoking", "Second-hand smoke (home)",
    "Second-hand smoke (work)", "Current alcohol (30 d)",
    "Heavy episodic drinking", "Insufficient fruit/veg",
    "Insufficient physical activity",
    "Overweight (BMI >= 25)", "Obese (BMI >= 30)",
    "Raised BP or on meds",
    "Raised glucose or on meds", "Raised cholesterol or on meds",
    "Impaired fasting glucose",
    "Mean BMI", "Mean SBP", "Mean total cholesterol"
  ),
  Ours = c(27.7, 27.6, 23.3, 26.4, 63.2, 13.8, 63.2, 9.1,
           63.9, 22.7, 35.0, 6.3, 28.4, 9.9, 26.9, 129.2, 4.4),
  WHO = c(29.9, 27.6, 23.2, 26.4, 63.2, 13.8, 63.4, 9.1,
          63.9, 22.7, 34.8, 6.3, 27.7, 9.9, 26.9, 129.2, 4.4),
  Diff = c(-2.2, 0.0, 0.1, 0.0, 0.0, 0.0, -0.2, 0.0,
           0.0, 0.0, 0.2, 0.0, 0.7, 0.0, 0.0, 0.0, 0.0),
  Match = c("No", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes",
            "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes"),
  CI_Overlap = c("Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes",
                 "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes")
)

knitr::kable(mda, align = c("l", "r", "r", "r", "c", "c"),
             caption = "Moldova 2021: 16/17 within 1 pp, 17/17 CI overlap")

## ----mongolia, eval=TRUE, echo=FALSE, results='asis'--------------------------
mng <- data.frame(
  Indicator = c(
    "Current tobacco use", "Current smoking (daily)",
    "Current alcohol (30 d)",
    "Heavy episodic drinking", "Insufficient fruit/veg",
    "Insufficient physical activity",
    "Overweight (BMI >= 25)", "Obese (BMI >= 30)",
    "Raised BP or on meds (130/80)",
    "Raised glucose or on meds", "Raised cholesterol or on meds",
    "Impaired fasting glucose",
    "Mean BMI", "Mean SBP", "Mean total cholesterol"
  ),
  Ours = c(25.0, 21.6, 34.8, 20.2, 83.2, 22.5,
           49.3, 18.5, 44.3, 8.3, 27.8, 17.4, 25.6, 120.5, 4.4),
  WHO = c(24.2, 21.6, 34.8, 19.8, 83.4, 21.9,
          49.4, 18.5, 44.0, 8.3, 27.8, 17.4, 25.5, 120.5, 4.4),
  Diff = c(0.8, 0.0, 0.0, 0.4, -0.2, 0.6,
           -0.1, 0.0, 0.3, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0),
  Match = rep("Yes", 15),
  CI_Overlap = rep("Yes", 15)
)

knitr::kable(mng, align = c("l", "r", "r", "r", "c", "c"),
             caption = "Mongolia 2019: 15/15 within 1 pp, 15/15 CI overlap")

## ----georgia, eval=TRUE, echo=FALSE, results='asis'---------------------------
geo <- data.frame(
  Indicator = c(
    "Current tobacco use", "Current smoking (daily)",
    "Current alcohol (30 d)",
    "Heavy episodic drinking", "Insufficient fruit/veg",
    "Insufficient physical activity",
    "Overweight (BMI >= 25)", "Obese (BMI >= 30)",
    "Raised BP or on meds",
    "Raised glucose or on meds", "Raised cholesterol or on meds",
    "Impaired fasting glucose",
    "Mean BMI", "Mean SBP", "Mean total cholesterol"
  ),
  Ours = c(31.1, 28.0, 39.0, 18.7, 62.9, 18.2,
           64.6, 33.4, 37.7, 4.5, 27.7, 2.0, 28.2, 129.4, 4.3),
  WHO = c(31.0, 28.0, 39.1, 18.3, 63.0, 17.4,
          64.6, 33.2, 37.7, 4.5, 27.7, 2.0, 28.1, 129.4, 4.3),
  Diff = c(0.1, 0.0, -0.1, 0.4, -0.1, 0.8,
           0.0, 0.2, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0),
  Match = rep("Yes", 15),
  CI_Overlap = rep("Yes", 15)
)

knitr::kable(geo, align = c("l", "r", "r", "r", "c", "c"),
             caption = "Georgia 2016: 15/15 within 1 pp, 15/15 CI overlap")

## ----afghanistan, eval=TRUE, echo=FALSE, results='asis'-----------------------
afg <- data.frame(
  Indicator = c(
    "Current smoking", "Current alcohol (30 d)",
    "Heavy episodic drinking", "Insufficient fruit/veg",
    "Insufficient physical activity",
    "Overweight (BMI >= 25)", "Obese (BMI >= 30)",
    "Raised BP or on meds",
    "Raised glucose or on meds", "Raised cholesterol or on meds",
    "Impaired fasting glucose",
    "Mean BMI", "Mean SBP", "Mean total cholesterol"
  ),
  Ours = c(8.6, 0.2, 0.1, 97.3, 26.6,
           42.7, 17.2, 29.2, 9.2, 17.8, 4.9,
           25.2, 125.5, 3.8),
  WHO = c(8.6, 0.2, 0.1, 97.3, 26.5,
          42.7, 17.0, 29.2, 9.2, 18.1, 4.7,
          25.1, 125.5, 3.8),
  Diff = c(0.0, 0.0, 0.0, 0.0, 0.1,
           0.0, 0.2, 0.0, 0.0, -0.3, 0.2,
           0.1, 0.0, 0.0),
  Match = rep("Yes", 14),
  CI_Overlap = rep("Yes", 14)
)

knitr::kable(afg, align = c("l", "r", "r", "r", "c", "c"),
             caption = "Afghanistan 2018: 14/14 within 1 pp, 14/14 CI overlap")

## ----algeria, eval=TRUE, echo=FALSE, results='asis'---------------------------
dza <- data.frame(
  Indicator = c(
    "Current smoking", "Current alcohol (30 d)",
    "Heavy episodic drinking", "Insufficient fruit/veg",
    "Insufficient physical activity",
    "Overweight (BMI >= 25)", "Obese (BMI >= 30)",
    "Raised BP or on meds",
    "Raised glucose or on meds", "Raised cholesterol or on meds",
    "Impaired fasting glucose",
    "Mean BMI", "Mean SBP", "Mean total cholesterol"
  ),
  Ours = c(16.4, 2.1, 1.3, 85.2, 23.7,
           55.5, 21.9, 23.7, 8.8, 23.5, 8.6,
           26.4, 126.4, 4.2),
  WHO = c(16.5, 2.1, 1.3, 85.3, 23.7,
          55.6, 21.8, 23.6, 9.0, 24.0, 8.2,
          26.4, 126.3, 4.2),
  Diff = c(-0.1, 0.0, 0.0, -0.1, 0.0,
           -0.1, 0.1, 0.1, -0.2, -0.5, 0.4,
           0.0, 0.1, 0.0),
  Match = rep("Yes", 14),
  CI_Overlap = rep("Yes", 14)
)

knitr::kable(dza, align = c("l", "r", "r", "r", "c", "c"),
             caption = "Algeria 2016: 14/14 within 1 pp, 14/14 CI overlap")

## ----ukraine, eval=TRUE, echo=FALSE, results='asis'---------------------------
ukr <- data.frame(
  Indicator = c(
    "Current smoking", "Current alcohol (30 d)",
    "Heavy episodic drinking", "Insufficient fruit/veg",
    "Insufficient physical activity",
    "Overweight (BMI >= 25)", "Obese (BMI >= 30)",
    "Raised BP or on meds",
    "Raised glucose or on meds", "Raised cholesterol or on meds",
    "Impaired fasting glucose",
    "Mean BMI", "Mean SBP", "Mean total cholesterol"
  ),
  Ours = c(33.7, 55.5, 20.3, 66.1, 10.7,
           59.1, 24.9, 36.7, 7.1, 40.7, 9.0,
           26.9, 129.2, 4.7),
  WHO = c(33.9, 55.6, 19.7, 66.4, 10.0,
          59.0, 24.8, 34.8, 7.1, 40.7, 8.8,
          26.8, 129.1, 4.7),
  Diff = c(-0.2, -0.1, 0.6, -0.3, 0.7,
           0.1, 0.1, 1.9, 0.0, 0.0, 0.2,
           0.1, 0.1, 0.0),
  Match = c("Yes", "Yes", "Yes", "Yes", "Yes",
            "Yes", "Yes", "No", "Yes", "Yes", "Yes",
            "Yes", "Yes", "Yes"),
  CI_Overlap = rep("Yes", 14)
)

knitr::kable(ukr, align = c("l", "r", "r", "r", "c", "c"),
             caption = "Ukraine 2019: 13/14 within 1 pp, 14/14 CI overlap")

## ----ecuador, eval=TRUE, echo=FALSE, results='asis'---------------------------
ecu <- data.frame(
  Indicator = c(
    "Current smoking", "Current alcohol (30 d)",
    "Heavy episodic drinking", "Insufficient fruit/veg",
    "Insufficient physical activity",
    "Overweight (BMI >= 25)", "Obese (BMI >= 30)",
    "Raised BP or on meds",
    "Raised glucose or on meds", "Raised cholesterol or on meds",
    "Impaired fasting glucose",
    "Mean BMI", "Mean SBP", "Mean total cholesterol"
  ),
  Ours = c(13.7, 39.3, 24.1, 94.6, 17.8,
           63.6, 25.7, 20.5, 6.9, 33.7, 8.3,
           27.2, 119.7, 4.4),
  WHO = c(13.7, 39.3, 23.8, 94.6, 17.8,
          63.6, 25.7, 19.8, 7.1, 34.7, 7.8,
          27.2, 119.7, 4.4),
  Diff = c(0.0, 0.0, 0.3, 0.0, 0.0,
           0.0, 0.0, 0.7, -0.2, -1.0, 0.5,
           0.0, 0.0, 0.0),
  Match = c("Yes", "Yes", "Yes", "Yes", "Yes",
            "Yes", "Yes", "Yes", "Yes", "No", "Yes",
            "Yes", "Yes", "Yes"),
  CI_Overlap = rep("Yes", 14)
)

knitr::kable(ecu, align = c("l", "r", "r", "r", "c", "c"),
             caption = "Ecuador 2018: 13/14 within 1 pp, 14/14 CI overlap")

## ----caboverde, eval=TRUE, echo=FALSE, results='asis'-------------------------
cpv <- data.frame(
  Indicator = c(
    "Current smoking", "Second-hand smoke (work)",
    "Current alcohol (30 d)",
    "Heavy episodic drinking", "Insufficient fruit/veg",
    "Insufficient physical activity",
    "Overweight (BMI >= 25)", "Obese (BMI >= 30)",
    "Raised BP or on meds",
    "Raised glucose or on meds", "Raised cholesterol or on meds",
    "Impaired fasting glucose",
    "Mean BMI", "Mean SBP", "Mean total cholesterol"
  ),
  Ours = c(9.6, 15.0, 45.0, 17.5, 77.3, 31.6,
           44.2, 14.3, 31.1, 3.6, 17.9, 2.4,
           25.1, 128.8, 4.0),
  WHO = c(9.6, 15.0, 45.0, 17.5, 79.0, 31.8,
          44.2, 14.3, 30.8, 3.7, 18.8, 2.3,
          25.1, 128.8, 4.0),
  Diff = c(0.0, 0.0, 0.0, 0.0, -1.7, -0.2,
           0.0, 0.0, 0.3, -0.1, -0.9, 0.1,
           0.0, 0.0, 0.0),
  Match = c("Yes", "Yes", "Yes", "Yes", "No", "Yes",
            "Yes", "Yes", "Yes", "Yes", "Yes", "Yes",
            "Yes", "Yes", "Yes"),
  CI_Overlap = rep("Yes", 15)
)

knitr::kable(cpv, align = c("l", "r", "r", "r", "c", "c"),
             caption = "Cabo Verde 2020: 14/15 within 1 pp, 15/15 CI overlap")

## ----bahamas, eval=TRUE, echo=FALSE, results='asis'---------------------------
bhs <- data.frame(
  Indicator = c(
    "Current smoking", "Current alcohol (30 d)",
    "Heavy episodic drinking", "Insufficient fruit/veg",
    "Insufficient physical activity",
    "Overweight (BMI >= 25)", "Obese (BMI >= 30)",
    "Raised BP or on meds",
    "Mean BMI", "Mean SBP"
  ),
  Ours = c(17.4, 49.5, 18.1, 85.0, 30.1,
           71.7, 44.5, 35.3, 30.6, 125.4),
  WHO = c(17.4, 49.6, 17.6, 85.3, 30.2,
          71.6, 43.6, 36.7, 29.8, 125.4),
  Diff = c(0.0, -0.1, 0.5, -0.3, -0.1,
           0.1, 0.9, -1.4, 0.8, 0.0),
  Match = c("Yes", "Yes", "Yes", "Yes", "Yes",
            "Yes", "Yes", "No", "Yes", "Yes"),
  CI_Overlap = rep("Yes", 10)
)

knitr::kable(bhs, align = c("l", "r", "r", "r", "c", "c"),
             caption = "Bahamas 2019: 9/10 within 1 pp, 10/10 CI overlap")

