Dear Joe,
You have too few subjects with 4 observations. Either drop those fourth
observations. Or use a different correlation structure. E.g. an AR1
fit <- lme(
opp ~ time * ccog, random = ~1 | id,
correlation = corSymm(), data = dat, subset = time < 3
)
fit_alt <- lme(
opp ~ time * ccog, random = ~1 | id,
correlation = corAR1(form = ~ time), data = dat
)
Best regards,
ir. Thierry Onkelinx
Statisticus / Statistician
Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry.onkelinx at inbo.be
Havenlaan 88 bus 73, 1000 Brussel
www.inbo.be
///////////////////////////////////////////////////////////////////////////////////////////
To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey
///////////////////////////////////////////////////////////////////////////////////////////
<https://www.inbo.be>
Op ma 15 mrt. 2021 om 03:27 schreef Tip But <fswfswt at gmail.com>:
Dear Members,
In my longitudinal data below, the first couple of subjects were measured
4
times but the rest of the subjects were measured 3 times (see data below).
We intend to use an unstructured residual correlation matrix in
`nlme::lme()`. But our model fails to converge.
Question: Given our data is unbalanced with respect to our grouping
variable (i.e., `id`), can we use ` corSymm()`? And if we do, what would
be
the dimensions of the resultant unstructured residual correlation matrix
for our data; a 3x3 or a 4x4 matrix?
Thank you for your expertise,
Joe
# Data and R Code
dat <- read.csv("https://raw.githubusercontent.com/hkil/m/master/un.csv")
library(nlme)
fit <- lme(opp~time*ccog, random = ~1|id, correlation=corSymm(form = ~ 1 |
id),
data=dat)
Error:
nlminb problem, convergence error code = 1
message = false convergence (8)
[[alternative HTML version deleted]]