I have the following data frame and the following two models with lme4's Generalized Linear Mixed-Effects Models (glmer):
df <- structure(list(treatment = structure(c(1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("CCF",
"UN"), class = "factor"), random = structure(c(3L, 3L, 3L, 3L,
3L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 4L, 4L, 4L, 4L, 4L,
5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L), .Label = c("1.6",
"2", "3.2", "5", NA), class = "factor"), continuous1 = c(53.1859431331665,
53.9920752359492, 52.2060995286371, 52.7309097715147, 52.9687621513265,
52.7792820518053, 53.324237379658, 53.0769265513933, 52.562144337307,
52.9159833925859, 52.9851480591277, 53.2108929763236, 52.5627005607629,
52.6586547788481, 52.9528178963356, 52.8751803009764, 52.0389070727281,
53.4611376738915, 53.4516478896541, 52.9340159927059, 53.0960900649167,
52.7185163546668, 52.5277022312295, 53.4332374842224, 52.7286868682608,
52.5427283883897, 50.5643976998344, 54.5119621732914, 54.8752697204122,
52.3895192119411, 52.6623860459687, 53.2895954023616, 52.7207909990632,
52.3422155906552, 51.7977738690975), continuous2 = c(1.64153094886205,
3.91593723271292, 1.94039630728038, 2.81456503996437, 1.07971524769264,
1.67711446647817, 1.92137892126384, 1.96087397451467, 2.21602000526086,
1.45794117443253, 2.75353217433675, 5.36536076058866, 0.833434180091457,
3.65998714174906, 2.56715261161435, 1.37475468782539, 1.13569710795522,
1.32327007970416, 1.14942423621912, 1.47707078226047, 2.7508022340832,
3.5764241495006, 2.3070166819956, 2.49896565066211, 4.36424795471221,
2.13701784901259, 1.98293342019671, 5.03952187899644, 2.99575072457674,
2.63204944520792, 3.38134648323956, 2.0556994322415, 2.66809379088059,
2.19167325121191, 2.22274607227071)), class = "data.frame", row.names = c(61L,
62L, 63L, 64L, 65L, 66L, 67L, 68L, 69L, 70L, 71L, 72L, 73L, 74L,
75L, 76L, 77L, 78L, 79L, 80L, 126L, 127L, 128L, 129L, 130L, 131L,
132L, 133L, 134L, 135L, 136L, 137L, 138L, 139L, 140L))
Model one:
library(lme4)
model1<- glmer ((continuous1) ~ treatment + (1|random),
REML = TRUE, data = df, family = Gamma(link = "identity"))
Model two:
model2<- glmer ((continuous2) ~ treatment + (1|random),
REML = TRUE, data = df, family = Gamma(link = "identity"))
What I would like to know is why isSingular(model1) returns "TRUE" whereas isSingular(model2) returns "FALSE"?
This is an experiment with two plots (the treatments). Please consider that my random effect is only applicable within one treatment. This is because the treatment with random values was subject to an earlier experiment which I am not interested in, but I want to account for in the model. That is why random has "NA"s in treatment "UN"