Generic function for extracting the random effects. This is the same generic (and same name) defined in the nlme and lme4 package.
ranef(object, ...) random.effects(object, ...) # S3 method for default random.effects(object, ...) # S3 method for default ranef(object, ...) # S3 method for ggmix_gic ranef(object, s = "lambda.min", ...)
object  any fitted model object from which random effects estimates can
be extracted. Currently supports "ggmix_gic" objects outputted by the


...  other parameters. currently ignored 
s  Value(s) of the penalty parameter 
a numeric vector of length equal to the number of observations of subjectspecific random effects
For objects of class "ggmix_gic", this function returns the subjectspecific random effect value for the model which minimizes the GIC using the maximum a posteriori principle
data("admixed") fit < ggmix(x = admixed$xtrain, y = admixed$ytrain, kinship = admixed$kin_train) gicfit < gic(fit) # random effect at selected value of lambda plot(ggmix::ranef(gicfit))#> 1 2 #> [1,] 2.50068689 3.3319049 #> [2,] 1.18958290 1.6479184 #> [3,] 0.56591630 0.7010323 #> [4,] 0.93637814 1.3405188 #> [5,] 0.35160641 0.7833144 #> [6,] 0.05101435 0.2833299