[R-sig-ME] nlme: The meaning of residual variance when using a variance structure

Phillip Alday ph||||p@@|d@y @end|ng |rom mp|@n|
Fri Nov 6 13:24:22 CET 2020


Looking at varFix alone, it looks like the variance is proportional to
the mean.

Looking at the documentation for varFixed (e.g.
https://www.rdocumentation.org/packages/nlme/versions/3.1-150/topics/varFixed),
varFixed sets the variance as being the mean. Looking at the
documentation for lme
(https://www.rdocumentation.org/packages/nlme/versions/3.1-150/topics/lme),
the weights describe the "within-group heteroskedacity structure", which
here basically means the observation-level variation after the grouping
has been taken into account.

So then sigma(model)^2 is the constant of proportionality for going from
a particular observation to the (residual) variance at that observation.
Note that only 'part' of an observation is relevant in this example: x
matters but not month.

Also, I'm guessing that you got this example from somewhere (because it
uses things beyond your own understanding), so it would be usual
practice to give credit to the individual(s) who came up with it.

Phillip

On 6/11/20 3:44 am, Simon Harmel wrote:
> Hello All,
> 
> My understanding is that a varFixed() variance structure in lme() call,
> models the residual variance proportional to a numeric variance covariate
> (e.g., `x`) such that there would be a linear relation between the two.
> 
> But what is the exact meaning of sigma(fitted_model)^2 alone in a fitted
> model that has used  varFixed(~x)  in it?
> 
> Below is a fully reproducible example.
> 
> library(nlme)
> 
> dat <- read.csv('
> https://raw.githubusercontent.com/rnorouzian/e/master/var.csv')
> dat$month <- factor(dat$month)
> 
> m2 <- lme(y ~ x * month, random = ~1|id, weights = varFixed(~x), data = dat)
> 
> varFix <- function(x) sigma(m2)^2*x  ## What is the meaning of  "sigma(m2)^2"
> here?
> 
> with(dat, curve(varFix(x), min(x), max(x), lwd = 2))
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>



More information about the R-sig-mixed-models mailing list