From mcneney@cs.sfu.ca  Sat Feb 19 01:51:58 2000
From: mcneney@cs.sfu.ca (mcneney@cs.sfu.ca)
Date: Sat, 19 Feb 2000 02:51:58 +0100 (MET)
Subject: [Rd] problem with glm (PR#452)
Message-ID: <200002190151.CAA15336@pubhealth.ku.dk>

I'm having sporadic problems with glm on my alpha workstation running
Compaq Tru64 UNIX V5.0 (I can't replicate the problem on my Linux PC). I
have the same problem whether I use a version of R built with the native
C-compiler or a version compiled with gcc. In both cases I've built with
g77.

I want to do some simulations with a call to glm in each rep. A simplified
version would be something like:

N_100; NREPS_100; lam.e_5; logit.inv_function(x){ exp(x)/(1+exp(x)) }
for(i in (1:NREPS)) {
   cat(paste("REP",i,"\n"))
   T_rexp(N,(lam.e))
   Delta_rbinom(N,1,logit.inv(1+T))
   ff_glm(Delta ~ T,family=binomial(logit))
}
 
It often completes all reps, but I occasionally get errors related to
lengths of various objects, etc.:

REP 1 
REP 2
<snip>
REP 9 
Error in model.matrix(t, data) : variable lengths differ


REP 1 
<snip>
REP 53 
Error: subscript out of bounds

REP 1 
<snip>
REP 41 
Error in model.matrix(t, data) : invalid variable type

Different error messages, different numbers of reps. When I call glm again
using the values of T and Delta just before the error, it runs error-free.
When I put the data in a data frame before calling glm I can also get
messages like:

REP 1 
<snip>
REP 64 
Error in model.frame(formula, rownames, variables, varnames, extras, extranames,  : 
        invalid variable type


--please do not edit the information below--

Version:
 platform = alpha-dec-osf5.0
 arch = alpha
 os = osf5.0
 system = alpha, osf5.0
 status = Patched
 major = 0
 minor = 99.0
 year = 2000
 month = February
 day = 9
 language = R

Search Path:
 .GlobalEnv, Autoloads, package:base

-------------------------------------------------------------------------
Brad McNeney                               email: mcneney@stat.sfu.ca
Department of Mathematics and Statistics   web: www.math.sfu.ca/~mcneney/
Simon Fraser University                    phone: 604.291.4815
8888 University Drive                      fax: 604.291.4947
Burnaby, British Columbia
Canada V5A 1S6


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] problem with glm (PR#452)
mcneney@cs.sfu.ca