remlf90: intercept and random versus fixed effects

67 views
Skip to first unread message

H G D

unread,
Jun 17, 2020, 7:10:59 PM6/17/20
to breedR
Dear breedR users and maintainers,

Q1:
I am in the process of building my model using a spatial effect and a genetic effect, later also with a pedigree and marker data.
At the moment I am trying to decide, whether I should model "genotype", which is just a number given to each breeding line, as a random or fixed effect. Interestingly, the model does really generate different estimates for the effect depending if it is random or fixed. Is this due to the fact that the random effect show more "shrinkage". It seems so at least, since the random genotypic effect has a similar mean but a smaller deviation than the fixed genotypic effect. Here are the two models I have tried fitting, as well as a graph showing the tow estimates for random and fixed effects

      res <- remlf90(dat = dat, fixed = FZ ~ 1,
                     random = ~ GEN, method = 'ai',
                     spatial = list(model = 'AR', coord = dat[, c('ROW','COL')], rho = c(.8,.8)))

      res <- remlf90(dat = dat, fixed = FZ ~ 1 + GEN,
                     random = NULL, method = 'ai',
                     spatial = list(model = 'AR', coord = dat[, c('ROW','COL')], rho = c(.8,.8)))


Q2: When fitting the model with genotype as fixed effect, I cannot extract an intercept, even if I am adding it into the formula for fixed effects. Can anyone explain, I suspect that the intercept will be integraget into the fixed genotypic effect, but I would rather have tow seperate fixed effects.

Q3: When adding the intercept and the random genotypic effect, I also add the Standard errors, by adding the squared standard errors and calculating the square root afterwards, to get a SE for the sum. Is this the right procedure?

Thanks for any help
Best Regards,
Hermann

Facundo Muñoz

unread,
Jun 18, 2020, 3:22:20 AM6/18/20
to bre...@googlegroups.com

Dear Hermann,

On 18/06/2020 01:10, H G D wrote:
Dear breedR users and maintainers,

Q1:
... whether I should model "genotype", which is just a number given to each breeding line, as a random or fixed effect. Interestingly, the model does really generate different estimates for the effect depending if it is random or fixed. Is this due to the fact that the random effect show more "shrinkage".

It is very likely the case. Especially for the genotypes with fewer observations, whose estimates would borrow more information from the population. How many observations do you have per genotype?

With that many genotypes, using fixed effects imply a single independent parameter for each of them. That's a lot of parameters, which require a lot of observations per genotype.


Q2: When fitting the model with genotype as fixed effect, I cannot extract an intercept, even if I am adding it into the formula for fixed effects. Can anyone explain, I suspect that the intercept will be integraget into the fixed genotypic effect, but I would rather have tow seperate fixed effects.

Yes, breedR (its underlying engine, really) is a bit arbitrary with regard to the contrasts. It will take one genotype as a baseline (which will be represented by the intercept) and estimate the rest as deviations from that baseline.

If you rather want a global mean and deviations from that mean, you can always calculate these coefficients afterwards from the estimates you get.


Q3: When adding the intercept and the random genotypic effect, I also add the Standard errors, by adding the squared standard errors and calculating the square root afterwards, to get a SE for the sum. Is this the right procedure?

That's approximately right, assuming independence. Which is a mild assumption in comparison to the asymptotic assumptions already necessary for coming up with the SE of the random effects. So, I would accept it, with a healthy bit of skepticism, specially for genotypes with fewer observations.

Hope it helps

ƒacu.-




Thanks for any help
Best Regards,
Hermann
--
Report issues at https://github.com/famuvie/breedR/issues
---
You received this message because you are subscribed to the Google Groups "breedR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to breedr+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/breedr/c96fefb2-e67c-472c-9889-7f38dafe4985o%40googlegroups.com.

H G D

unread,
Jun 18, 2020, 4:35:15 AM6/18/20
to breedR
Dear Facundo,

It is very likely the case. Especially for the genotypes with fewer observations, whose estimates would borrow more information from the population. How many observations do you have per genotype?

With that many genotypes, using fixed effects imply a single independent parameter for each of them. That's a lot of parameters, which require a lot of observations per genotype.

The project I am working on is a "Check plot design", meaning I have a few genotypes which are replicated and the others are not. In this case I feel like the genotype has to be treated as a random factor.

Yes, breedR (its underlying engine, really) is a bit arbitrary with regard to the contrasts. It will take one genotype as a baseline (which will be represented by the intercept) and estimate the rest as deviations from that baseline.

If you rather want a global mean and deviations from that mean, you can always calculate these coefficients afterwards from the estimates you get.

The strange thing is that I am explicitly forcing an intercept, but it is removed by the engine. Is there anything I can do about it?. See the following code:

> res$call
remlf90(fixed = as.formula(paste(trait, " ~ 1 + GEN")), random = NULL,
    spatial = list(model = "AR", coord = dat[, c("ROW", "COL")],
        rho = c(0.8, 0.8), var.ini = vi[2]), data = dat, var.ini = list(resid = vi[3]),
    method = "em")
> summary(res)
Formula: FZ ~ 0 + GEN + spatial
   Data: dat
  AIC     BIC logLik
 2501 unknown  -1249

 Thanks for the help
Best Regards Hermann
To unsubscribe from this group and stop receiving emails from it, send an email to bre...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to bre...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to bre...@googlegroups.com.

Facundo Muñoz

unread,
Jun 18, 2020, 9:00:06 AM6/18/20
to bre...@googlegroups.com

Dear Hermann,

Sorry, there is no way around that. As I said, the library behind breedR don't handle contrasts well (or maybe I haven't found the right way).

ƒacu.-

To unsubscribe from this group and stop receiving emails from it, send an email to breedr+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/breedr/a1da43e2-a6ce-44d1-ad03-6f6f2c23978do%40googlegroups.com.

H G D

unread,
Jun 18, 2020, 9:50:14 AM6/18/20
to breedR
Dear Facundo,

thank you for maintaining this great package anyways, I very much appreciate your help.
Best Regards, Hermann
Reply all
Reply to author
Forward
0 new messages