I was trying to learn how to estimate exchangable correlation matrix. I asked ChatGPT to give me an example so that I can learn the steps and ChatGPT gave me this example
Lines <- "ID Time Z
1 1 -1.5
1 2 -1.5
1 3 0.5
1 4 0.5
2 1 -0.5
2 2 -0.5
2 3 1.5
2 4 1.5"
DF <- read.table(text = Lines, header = TRUE)
resd <- DF$Z
n <- length(resd)
sigma <- var(resd)
rho <- 1 / (n - 1) * sum(resd[-1] * resd[-n]) / sigma
ExCorr <- matrix(rho, 4, 4)
diag(ExCorr) <- 1
1 0.325 0.325 0.325
0.325 1 0.325 0.325
0.325 0.325 1 0.325
0.325 0.325 0.325 1
I like to get references for this method of estimating the exchangeable correlation matrix
1 / (n - 1) * sum(resd[-1] * resd[-n]) / sigma, how do I identify the source for this formula ? Thanks.
geefit$geese$alphawhen I set corstr = "exchangeable". I will go through your references. Thanks – Ahir Bhairav Orai Mar 01 '23 at 22:14