# Comparing two sets of limits of agreement (continuous outcome) - R

I am planning an analysis where I will have children and parents rating the child's pain (numerical score). For each child, I will have a child pain score and a parent pain score. The dyads will grouped by SES, high vs low. I want to know if high SES dyads are more or less likely to agree than low SES dyads. My first thought is to construct a Bland-Altman plot for the high and low SES dyads and eye-ball the differences but is there a more formal way of doing this?

For example, similar to this answer, would reducing the problem to a simple t test / variance test be valid, like below? I used Felix S' answer here to generate correlated data with getBiCop().

patientscores <- rnorm(100, 5, 1)

carerscores1 <- getBiCop(100, 0.8, x=patientscores)[, 2]
carerscores2 <- getBiCop(100, 0.6, x=patientscores)[, 2]

df1 <- data.frame(1:100, rep(1, 100), patientscores, carerscores1)
df2 <- data.frame(101:200, rep(2, 100), patientscores, carerscores2)
colnames(df1) <- c("id", "SES", "childscore", "parentscore")
colnames(df2) <- c("id", "SES", "childscore", "parentscore")
dfall <- rbind(df1, df2)

plot(df1$childscore, df1$parentscore)
plot(df2$childscore, df2$parentscore)

library(BlandAltmanLeh)
bland.altman.plot(dfall$childscore, dfall$parentscore)
bland.altman.plot(df1$childscore, df1$parentscore)
bland.altman.plot(df2$childscore, df2$parentscore)

a <- df1$childscore - df1$parentscore
b <- df2$childscore - df2$parentscore
t.test(a, b)
var.test(a, b)


The Bland-Altman plots show that the limits of agreement in group 1 are better (narrower) than in group 2.

The t test of the differences is significant suggesting that the mean differences vary and therefore that there is more bias in one group compared to the other. The variance test is also significant confirming that one group is indeed more variable than the other, and supporting my interpretation based on visually examining the Bland-Altman plots.

• This is a great question! - - I think your study setting is valid because you study the mean and variance. Can you please specify how you have specific the value of $\alpha$ and tailness in your study design? Commented Nov 17, 2016 at 20:43