Skip to content

glm error message when using family Gamma(link="inverse")

4 messages · John Sorkin, Brian Ripley, Charles C. Berry

#
R 2.5
windows XP

I am getting an error from glm() that I don't understand. Any help or suggestions would be appreciated. N.B. 1<=AAMTCAREJ<=327900
Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
     1.0    404.3   1430.0   6567.0   5457.0 327900.0
+ incomegrp+racecat+MARSTATJS+EdCat+bmiNewjohn,data=data,family=Gamma(link = "inverse"))
Error: no valid set of coefficients has been found: please supply starting values
In addition: Warning message:
NaNs produced in: log(x) 

Thanks
John

John David Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax) 410-605-7913 (Please call phone number above prior to faxing)

Confidentiality Statement:
This email message, including any attachments, is for th...{{dropped:6}}
#
On Tue, 9 Dec 2008, John Sorkin wrote:

            
Please

1) do as the posting guide asks, and quote version numbers accurately.
2) do as the posting guide asks, and update *before* posting.

That's too old a version to support here.
That model is not necessarily valid: the linear predictor has to be 
strictly positive.  If you really know why it is applicable you will be 
able to give starting values (e.g. maybe all the columns of the design 
matrix are positive, in which case you will be able to find suitable 
positive initial coefficients).
#
It appears that I have sinned and for this I surely will wear sack cloth and grovel until my period of penitence is fulfilled.

I update R and my problem remains. Please see code snippet (as per posting guidelines) below

R 2.8.0
windows XP
Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
     1.0    404.3   1430.0   6567.0   5457.0 327900.0
+ incomegrp+racecat+MARSTATJS+EdCat+bmiNewjohn,data=data,family=Gamma(link = "inverse"))
Error: no valid set of coefficients has been found: please supply starting values
In addition: Warning message:
In log(ifelse(y == 0, 1, y/mu)) : NaNs produced










John David Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax) 410-605-7913 (Please call phone number above prior to faxing)
On Tue, 9 Dec 2008, John Sorkin wrote:

            
Please

1) do as the posting guide asks, and quote version numbers accurately.
2) do as the posting guide asks, and update *before* posting.

That's too old a version to support here.
That model is not necessarily valid: the linear predictor has to be 
strictly positive.  If you really know why it is applicable you will be 
able to give starting values (e.g. maybe all the columns of the design 
matrix are positive, in which case you will be able to find suitable 
positive initial coefficients).
#
On Tue, 9 Dec 2008, John Sorkin wrote:

            
Well, this still isn't something others can _reproduce_ , but...

The error message seems to be from glm.fit().

I'd guess you are throwing glm() a knuckleball and it is choking on its 
attempt to calculate the deviance - note the warning message.

You might be able to calm glm()'s frayed nerves by supplying some decent 
start values as it is asking. Possibly starting with a subset of 
variables, using the coef()s for the subset and setting the others to zero 
when you attempt to fit all together will be enough to push it past its 
sticking point.

HTH,

Chuck
Charles C. Berry                            (858) 534-2098
                                             Dept of Family/Preventive Medicine
E mailto:cberry at tajo.ucsd.edu	            UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901