Bug 16744 - nlme getvarcov makes assumptions about data structure, can give wrong answer
Summary: nlme getvarcov makes assumptions about data structure, can give wrong answer
Status: UNCONFIRMED
Alias: None
Product: R
Classification: Unclassified
Component: Accuracy (show other bugs)
Version: R 3.2.3
Hardware: Other Other
: P5 enhancement
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2016-03-02 20:34 UTC by jameson.quinn
Modified: 2016-03-02 20:39 UTC (History)
0 users

See Also:


Attachments
a "fixed" version. (3.34 KB, text/plain)
2016-03-02 20:38 UTC, jameson.quinn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jameson.quinn 2016-03-02 20:34:09 UTC

    
Comment 1 jameson.quinn 2016-03-02 20:38:08 UTC
Created attachment 2035 [details]
a "fixed" version.

This probably doesn't fix the bug in all cases but at least is strictly better than the current code.
Comment 2 jameson.quinn 2016-03-02 20:39:15 UTC
There is a bug in `getVarCov` which rears its head when you use the `weights` argument to either lme or gls. It has to do with the order of the rows of the data set, something which obviously should not matter; and it means that you get simply wrong numbers for marginal variances, though correlations should still be correct. I've written a fix for this function that works in at least some additional cases (attached).