From jayoung at fhcrc.org  Sat Nov  8 01:00:08 2008
From: jayoung at fhcrc.org (jayoung at fhcrc.org)
Date: Sat,  8 Nov 2008 01:00:08 +0100 (CET)
Subject: [Rd] geeglm crashes if there are no datapoints in predictor's first
	level (PR#13266)
Message-ID: <20081108000008.F26ED282C765@mail.pubhealth.ku.dk>

Hi,

I managed to make R core dump (linux and Mac OSX versions), but I  
think I've figured out why.

First, here's the message I get on core dump (on linux - no message on  
Mac):
R: ../inst/include/tnt/fmat.h:529: TNT::Vector<T> TNT::matmult(const  
TNT::Fortran_Matrix<T>&, const TNT::Vector<T>&) [with T = double]:  
Assertion `A.num_cols() == x.dim()' failed.
Abort (core dumped)

Second, here's the command:
mygeeglm<-  geeglm(outcome ~ input , data=mydata, id=mydata$group)

Third, my explanation (the dataset is pasted at the very bottom) -  
initially, mydata$input was an ordered factor, with levels "Med",  
"Low", "High" BUT the data did not contain any datapoints with value  
"Med" (yes, I know I shouldn't have used that as input!).  I'm pretty  
sure the absence of datapoints in that first category is what's  
causing the crash, because when I change the levels of the factor to  
reflect the datapoints remaining (levels "Low", "High") the geeglm  
command ran just fine.

So it'd be great if geeglm (or whatever function it's calling) could  
check for stupid mistakes in the input data like the one I was making,  
and report an error, rather than causing R to crash.

Thanks,

Janet Young

-------------------------------------------------------------------

Dr. Janet Young

Fred Hutchinson Cancer Research Center
1100 Fairview Avenue N., C3-168,
P.O. Box 19024, Seattle, WA 98109-1024, USA.

tel: (206) 667 1471 fax: (206) 667 6524
email: jayoung at fhcrc.org

http://www.fhcrc.org/labs/trask/

-------------------------------------------------------------------

 > mydata
        group     outcome input
1    bA175B9  0.99370982  High
2   bA322N21  0.58099071  High
3   bA322N21 -0.05601471  High
4   bA322N21 -0.01608595  High
5   bA322N21 -0.65053824  High
6   bA322N21 -0.05417095  High
7   bA382M16  0.01030286  High
8   bA396D18  0.25673448  High
9    bA415J8 -1.04672184  High
10  bA421E17 -1.30500465  High
11   bA454L1 -0.65803623  High
12    bA47A4  3.38755577  High
13  bA552M11 -0.06518991  High
14  bA552M11  0.11066039  High
15  bA552M11  0.14413606  High
16  bA552M11  0.07093663  High
17  bA552M11  0.27674192  High
18  bA552M11  0.26482473  High
19   bA90O23  0.18827961  High
20  dJ1071N3 -0.22666352  High
21 dJ1126H10 -0.34280590  High
22   dJ21O18 -0.94399366   Low
23  dJ329E20 -0.22666352  High
24   dJ533D7  0.58099071  High
25   dJ533D7 -0.05601471  High
26   dJ533D7 -0.01608595  High
27   dJ533D7 -0.65053824  High
28  dJ580L15 -0.40615304  High
29  dJ580L15  0.54838865  High
30  dJ580L15  0.20731824  High
31  dJ655N15 -0.63766633   Low
32   dJ65J11 -1.44140328   Low
33  dJ836N10 -0.06518991  High
34  dJ836N10  0.07093663  High
35  dJ836N10  0.27674192  High



[Rd] geeglm crashes if there are no datapoints in predictor's first level (PR#13266)
jayoung at fhcrc.org