# Problematic data for regression model

This is a follow-up question to Which model for my data? (testing the differences in slope for three groups).

The solution from there works (big thanks to Heteroskedastic Jim!), but I have a problem with a specific data set. Maybe someone can enlighten me why I get stuck.

Here is an example that works:

library(nlme)
library(emmeans)

Input = ("
Group   Time    Size
A  1   1.08152
A  2   1.10589
A  3   1.13292
B  1   1.04597
B  2   1.05763
B  3   1.07023
B  4   1.08612
B  5   1.10059
B  6   1.11589
B  7   1.13143
B  8   1.14741
B  9   1.16721
B  10  1.18288
C  1   1.04777
C  2   1.06145
C  3   1.07484
C  4   1.08908
C  5   1.10346
C  6   1.11866
C  7   1.13375
C  8   1.14931
C  9   1.16563
C  10  1.18294
")


This constructs the model:

(m1 <- gls(Size ~ Time * Group, dat, correlation = corAR1(form = ~ Time | Group), weights = varIdent(form = ~ 1 | I(Group == "A"))))


And this provides me with the p-values for slope differences:

pairs(emtrends(m1, ~ Group, var = "Time", df = Inf, options = get_emm_option("emmeans")))


Now the data set where I get stuck:

Input = ("
Group   Time    Size
A  1   1.6210
A  2   2.1118
A  3   2.6026
A  4   3.0934
B  1   0.9162
B  2   1.2122
B  3   1.5082
B  4   1.8042
B  5   2.1002
B  6   2.3962
B  7   2.6922
B  8   2.9882
B  9   3.2842
B  10  3.5802
C  1   0.82701
C  2   1.13441
C  3   1.44181
C  4   1.74921
C  5   2.05661
C  6   2.36401
C  7   2.67141
C  8   2.97881
C  9   3.28621
C  10  3.59361
")


When I construct the above model with this specific data

(m1 <- gls(Size ~ Time * Group, dat, correlation = corAR1(form = ~ Time | Group), weights = varIdent(form = ~ 1 | I(Group == "A"))))


I get this error message:

Error in glsEstimate(object, control = control) : computed "gls" fit is singular, rank 6


I have tried analyzing the data in SPSS, but I also got stuck there.

So my question is: where is the problem with my data and what can I do to solve it?

• So you kept the same model but changed the data, and the model cannot be estimated anymore? Sep 19, 2019 at 13:11
• Yes, this is correct. Sep 20, 2019 at 7:38
• Is time a factor or a variable? Sep 22, 2019 at 11:47
• Time is a variable. Sep 23, 2019 at 9:21