1

I am using the gnm function in R. I am trying to fit a model with an integral portion which I have discretized by using six matrices whose columns are a binary indicator for that covariate at each time interval. Each of these columns is labelled with a1, a2, etc. for matrix 1, b1, b2, etc. for matrix 2, and so on. I have about 250 columns for each of these matrices.

I am passing these matrices to the gnm command as a string:

 mod<-gnm(as.formula(expr),family=binomial)

where expr is a character string that contains the list of all of the matrix column variable names (i.e., a1, a2, ..., b1, b2, ....).

My code produces sensible results when I use 5 matrices but when I try to use 6 matrices I get the following error when I try to run the gnm command.

 variable names are limited to 10000 bytes

Is there a way to bypass this?

Heather Turner
  • 3,264
  • 23
  • 30
KVS
  • 11
  • 1
  • 2
  • `gnm` doesn't appear to be in base R, what library are you using? What exactly does `expr` look like? Is it formula-like (ie "y ~ a1 + a2 + ...")? Where is your data coming from? Problems are very hard to help with if you cannot provide a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – MrFlick Jul 22 '14 at 03:29
  • `gnm(...)` is in package `gnm` - generalized nonlinear models. – jlhoward Jul 22 '14 at 03:46
  • I'm using `library(gnm)`. I'm not quite sure how to provide something that is reproducible but `expr` is of the form: `expr<-paste0("cbind(y,1-y)~func1(",zlist")")` where `func1` is a custom `nonlin` function (http://cran.r-project.org/web/packages/gnm/vignettes/gnmOverview.pdf) and `zlist` is the string of the matrix column variable names (`"a1, a2,..."`) – KVS Jul 22 '14 at 03:48
  • `expr` will not be a formula, although I think you edited the question so now I could be wrong, but itis rather unclear at the moment). Why not post an example with three small matrices? Then we can assess the risk of a "combinatorial explosion". – IRTFM Jul 22 '14 at 04:17
  • 1
    your variable names are too long `tmp <- paste(rep(letters[1:10], 1001), collapse = ''); assign(tmp, 1618)`. just post the code you are working with and any data to make it run, it's fairly straight-forward to provide a working example – rawr Jul 22 '14 at 04:24

0 Answers0