Skip to content
Prev 19445 / 20628 Next

Question about flexible LME4 Variance-Covariance Structure

Jared,

I?ll preface this by saying I?m the biometrician for GDM Solutions, and we provide software for managing agronomic trials. Our software is used by a wide range of scientists, many who collaborate with companies like BCS (and, IIRC, BCS holds a large number of licenses for our software). I think I?m familiar with the type of problem you?re trying to solve. We provide an interface for diagnostic screening of individual trials, including RCB designs, and we use R as the computational engine; we also write R scripts programmatically for independent analysis.

That said, I wouldn?t use lmer for this. I think lme might give you what you?re looking for. Try


lme(NUM_VALUE ~ TREATMENT, random =  ~ 1 | BlockingName, data = zdf, weights=varIdent(form= ~ 1| BlockingName)


I would avoid specifying TREATMENT as a random effect to ?trick? lmer into calculating variances. You might get numbers, but they don?t correspond to the correct model, so you really can?t be certain the variances are correct. The code I?ve given above should allow you to keep TREATMENT as fixed but will give ratios of residual variance within replicates. From an example trial, I get,


Linear mixed-effects model fit by REML
  Data: ARMdata 
  Log-restricted-likelihood: 5.914592
  Fixed: assessment18 ~ treatment 
(Intercept)  treatment2  treatment3  treatment4  treatment5  treatment6  treatment7  treatment8  treatment9 treatment10 
  0.9841966  -0.8691926  -0.8234544  -0.9225589  -0.9772064  -0.8645547  -0.9772064  -0.9772064  -0.9772064  -0.7643471 
treatment11 treatment12 
 -0.9657557  -0.9772064 

Random effects:
 Formula: ~1 | replicate
        (Intercept) Residual
StdDev:  0.02308651 0.134405

Variance function:
 Structure: Different standard deviations per stratum
 Formula: ~1 | replicate 
 Parameter estimates:
        1         2         3         4         5         6 
1.0000000 1.5128266 2.3479912 0.6976083 2.3369190 0.8236288 
Number of Observations: 72
Number of Groups: 6 


I?m making some assumptions about what you intend to do with the variances, but those would be beyond the scope of this group, I think. You can direct questions relating to those assumptions to me at Pete at gdmdata.com <mailto:Pete at gdmdata.com>

Cheers,