0

I want to obtain the estimate of the variance-covariance matrix of the response vector of a final linear mixed model, for a male adult (where Gender (G.F = 1). I am using the getVarCov () function. but how do i specify this in the "individual" part of the function please.

My code so far is this. G.f is the factored Gender,A is the age of adult less the mean age, W is the weight of adult less the mean weight and Adult.f is the factor variable that identify the adult in the study. The model is represented below.

Model1<-lme(C ~ A + W + G.f + A:W + A:G.f + W:G.f + A:W:G.f, random = ~  1 | Adult.f, weights = 
              varIdent(form = ~ 1 | G.f), method = "REML", data=Veneer)

I'm not sure if this is the correct way to do this. G.f can either be 0 or 1 only

VarY_hat <- getVarCov(Model1, individual = c(G.f = 1), type = "marginal")[[1]]
VarY_hat
Quinten
  • 35,235
  • 5
  • 20
  • 53
Juliet
  • 1
  • 1
  • Neither `lme` nor `getVarCov` are in the base packages, state your `library`es please. – jay.sf May 07 '22 at 18:04
  • The packages are listed below. Sorry about that. library("plyr") library("tidyverse") library("nlme") library("car") library("hexbin") library("xtable") library("knitr") library("Rcpp") library("vctrs") library("dplyr") library("knitr") library("multcomp") library("lmerTest") – Juliet May 07 '22 at 18:21
  • We don't really need these 13 packages for two functions, do we? Also since we don't have `Veneer` we are not able to reproduce your problem. Please read our tutorial on [minimal working examples](https://stackoverflow.com/a/5963610/6574038) and fix your question, thanks. – jay.sf May 07 '22 at 18:42

0 Answers0