I am creating a linear mixed model for which I did estimate/define my variance components in advance. Now I would like to add them to the function but I dont know how to do this. The currently used "lmer"-function from the "lme4"-package does estimate the variance components by itself and I dont know how to pre-define them.
Thanks in advance!
For Example this data:
library(lme4)
f <- rnorm(10, mean=1.4025, sd=0.101)
m <- rnorm(10, mean=1.9025, sd=0.15)
gain <- c(f,m,f,m)
s <- c("f","f","f","f","f","m","m","m","m","m")
sex <- c(s,s,s,s)
i <- c(1:10)
anim <- as.factor(c(i,i,i,i))
invented <- data.frame(gain,sex,anim)
# model
lmm <- lmer(gain ~ sex + (1|anim), data = d)
summary(lmm)
# How can I add variance components to the model?
# Fixed-effect-variance = 0.0135
# Random-effect-variance = 0.0045