There are two ways to do this.
#
Approach 1
The current version of lme4 allows lme4 to force a VarCorr object to a data frame:
as.data.frame(VarCorr(gm))
You can then select rows 1: 2 and column 5 to extract the standard deviations of the random intercept and tilt.
Approach 2
If you want to extract values ββin the old fashioned way, you can use attributes :
attributes(VarCorr(gm)$herd)$stddev (Intercept) size 1.18970662 0.08826278
If you want to get rid of names (i.e. (intercept) , size ), you can use as.numeric or unname .
source share