What does my "Error: factor level [4] is duplicated" in AS-Reml R mean?

85 Views Asked by At

For my PhD I am currently running a bivariate variance component estimation in AS Reml R with the following command:

Test <- asreml(cbind(Reflex,lakt_1) ~ trait + Betriebsnummer + 
    at(trait,1):gestLength + at(trait,1):halfyear,
  random= ~us(trait):vm(SampleID,Gs),
  residual= ~units:diag(trait),
  data= phenW,
  workspace= 128e06)

but every time I try to run it i get the following error message:

Error in levels <- (*tmp*, value = as.character(levels)) : factor level [4] is duplicated

My fixed factors (Betriebsnummer, gestLength and halfyear) are all defined as factors and I also set their attribute to "unique". I also did that with my random term, SampleID is a factor and Gs my genetic relationship matrix. phenW is my data set, it is a data frame. Reflex and lakt_1 are my response variables.

Is anybody able to help me?

0

There are 0 best solutions below