This is my model:
library (mvord)
roedores2 <- mvord(datos(IndicAD) ~ Trat + Tiempo +
Trat:Tiempo+(1|Tiempo) + (1|Granja), data = datos,
error.structure = cor_ar1(~Tiempo), link = mvprobit(),
control = mvord.control(solver = "BFGS"))
"IndicAD" is a ordinal variable with 0,1,2,3,4 as posible responses
"Trat" is a factor with 3 levels
"Tiempo" is a factor (repeated measurement over time) with 11 levels (times)
"Granja" is a factor with two levels (two sites of sample)
But I keep getting this error:
Error in seq_len(rho$ndim) :
argument must be coercible to non-negative integer
In addition: Warning message:
In seq_len(rho$ndim) : first element used of 'length.out' argument
The
mvord
package is working with multivariate ordinal regression with the meaning that response variable should contain more than one factor. In your case it is only oneindcAD
somvord
function fails.In case you have two ordered factors
indcAD1
andindcAD2
the algorith would work OK. In case you need to use univariate ordinal regression where response value is one factor you can use e.g.polr
byMASS
package.