Understand the `emmGrid` object structure via `ref_grid`
mainThe ref_grid() function is the foundation of the emmeans package. It extracts information from a model to create an emmGrid object. An emmGrid contains the following key slots:
bhat($b$): The fixed-effects coefficients.V($V$): The variance-covariance matrix of $b$.linfct($L$): The linear functions of $b$ (the linear predictor for the points in the reference grid is $Lb$).grid: A data frame containing factor/covariate combinations for each row of $L$. It may include.wgt.(weights) and.offset.columns.levels: A named list of factor levels.dffunanddfargs: A function and arguments used to compute degrees of freedom for a linear prediction $x'b$.nbasis($N$): A matrix used to assess the estimability of $x'b$. If $N'x \neq 0$, the prediction is not uniquely estimable.post.beta: For Bayesian models, a posterior sample of $b$ instances.model.info,roles,matlevs, andmisc: Metadata and extra information used by package functions.