Dear GenStatters,
I’m running the following code inside a loop:
symmetricmatrix [rows = n] invsim
calc invsim = inverse(simm_i)
vcomponents random = group_i
vstructure [term = group_i] model = fixed; inverse = invsim
reml [print = *] response_i
vpredict [print = *; predictions = shrunkmean_i; se = shrunkmean_se_i] classify = group_i
On most iterations it runs fine, but for some data sets the function inverse() fails with the error ‘Matrix singular.’
It seems to me that the similarity matrix could be singular just because two of the groups in the data are essentially the same group, and that one wouldn’t want to abandon the analysis on that account. (Though admittedly in the cases I’ve looked at, that doesn’t seem to be what’s causing the singularity.)
I can get the code to run simply by using ginverse() instead of inverse(), but I’m wondering whether this is a legitimate work-round.
Can anyone advise?
Best wishes,
Nick Galwey
☺Dr. N.W. Galwey, Epidemiology Consultant,
Statistical Consulting Group, Quantitative Sciences
SGlaxoSmithKline, Building 1, Floor S, Room 101,
Medicines Research Centre, Gunnels Wood Road,
Stevenage, Hertfordshire. SG1 2NY
SInternal: 8792 4523
IExternal: +44 (0) 208 990 4523
EMobile: 07919 297983
MFax: +44 (0) 208 990 4654
[log in to unmask]
________________________________
This e-mail was sent by GlaxoSmithKline Services Unlimited
(registered in England and Wales No. 1047315), which is a
member of the GlaxoSmithKline group of companies. The
registered address of GlaxoSmithKline Services Unlimited
is 980 Great West Road, Brentford, Middlesex TW8 9GS.
|