Exercise on interpretation - answers

Back to the main page

Interpretation

The tab Exercise introduction explains the context and the datasets - please read it carefully. Then proceed to the Questions tab and answer the questions.

You are part of a cohort study looking at neck pain in physiotherapy and chiropractic practice. The cohort study has collected data at baseline and 3 months follow-up on the Neck Disability Index (NDI). The 3 months follow-up also has a an external anchor (transition rating). You have decided to look at interpretation of the NDI scores.

The NDI

The NDI has 10 items (similar to the ODI), each item has 6 response options, and the scale range is 0-50 (high score equals high neck disability). It is based on a reflective model. You can view the NDI in full by clicking here:

Neck Disability Index

The dataset

The exercise uses a dataset called ndi_synthetic_teaching.rds. The dataset contains all 10 items of the NDI and a Global Perceived Effect scale (also called external anchor or transition rating). The items are named the following way:

  • n1 = item 1
  • _1 = time 1 (t1)
  • _2 = time 2 (t2)

The external anchor is rated as follows:

  • Much improved (1)
  • Improved (2)
  • Slightly improved (3)
  • No change (4)
  • Slightly worse (5)
  • Worse (6)
  • Much worse (7)

The dataset structure is shown in Table 1.

Code
# Opening ndi_synthetic_teaching.rds. The dataset is located in the data-folder.
# To locate data on www: "files", "02_advanced_course", "day2", "exercises", "resp_int",

ndi_data <- readRDS(here("files", "02_advanced_course", "day2", "exercises", "interpretation", "ndi_synthetic_teaching.rds")) |> 
  select(-synthetic)

ndi_data |>
  slice_head(n = 6) |>                     # show first 6 rows
  gt() |>
  tab_header(
    title = "Table 1. First 6 lines of the dataset"
  ) |> 
  cols_align(
    align = "center",
    columns = everything()) |>             # center short numbers
  cols_width(everything() ~ px(28)) |>     # narrow columns
  tab_options(
    table.font.size      = px(10),         # smaller font; try 9–11 px
    data_row.padding     = px(1),          # tight row padding
    column_labels.padding= px(2),
    table.width          = pct(100),       # use full content width
    heading.align = "left"
  )
Table 1. First 6 lines of the dataset
n1_1 n2_1 n3_1 n4_1 n5_1 n6_1 n7_1 n8_1 n9_1 n10_1 n1_2 n2_2 n3_2 n4_2 n5_2 n6_2 n7_2 n8_2 n9_2 n10_2 anchor
1 0 0 1 4 2 0 0 1 1 0 0 0 0 2 0 0 0 0 0 1
2 0 1 1 2 0 0 1 1 1 1 1 1 1 0 1 1 1 1 1 2
3 1 1 2 3 0 1 1 2 3 1 0 1 0 0 0 0 1 0 0 2
2 0 1 0 2 1 1 2 2 1 2 0 1 0 2 1 2 1 1 2 2
3 0 0 2 3 0 0 2 1 1 1 0 0 1 0 0 0 1 0 0 2
3 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1

The variables are summarised below:

Code
# This is for showing a summary of the dataset

(summary <- skim(ndi_data))
Data summary
Name ndi_data
Number of rows 331
Number of columns 21
_______________________
Column type frequency:
numeric 21
________________________
Group variables None

Variable type: numeric

skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
n1_1 0 1 2.31 1.07 0 2 2 3.0 5 ▃▇▅▂▁
n2_1 0 1 1.07 1.09 0 0 1 2.0 5 ▇▂▁▁▁
n3_1 0 1 1.60 1.37 0 1 1 2.0 5 ▇▂▁▂▁
n4_1 0 1 1.81 1.30 0 1 2 3.0 5 ▇▅▅▁▁
n5_1 0 1 2.30 1.55 0 1 3 3.0 5 ▇▃▇▂▂
n6_1 0 1 1.16 1.18 0 0 1 2.0 5 ▇▂▁▁▁
n7_1 0 1 1.73 1.46 0 1 1 3.0 5 ▇▂▃▁▁
n8_1 0 1 1.87 1.35 0 1 2 3.0 5 ▇▃▅▁▁
n9_1 0 1 1.79 1.27 0 1 2 3.0 5 ▇▅▃▂▁
n10_1 0 1 2.33 1.47 0 1 2 3.0 5 ▇▅▃▃▂
n1_2 0 1 1.78 1.21 0 1 2 2.0 5 ▇▆▃▁▁
n2_2 0 1 1.00 1.21 0 0 1 1.5 5 ▇▂▁▁▁
n3_2 0 1 1.31 1.26 0 0 1 2.0 5 ▇▂▁▁▁
n4_2 0 1 1.55 1.31 0 0 1 2.0 5 ▇▅▂▁▁
n5_2 0 1 1.79 1.41 0 1 2 3.0 5 ▇▃▃▁▁
n6_2 0 1 1.21 1.30 0 0 1 2.0 5 ▇▂▁▁▁
n7_2 0 1 1.39 1.32 0 0 1 2.0 5 ▇▃▂▁▁
n8_2 0 1 1.50 1.44 0 0 1 3.0 5 ▇▃▂▁▁
n9_2 0 1 1.33 1.29 0 0 1 2.0 5 ▇▂▁▁▁
n10_2 0 1 1.72 1.45 0 1 2 3.0 5 ▇▃▂▂▁
anchor 0 1 3.15 1.57 1 2 3 5.0 7 ▇▃▃▅▁

Start with the questions in tab ‘1. The GPE’ and, when finished, continue to the next.

Please write your answers to the questions in a Word document. The exercise including answers can be downloaded after the course as a html-document from the webpage.

In your data collection you included the Global Perceived Effect (GPE) scale (the external anchor) which was answered 3 months after baseline. The question was:

How would you describe your general neck/arm problems now, compared now to how you were when the treatment started?

  • Much improved
  • Improved
  • Slightly improved
  • No change
  • Slightly worse
  • Worse
  • Much worse

Questions

1.1 What are the possible problems (biases) with a question like this?

ImportantAnswer

The GPE should measure the same construct as the instrument it is applied to. The question stem has to refer to a change since the previous measurement (e.g., when the treatment started) and have between 3-7 response options ranging from ‘much worse’ to ‘much better’. In this example it is measuring ‘general neck/arm problems’ (which in essence is two questions in one), and this would be fine for an evaluative questionnaire measuring improvement or deterioration in the construct neck/arm function.

Furthermore, using a GPE like this has several limitations. First, it is used as a ‘gold standard’ reducing a multi-item questionnaire to one single question. Opponents will argue that we should only use this question as it may be as good as the multi-item questionnaire it is applied to. Second, several biases have been reported in the literature:

  • Recall bias
  • Present state bias
  • Motivational bias
  • Contamination bias
  • Pleasing bias (only relevant if questionnaire is filled out in front of the data collector)

1.2 How would you meaningfully dichotomise the GPE into ‘Improved patients’ and ‘No change patients’? Justify your answer.

ImportantAnswer

A sensible dichotomisation of a 7-point anchor would be to include ‘much better’ and ‘better’ in the ‘Improved patients’ group and the ‘a little better’, ‘about the same’ and ‘a little worse’ in the ‘No change patients’ group. This would minimise the misclassification (i.e. false positive and false negative). However, Terwee et al.(1) recommends to include ‘a little better’ in the improved group, since the MIC expresses ‘minimal’ important change. You have to carefully consider this, as it has the potential to increase misclassification.

A similar process can be can be carried out if we want to know more about the MIC for deterioration. Here we define the ‘Deteriorated patients’ as ‘worse’ and ‘much worse’. Later we will look at what happens if we choose a different dichotomisation.

Lastly, if we have an anchor with equal answer categories, it can be more difficult to make a sensible dichotomisation.

  1. Terwee CB, Peipert JD, Chapman R, Lai J-S, Terluin B, Cella D, et al. Minimal important change (MIC): a conceptual clarification and systematic review of MIC estimates of PROMIS measures. Qual Life Res. 2021 Jul 10.

1.3 If you were to design your study with a different GPE scale, discuss how you could do it?

ImportantAnswer

We could choose to include a longitudinal anchor like the Punum ladder and rate it the following way:

  • ‘important improvement’ -> change of [-4,-3]
  • ‘important deterioration’ -> change of [+3,+4]
  • ‘unchanged’ -> [-2,-1,0,+1,+2]

The advantage of the Punum ladder is that it has no recall or present state biases, however, it measures quality of life which may not be relevant in terms of what our questionnaire measures. To remedy the latter, we could adapt the Punum ladder to measure the same construct as our questionnaire.

Many other external anchors also exist, and we could design one that has better proximity to the measured construct, e.g.

How would you describe your general neck/arm function now, compared now to how you were when the treatment started?

Have a look at the distribution of the anchor categories which are shown in Figure 1.

Code
# Plotting anchor categories against NDI change score

# Identify items and anchor column
ndi_items_t1 <- paste0("n", 1:10, "_1")
ndi_items_t2 <- paste0("n", 1:10, "_2")
anchor_col <- "anchor"

# Compute NDI change (sum of items at T2 minus sum at T1)
ndi_data_change <- ndi_data |>
  mutate(
    t1 = rowSums(across(all_of(ndi_items_t1)), na.rm = FALSE),
    t2 = rowSums(across(all_of(ndi_items_t2)), na.rm = FALSE),
    ndi_change = t2 - t1,
    anchor_f = factor(
      .data[[anchor_col]],
      levels = 1:7,
      labels = c(
        "Much improved", "Improved", "Slightly improved",
        "No change", "Slightly worse", "Worse", "Much worse"
      )
    )
  ) |>
  drop_na(ndi_change, !!anchor_col)

# counts in *factor* order (keeps empty levels)
counts_df <- ndi_data_change |>
  group_by(anchor_f, .drop = FALSE) |>
  summarise(n = n(), .groups = "drop")

# named vector: names are the raw labels, values are "Label (n=..)"
x_labs <- counts_df |>
  mutate(lbl = paste0(as.character(anchor_f), " (n=", n, ")")) |>
  select(name = anchor_f, lbl) |>
  mutate(name = as.character(name)) |>
  tibble::deframe()   # vecorizing

# Plot: boxplots with jitter and mean marker
ggplot(ndi_data_change, aes(x = anchor_f, y = ndi_change)) +
  geom_boxplot(
    outlier.shape = NA,
    fill = "lightblue",
    color = "black",
    alpha = 0.7
    ) +
  geom_jitter(width = 0.15, alpha = 0.35, size = 1.6) +
  stat_summary(
    fun = mean,
    geom = "point",
    shape = 23,
    size = 3,
    fill = "blue"
    ) +
  labs(
    title = "Figure 1. NDI change score (T2 - T1) by anchor category",
    x = "Anchor category",
    y = "NDI change score (T2 - T1)",
    caption = "Note: Blue point = Mean value"
  ) +
  scale_x_discrete(labels = x_labs) +
  scale_y_continuous(
    breaks = seq(min(ndi_data_change$ndi_change, na.rm = TRUE), 
                 max(ndi_data_change$ndi_change, na.rm = TRUE), by = 5)) +
  theme_minimal(base_size = 13) +
  theme(
    panel.grid.minor.y = element_blank(),
    axis.text.x = element_text(angle = 20, hjust = 0.5, vjust = 1),
    plot.caption = element_text(
      hjust = 0,         # left-align caption
      face = "italic",   # italic style
      size = 10          # smaller font size
    )
    )

Questions

2.1 From Figure 1, what is the approximate MIC using the ‘Mean value techniques’?

ImportantAnswer
Code
anchor_values <- ndi_data_change |>
  group_by(anchor_f, .drop = FALSE) |>              # keep all factor levels, 0 rows: n=0, mean=NA
  summarise(
    n = sum(!is.na(ndi_change)),                    # number of non-missing values
    mean_ndi_change = mean(ndi_change, na.rm = TRUE), # mean per anchor
    sd_ndi_change = sd(ndi_change, na.rm = TRUE),
    se_val = sd_ndi_change/sqrt(n),                 # Standard Error
    # 95% CI
    ci_lower = mean_ndi_change - 1.96 * se_val,
    ci_upper = mean_ndi_change + 1.96 * se_val,
    .groups = "drop") |>                            # returning an ungrouped tibble
  mutate(mean_ndi_change = round(mean_ndi_change, 2))

# Formatting function
fmt <- function(x, d = 2) formatC(x, digits = d, format = "f")

# Slightly improved and no change values
sl_row <- anchor_values |> filter(anchor_f == "Slightly improved")
nc_row <- anchor_values |> filter(anchor_f == "No change")

# Pulling needed values
sl_n <- sl_row$n
sl_mean <- fmt(sl_row$mean_ndi_change) # Mean slightly improved
sl_mean_lo <- fmt(sl_row$ci_lower)
sl_mean_hi <- fmt(sl_row$ci_upper)

The ‘Mean value technique’ uses the mean score of the patients who chose ‘Slightly improved’ on the GPE (anchor). I this case our MIC = -4.20 points (the score decreases as a high score = high disability). The MIC has to be viewed in light of a small population (n = 59) and that the CI’s are relatively wide - see below (the exact values are calculated using the code in the codefold). Therefore:

\[ \text{MIC} = -4.20\ \text{ points } \; [ \text{CI}_{95\%}: -6.20; -2.21]. \]

2.2 What is the approximate MIC using ‘Difference in mean value techniques’?

ImportantAnswer
Code
# I'm using the anchor_values dataframe from question 2.1

# Pulling relevant values
nc_mean <- fmt(nc_row$mean_ndi_change) # Mean no change

# Calculating MIC difference in mean values
mic_diff <- sl_row$mean_ndi_change - nc_row$mean_ndi_change
mic_diff_fmt <- fmt(mic_diff)

# Calculating CI's using the Welch t-test for independent groups

tt <- ndi_data_change |>
  filter(anchor_f %in% c("Slightly improved", "No change")) |>
  mutate(anchor_f = forcats::fct_relevel(anchor_f, "Slightly improved", "No change")) |>
  with(t.test(ndi_change ~ anchor_f, conf.level = 0.95))

# Pulling CI's
mic_diff_lo <- tt$conf.int[1]
mic_diff_hi <- tt$conf.int[2]

# Formatting for output
mic_diff_lo_fmt <- fmt(mic_diff_lo)
mic_diff_hi_fmt <- fmt(mic_diff_hi)

When using this technique, the MIC is the difference between the mean in the ‘Slightly improved’ group minus the mean in the ‘No change’ group. We find a slightly lower MIC-value (-3.82) compared to the mean value technique (-4.20) as the change score in the ‘No change’ group is not 0 as would be expected in the perfect world. CI’s can be determined using the Welch t-test for independent groups (the exact values are calculated using the code in the codefold). In our case we find:

\[ \text{MIC} = -4.20 - (-0.38) = -3.82 \text{ points} \; [ \text{CI}_{95\%}: -6.40; -1.24] \]

Now you want to determine the MIC of the NDI using contemporary methods. You decide to look at both anchor properties and the MIC using various methods.

3.1 Anchor dichotomisation

In this exercise, you need to dichotomise the transition question into an improvement variable. We do this as follows:

Improved patients

  • Much improved (1)
  • Improved (2)

Unchanged patients

  • Slightly improve (3)
  • No change (4)
  • Slightly worse (5)

The categories Worse and Much worse are left out because only 12 patients showed clear deterioration, and therefore the MIC for deterioration will not be calculated.

Some authors argue that Slightly improved should be grouped with the improved patients, since this would make the MIC truly reflect the idea of “minimal improvement”. In this example, however, we deliberately place Slightly improved with the unchanged group, to keep the illustration simple.The dicotomous improvement variable you call trat.

To get an overview of the data you make a summary of the most important data and present the results in Table 2.

Code
# Generating improved variable (trat)

ndi_data_trat <- ndi_data_change |> 
  mutate(
    trat = case_when(
      anchor %in% c(1, 2) ~ 1L,      # improved = 1
      anchor %in% c(3, 4, 5) ~ 0L,   # no change = 0
      TRUE ~ NA_integer_             # Rest = NA
    )
  ) |> 
  select(-anchor_f) |> 
  relocate(anchor, .before = trat)

# Testing dichotomisation (uncomment to see results)
# freq(ndi_data_trat$trat)
# ctable(ndi_data_trat$anchor, ndi_data_trat$trat)

# Generating table 2

num_means_sds <- ndi_data_trat |>        # mean, sd of t1, t2 and change
  summarise(
    t1_mean = mean(t1, na.rm = TRUE),
    t1_sd = sd(t1, na.rm = TRUE),
    t2_mean = mean(t2, na.rm = TRUE),
    t2_sd = sd(t2, na.rm = TRUE),
    change_mean = mean(ndi_change, na.rm = TRUE),
    change_sd = sd(ndi_change, na.rm = TRUE)
  )

anch <- ndi_data_trat |>                 # median, IQR of anchor
  summarise(
    anchor_median = median(anchor, na.rm = TRUE),
    anchor_iqr    = IQR(anchor, na.rm = TRUE)
  )

trat_prop <- ndi_data_trat |>            # proportion of improved
  summarise(trat_prop = mean(trat == 1, na.rm = TRUE))

summary_tbl <- tibble(                   # Generating tibble
  variable   = c("t1", "t2", "ndi_change", "anchor", "trat"),
  mean       = c(num_means_sds$t1_mean, num_means_sds$t2_mean, num_means_sds$change_mean, NA, NA),
  sd         = c(num_means_sds$t1_sd,   num_means_sds$t2_sd,   num_means_sds$change_sd,   NA, NA),
  median     = c(NA, NA, NA, anch$anchor_median, NA),
  iqr        = c(NA, NA, NA, anch$anchor_iqr,    NA),
  proportion = c(NA, NA, NA, NA, trat_prop$trat_prop)
)

summary_tbl |>                           # Generating table
  gt(rowname_col = "variable") |>
  tab_header(title = "Table 2. NDI summary statistics") |>
  cols_label(
    mean = "Mean", sd = "SD",
    median = "Median", iqr = "IQR",
    proportion = "Proportion improved"
  ) |>
  fmt_number(columns = c(mean, sd), decimals = 2) |>
  fmt_percent(columns = proportion, decimals = 1) |>
  sub_missing(everything(), missing_text = "") |>
  cols_align(align = "center", columns = everything()) |> 
  tab_options(
    table.layout = "auto",
    heading.align = "left"
  ) |>
  tab_footnote(
    footnote = "Trat = Dichotomised anchor",
    locations = cells_stub(rows = "trat")
  )
Table 2. NDI summary statistics
Mean SD Median IQR Proportion improved
t1 17.96 9.10


t2 14.59 9.86


ndi_change −3.37 9.62


anchor

3 3
trat1



41.1%
1 Trat = Dichotomised anchor

Question

3.1.1 What is the proportion of improved patients in the population and why is it important?

ImportantAnswer

The proportion of improved patients can be seen in variable ‘trat’. As ‘trat’ is a dichotomised variable where 0 = ‘no change’ and 1 = ‘improved’, it follows that 41.1% of the patients have improved.

It is important when we calculate the MIC using predictive modelling. If the improved vs. unchanged are not 50:50, we need to apply a correction formula.

3.2 Anchor correlation to the change score

The next step is to scrutinize the correlation between the change score and the external anchor. Therefore, you calculate the following correlations:

Code
# The correlation is calculated using two methods: Polyserial correlation (assumes continuous var to be normally distributed) and Spearman's correlation.

# -------Polyserial correlation--------------------

# Polyserial function and formatting function
polyserial_tidy <- function(x, y) {
  fit <- polycor::polyserial(x, y, ML = TRUE, std.err = TRUE)
  se  <- sqrt(fit$var[1, 1])
  tibble(
    r_polyserial = unname(fit$rho),
    se           = se,
    ci_low       = fit$rho + qnorm(0.025) * se,
    ci_high      = fit$rho + qnorm(0.975) * se,
    z            = fit$rho / se,
    p_value      = 2 * pnorm(-abs(fit$rho / se))
  )
}

fmt_p <- function(p) ifelse(is.na(p), NA_character_,
                            ifelse(p < .001, "<0.001", sprintf("%.3f", p)))

# Converting anchor into factor (required by polycor)
ndi_data_anc_fac <- ndi_data_trat |> 
  mutate(anchor_ord = ordered(anchor, levels = sort(unique(anchor))))


# Polyserial correlation (ML)
poly_test <- polyserial_tidy(ndi_data_anc_fac$ndi_change, ndi_data_anc_fac$anchor_ord)

# -------Spearman's correlation--------------------

spearman_test <- cor.test(ndi_data_anc_fac$ndi_change, as.numeric(ndi_data_anc_fac$anchor_ord),
                          method = "spearman", exact = FALSE)
r_s <- unname(spearman_test$estimate)  # Spearman's rho
p_s <- spearman_test$p.value
n   <- nrow(ndi_data_anc_fac)

# Generating tibble with correlations

corr_tbl_dta <- tibble(
  Coefficient = c("Spearman’s ρ", "Polyserial r"),
  Estimate    = c(r_s, poly_test$r_polyserial),
  SE          = c(NA_real_, poly_test$se),
  `95% CI (polyserial)` = c(NA_character_, sprintf("[%.2f, %.2f]", poly_test$ci_low, poly_test$ci_high)),
  `p-value`   = c(fmt_p(p_s), fmt_p(poly_test$p_value)),
  N           = c(n, n)
)

# gt table
cor_tbl <- corr_tbl_dta |>
  gt() |>
  fmt_number(columns = c(Estimate, SE), decimals = 2) |>
  cols_label(
    Coefficient = "Coefficient",
    Estimate    = "Estimate",
    SE          = "SE",
    `95% CI (polyserial)` = "95% CI",
    `p-value`   = "p-value",
    N           = "N"
  ) |>
  cols_align(
    align   = "center",
    columns = c(Estimate, SE, `95% CI (polyserial)`, `p-value`, N)
    ) |> 
  tab_header(
    title = "Association between NDI change score and 7-point anchor",
  ) |>
  tab_footnote(
    footnote = "Polyserial estimated via polycor::polyserial (ML); SE and CI from asymptotic normality.",
    locations = cells_column_labels(columns = `95% CI (polyserial)`)
  )

cor_tbl
Association between NDI change score and 7-point anchor
Coefficient Estimate SE 95% CI1 p-value N
Spearman’s ρ 0.76 NA NA <0.001 331
Polyserial r 0.75 0.02 [0.71, 0.80] <0.001 331
1 Polyserial estimated via polycor::polyserial (ML); SE and CI from asymptotic normality.

Question

3.2.1 Explain what the correlation coefficients means and why they are important.

ImportantAnswer

We report two correlation coefficients between the NDI change score (continuous) and the 7-point anchor (ordinal):

Polyserial correlation: > Treats the 7-point anchor as a grouped version of an underlying continuous construct and asks, “how closely does the change score track that underlying state?”

Spearman’s rho: > A rank-based check that asks, “as the anchor goes up, does the change score tend to go up too, and by how much, ignoring exact spacing?”

Both coefficients range from –1 to +1. The sign (– or +) tells you the direction (does higher anchor mean higher change score?)

When the correlation is strong, the “improved” and “unchanged” groups, defined by the anchor, separate cleanly (i.e., peaked curves with little overlap) so the anchor-based MIC is more trustworthy. When the correlation is weak, the curves flatten and overlap, which increases misclassification (people labeled “improved” may look similar to “unchanged” and vice versa). You can often improve the correlation by aligning the content of the anchor with the domain of the questionnaire. Most authors agree that a correlation of >0.5 is acceptable, however, others accept >0.3.

In our study we find:

  • Polyserial \(r\): 0.75 with 95% CI: [0.71; 0.8]
  • Spearman’s \(\rho\): 0.76

These two, taken together, indicate a meaningful association between the change score and the anchor (direction depends on your coding). That supports using the anchor to interpret change on the NDI.

3.3 Anchor reliability

Anchor reliability is estimated using confirmatory factor analysis.

Code
# Inspecting dataset for category frequencies

# dfSummary(ndi_data_trat)

# Recoding data from 0-5 to 0-4 as some items have too few responses in cat 5 (i.e. collapsing cat. 5 = 4).
ndi_data_trat <- ndi_data_trat |>
  mutate(
    across(
      .cols = c(
        num_range("n", 1:10, width = 0, suffix = "_1"),
        num_range("n", 1:10, width = 0, suffix = "_2")
        ),
        ~ case_when(
          .x %in% 4:5 ~ 4L,
          TRUE ~ (.x)
      )
    )
  )

# First we specify the model to estimate the anchor reliability

model <- '
  F1 =~ n1_1+n2_1+n3_1+n4_1+n5_1+n6_1+n7_1+n8_1+n9_1+n10_1+trat
  F2 =~ n1_2+n2_2+n3_2+n4_2+n5_2+n6_2+n7_2+n8_2+n9_2+n10_2+trat
  
  # Correlated errors over time
  
  n1_1 ~~ n1_2
  n2_1 ~~ n2_2
  n3_1 ~~ n3_2
  n4_1 ~~ n4_2
  n5_1 ~~ n5_2
  n6_1 ~~ n6_2
  n7_1 ~~ n7_2
  n8_1 ~~ n8_2
  n9_1 ~~ n9_2
  n10_1 ~~ n10_2
  
  # New residual covariance suggesed by MI
  
  '

# Then we apply the model to our dataset using tr_reliability from the MIC-package

reliability <- tr_reliability(data = ndi_data_trat, model = model)

glue("The anchor reliability is: {round(reliability$reliability, 2)}")
The anchor reliability is: 0.88

Questions

3.3.1 Discuss what the anchor reliability tells you?

ImportantAnswer

The anchor reliability tells you how much trust you can place in the anchor as a ruler for true change. The anchor reliability is the fraction of the observed anchor variance that reflects true change rather than random noise. A reliability of 0.88 means that 88% is signal (true change) and 12% is noise.

Methods that choose a PROM change threshold by predicting the anchor (e.g., ROC/predictive modeling) inherit bias when the anchor is noisy. If more than 50% of patients are labeled “improved,” the MIC tends to be over-estimated; if fewer than 50%, it tends to be under-estimated and poorer reliability amplifies that bias.

3.3.2 What do you think of the anchor reliability?

ImportantAnswer

Our anchor reliability is 0.88. There’s no single acceptable value, however, simulation studies by Terluin et al. (2022) have shown that reliabilities around 0.3–0.6 are common and workable for group-level MIC estimation if you report the reliability and use the reliability-adjusted MIC. As our estimate is much higher than the proposed 0.3-0.6, we consider the reliability to be excellent.

3.4 Anchor present-state bias

Lastly, we will estimate present-state bias of the anchor using longitudinal CFA modelling as included in the MIC-package.

Code
# Using LCFA for estimating present-state bias (and other things)

model_cfa <- '
   # Factor specifications
   
   F1 =~ a1*n1_1+a2*n2_1+a3*n3_1+a4*n4_1+a5*n5_1+a6*n6_1+a7*n7_1+a8*n8_1+a9*n9_1+a10*n10_1+f1*trat
   F2 =~ a1*n1_2+a2*n2_2+a3*n3_2+a4*n4_2+a5*n5_2+a6*n6_2+a7*n7_2+a8*n8_2+a9*n9_2+a10*n10_2+f2*trat

   # Correlated errors over time

   n1_1 ~~ n1_2
   n2_1 ~~ n2_2
   n3_1 ~~ n3_2
   n4_1 ~~ n4_2
   n5_1 ~~ n5_2
   n6_1 ~~ n6_2
   n7_1 ~~ n7_2
   n8_1 ~~ n8_2
   n9_1 ~~ n9_2
   n10_1 ~~ n10_2

   # Thresholds

   n1_1 + n1_2 | b11*t1+b12*t2+b13*t3
   n2_1 + n2_2 | b21*t1+b22*t2+b23*t3
   n3_1 + n3_2 | b31*t1+b32*t2+b33*t3
   n4_1 + n4_2 | b41*t1+b42*t2+b43*t3
   n5_1 + n5_2 | b51*t1+b52*t2+b53*t3
   n6_1 + n6_2 | b61*t1+b62*t2+b63*t3
   n7_1 + n7_2 | b71*t1+b72*t2+b73*t3
   n8_1 + n8_2 | b81*t1+b82*t2+b83*t3
   n9_1 + n9_2 | b91*t1+b92*t2+b93*t3
   n10_1 + n10_2 | b101*t1+b102*t2+b103*t3

   # Variances/covariances

   F1 ~~ 1*F1
   F2 ~~ NA*F2
   F1 ~~ NA*F2
   
  # Residual variances at follow-up are freely estimated (by the data)
  # Baseline residual variance is implicitly fixed to 1 – that’s why there is no Item_1 ~~ 1*Item_1 line in the code.

   n1_2 ~~ NA*n1_2
   n2_2 ~~ NA*n2_2
   n3_2 ~~ NA*n3_2
   n4_2 ~~ NA*n4_2
   n5_2 ~~ NA*n5_2
   n6_2 ~~ NA*n6_2
   n7_2 ~~ NA*n7_2
   n8_2 ~~ NA*n8_2
   n9_2 ~~ NA*n9_2
   n10_2 ~~ NA*n10_2

   # Means/intercepts

   F1 ~  0*1
   F2 ~ NA*1

   # Equal-but-opposite constrained factor loadings TR
   # remove this for psb assessment
   # f1 == -f2

   # b_param for trt (trt = transition rating)

   trat | thr.trt*t1
   psb := (f1/f2) +1
   b_param := thr.trt/f2
   '

# Preparing dataset for mic_lcfa in MIC-package
# ndi_data_lcfa <- ndi_data_trat |>
#  select(!c(t1, t2, ndi_change, anchor)) |>
#  filter(!is.na(trat))     # Removing NA's = the patients who got worse

# Estimating present-state bias (and other things) using the MIC-package
# Code is commented out to save time when rendering document

# set.seed(22082025)
# mic_ndi_lcfa <- mic_lcfa(mydat = ndi_data_lcfa, model = model_cfa, B = 30) ## should actually do > 50 bootstrap iterations!
# saveRDS(mic_ndi_lcfa, "mic_ndi_lcfa.rds")

mic_ndi_lcfa <- readRDS("mic_ndi_lcfa.rds")

glue("The present state bias is: {round(mic_ndi_lcfa$psb, 2)}")
The present state bias is: 0.48

Questions

3.4.1 Discuss what present-state bias is?

ImportantAnswer

Present-state bias is a systematic tendency for patients’ ratings of change (e.g., anchor questions) to be influenced more by how they feel at follow-up than by the actual difference between baseline and follow-up. In effect, current health status “outweighs” memory of baseline, distorting anchor-based estimates of change.

3.4.2 How do you interpret the present-state bias coefficient?

ImportantAnswer

If the present-state bias (PSB) coefficient is estimated using the constrained version, then MIC stays reliable up to approx. 40% PSB. However, if \(MIC_{LCFA}\) is estimated using the unconstrained version, then PSB does not affect our MIC coefficent no matter the degree of PSB. Therefore our MIC estimates will be more precise.

As the PSB in our data is 0.48, we need to use the unconstrained version of \(MIC_{LCFA}\).

3.5 MIC using the ROC method

The first MIC value we calculate is the MIC based on the Receiver Characteristic Curve method (\(MIC_{ROC}\)). From the MIC-package we get the results presented in Table 3:

Code
# MIC ROC
ndi_mic_roc <- mic_roc(ndi_data_trat, x = "t1", y = "t2", tr = "trat")

# MIC ROC CI's
ndi_mic_roc_ci <- bootCImic(ndi_data_trat, mic = "roc", x = "t1",  y = "t2", tr = "trat") |> 
  select(
    lower = ".lower",
    upper = ".upper"
    )

# Tibble with important values
ndi_mic_roc_tbl <- tibble(
  method   = md("MIC ROC"),
  mic      = round(ndi_mic_roc, 2),
  ci_lower = round(ndi_mic_roc_ci$lower, 2),
  ci_upper = round(ndi_mic_roc_ci$upper, 2)
)

# Table 3
ndi_mic_roc_tbl |>
  gt() |>
  cols_merge(
    columns = c(ci_lower, ci_upper),
    pattern = "[{1}; {2}]"
  ) |> 
  tab_header(title = "Table 3. MIC using ROC method with CI's") |>
  cols_label(
    method   = "Method",
    mic      = md("MIC (points)"),
    ci_lower = "95% CI"
  ) |>
  fmt_number(columns = c(mic, ci_lower), decimals = 2) |>
  cols_align(align = "center", columns = everything())
Table 3. MIC using ROC method with CI's
Method MIC (points) 95% CI
MIC ROC −4.50 [−4.50; 1.5]

Question

3.5.1 Describe what the \(MIC_{ROC}\) value with CI’s mean

ImportantAnswer

Our \(MIC_{ROC}\) = -4.5 points. This means that a patient has minimally improved when the change score is > -4.5 points. However, the true \(MIC_{ROC}\) ranges from almost no improvement of (1.5) points to -4.5 points.

3.6 MIC using predictive modelling

Next we look at MIC using predictive modelling. To get an overview, we calculate the different predictive modelling values with CI’s:

  • Predictive modelling (PM)
  • Adjusted predictive modelling (APM)
  • Improved adjusted predictive modelling (IAPM)

These are presented in Table 4.

Code
# Removing rows if trat == NA (the patients who got worse)
ndi_data_trat_IAPM <- ndi_data_trat |> 
  filter(!is.na(trat))

# MIC using predictive modelling
set.seed(22082025)
ndi_mic_IAPM <- mic_iapm(mypred= "ndi_change", anchor = "trat", mydata= ndi_data_trat_IAPM, tr_rel = reliability$reliability, nboot = 1000)

# Generating CI's for pm, apm, iapm manually

# 1. Bootstrap resamples of ndi_data_trat_IAPM
set.seed(22082025)
boots <- rsample::bootstraps(ndi_data_trat_IAPM, times = 1000, apparent = TRUE)

# 2. Generating MIC function
mics_fnc <- possibly(
  function(split) {
    dat <- rsample::analysis(split)
    out <- mic_iapm(
      mypred = "ndi_change",
      anchor = "trat",
      mydata = dat,
      tr_rel = reliability$reliability,
      nboot  = 0
    )
    c(pm = out$mic_pm, apm = out$mic_apm, iapm = out$mic_iapm)
  },
  otherwise = c(pm = NA_real_, apm = NA_real_, iapm = NA_real_)
)

# 3. Run across resamples
mic_draws <- boots |>
  mutate(est = map(splits, mics_fnc)) |>
  tidyr::unnest_wider(est, names_sep = "_") 

# 4. 95% CIs 
ci_tbl <- tibble(
  method = c("mic_pm", "mic_apm", "mic_iapm"),
  lower  = c(
    quantile(mic_draws$est_pm,  0.025, na.rm = TRUE),
    quantile(mic_draws$est_apm, 0.025, na.rm = TRUE),
    quantile(mic_draws$est_iapm,0.025, na.rm = TRUE)
  ),
  upper  = c(
    quantile(mic_draws$est_pm,  0.975, na.rm = TRUE),
    quantile(mic_draws$est_apm, 0.975, na.rm = TRUE),
    quantile(mic_draws$est_iapm,0.975, na.rm = TRUE)
  )
)

# 5. MIC estimates from the full sample (from MIC-package)
mic_IAPM_estimates <- tibble(
  method   = c("mic_pm","mic_apm","mic_iapm"),
  estimate = c(ndi_mic_IAPM$mic_pm, ndi_mic_IAPM$mic_apm, ndi_mic_IAPM$mic_iapm)
)

# 6. Joining MIC estimates with CI's
mic_IAPM_estimates_ci <- dplyr::left_join(mic_IAPM_estimates, ci_tbl, by = "method")

# 7. Generating gt table 4 for display

table4 <- mic_IAPM_estimates_ci |>
  # use mutate(.keep = "none") to rebuild only the columns we want
  mutate(
    method = recode(method,
      mic_pm   = "MIC<sub>PM</sub>",
      mic_apm  = "MIC<sub>APM</sub>",
      mic_iapm = "MIC<sub>IAPM</sub>"
    ),
    estimate = estimate,  # keep estimate explicitly when .keep = "none"
    ci_lower = lower,     
    ci_upper = upper,
    .keep = "none"        # drop everything not created above
  ) |>
  gt() |>
  fmt_markdown(columns = method) |>                      # render <sub> tags
  fmt_number(columns = c(estimate, ci_lower, ci_upper),
             decimals = 2) |>
  cols_merge(                                            # merge CI as [lower; upper]
    columns = c(ci_lower, ci_upper),
    pattern = "[{1}; {2}]"
  ) |>
  cols_label(
    method   = "Method",
    estimate = "MIC (points)",
    ci_lower = "95% CI"
  ) |>
  cols_align(align = "center", columns = c(estimate, ci_lower)) |>
  tab_header(title = "Table 4. MIC estimates with bootstrap CIs") |>
  tab_options(heading.align = "left")

table4
Table 4. MIC estimates with bootstrap CIs
Method MIC (points) 95% CI
MICPM −3.43 [−4.94; −3.15]
MICAPM −3.92 [−4.81; −3.06]
MICIAPM −4.83 [−5.93; −3.85]

Questions

3.6.1 Discuss what you see in Table 4.

ImportantAnswer

Across methods the MIC is very consistent: a decrease of about 5 points on the NDI marks an important improvement.

With 41.07% classified as improved, prevalence is essentially balanced, so PM (-3.43 [-4.94; -3.15]) and APM (-3.92 [-4.81; -3.06]) are nearly identical, and the prevalence adjustment adds little.

Accounting for the anchor’s reliability (0.88), IAPM yields a slightly less extreme threshold, -4.83 [-5.93; -3.85], and, as expected, wider uncertainty because it propagates measurement error (CI widths are 1.79/1.75 points for PM/APM and 2.08 for IAPM).

Given the imperfect anchor, IAPM is the most defensible primary estimate; you can report it as a ~5 point reduction (95% CI -4 to -6 points), noting that negative values reflect improvement.

3.6.2 What do you think about the \(MIC_{ROC}\) compared to the \(MIC_{IAPM}\) ?

ImportantAnswer

The \(MIC_{ROC}\) is -4.5 which is slightly lower compared to \(MIC_{IAPM}\) (-4.83). However, the CI of \(MIC_{ROC}\) has a width of 6 points compared to 2.08 for \(MIC_{IAPM}\) making our estimate more precise.

Second, the \(MIC_{IAPM}\) takes the prevalence of improved and reliability into account which is not the case with \(MIC_{ROC}\).

The MIC estimates are similar in magnitude (\(MIC_{ROC}\) = -4.5 (-4.5; 1.5) vs \(MIC_{IAPM}\) = -4.83 (-5.93; -3.85), a difference of only 0.33 points.

However, the \(MIC_{ROC}\) CI is very wide (6 points) and even includes deterioration (1.5), indicating much lower precision and instability from dichotomizing the anchor and not accounting for measurement error.

In summary, both methods point to a ~5-point reduction as the MIC, but \(MIC_{IAPM}\) is the more defensible primary estimate due to its correction for % improved and reliability and therefore substantially greater precision.

3.7 MIC using longitudinal confirmatory factor analysis (LCFA)

Lastly, we calculate the MIC using longitudinal confirmatory factor analysis. The result is presented in Table 5.

Code
lcfa_tbl <- tibble(
  method   = md("MIC<sub>LCFA</sub>"),
  mic      = round(mic_ndi_lcfa$MIC.ets, 2),
  ci_lower = round(mic_ndi_lcfa$MIC_CI["MIC.ets_boot", "Lower"], 2),
  ci_upper = round(mic_ndi_lcfa$MIC_CI["MIC.ets_boot", "Upper"], 2)
)

table5 <- gt(lcfa_tbl) |>
  tab_header(title = "Table 5. MIC-lcfa estimate with bootstrap CI") |>
  cols_merge(
    columns = c(ci_lower, ci_upper),
    pattern = "[{1}; {2}]"               # merge into CI format
  ) |>
  cols_label(
    method   = "Method",
    mic      = "MIC (points)",
    ci_lower = "95% CI"                  # after merge, this becomes the CI col
  ) |>
  fmt_markdown(columns = method) |>
  cols_align("center", c(mic, ci_lower)) |>
  tab_options(heading.align = "left")

table5
Table 5. MIC-lcfa estimate with bootstrap CI
Method MIC (points) 95% CI
MICLCFA -5.86 [-6.53; -4.83]

Question

3.7.1 Compare the results of Table 4 and Table 5 and discuss what you see.

ImportantAnswer

The two methods converge on the same story: a ~5-point reduction on the NDI marks important improvement.

Table 4 gives \(MIC_{PM}\) = -3.43 points, \(MIC_{APM}\) = -3.92 points, and \(MIC_{IAPM}\) = -4.83 points. Table 5 shows the \(MIC_{LCFA}\) = -5.86 points. The point estimates differ by between 2.43 (\(MIC_{PM}\) vs. \(MIC_{LCFA}\)) and 1.03, and using the most precise estimates (\(MIC_{IAPM}\) and \(MIC_{LCFA}\)), this is considered clinically trivial and well within overlapping CIs.

With 41.07% improved, the prevalence is unbalanced, so \(MIC_{APM}\) \(\neq\) \(MIC_{PM}\) (even thought the difference is < 1 point). The \(MIC_{IAPM}\) correction for the anchor’s reliability 0.88 shifts the threshold slightly and widens the CI marginally as expected.

In summary, if your LCFA model fits well (and invariance holds), it corroborates with the results of the IAPM predictive-modelling and strengthens your findings.

To download the answers provided in this exercise, right-click on the page and choose ‘save as’. This saves a standalone html page (sometimes a folder with relevant html information is also created).

Download the two datasets below:

(right-click the link and choose ‘Save as’)

To import it into R use the code below. R-code is provided throughout the exercise:

Code
# Importing the 'ndi_synthetic_teaching.rds':

ndi_data <- readRDS("ndi_synthetic_teaching.rds") |> 
  select(-synthetic)

# Importing the ''ndi_synthetic_teaching.rds'mic_ndi_lcfa.rds':

mic_ndi_lcfa <- readRDS("mic_ndi_lcfa.rds")

The R libraries used are these:

Code
library(tidyverse)  # data wrangling (dplyr/tidyr), plotting (ggplot2), tibbles, helpers
library(glue)       # Working with strings
library(gt)         # nicely formatted tables in Quarto
library(here)       # For locating root folder
library(skimr)      # quick dataset overviews with skim()
library(summarytools) # Frequency tables for variables
library(MIC)        # For calculating MIC-values
library(lavaan)     # Used by MIC-package
library(polycor)    # Used for polyserial correlations
library(mirt)       # Multidimensional Item Response Theory
library(rsample)    # for resampling with bootstrap