Re: [R] glm.nb and Error in x[good, , drop = FALSE] * w : non-conformable arrays

2023-04-21 Thread Patrick Giraudoux
Many thanks Ivan ! This is fairly clear to me, now... When I dumped the data.frame, I found strange to have a "table" declaration for deg, but was not able to judge if it was a problem or not (I would have expected something as "numeric") Your workaround is fine to me (I do not need to carry on

Re: [R] glm.nb and Error in x[good, , drop = FALSE] * w : non-conformable arrays

2023-04-21 Thread Ivan Krylov
On Fri, 21 Apr 2023 09:02:37 +0200 Patrick Giraudoux wrote: > I meet an error with glm.nb that I cannot explain the origin (and > find a fix). The model I want to fit is the following: > > library(MASS) > > glm.nb(deg~offset(log(durobs))+zone,data=db) > > and the data.frame is dumped below. T

[R] glm.nb and Error in x[good, , drop = FALSE] * w : non-conformable arrays

2023-04-21 Thread Patrick Giraudoux
Dear Listers, I meet an error with glm.nb that I cannot explain the origin (and find a fix). The model I want to fit is the following: library(MASS) glm.nb(deg~offset(log(durobs))+zone,data=db) and the data.frame is dumped below. Has anyone an idea about what the trouble comes from ? (except

Re: [R] glm.nb error

2013-06-07 Thread Daofeng Li
Thanks for all your help. I will try to fix this. Very helpful. Best, Daofeng On Fri, Jun 7, 2013 at 11:25 AM, Sarah Goslee wrote: > As Marc already pointed out, take a close look at this part of your loop: > > R> i <- 6 > R> > R> y <- as.numeric(data[i,-1]) > R> y > [1] 3 3 3 3 4 4 4 4 > R> g

Re: [R] glm.nb error

2013-06-07 Thread Daofeng Li
Thanks Marc...still didn't get it... Tried this... > str(group) num [1:8] 1 1 1 1 0 0 0 0 > fit=glm.nb(y~group) Error in while ((it <- it + 1) < limit && abs(del) > eps) { : missing value where TRUE/FALSE needed > group <- c('1','1','1','1','0','0','0','0') > str(group) chr [1:8] "1" "1" "1" "

Re: [R] glm.nb error

2013-06-07 Thread Daofeng Li
Thank you Sarah and Marc for your fast and nice response. Apology for didn't include all information. I have a input file like following: gene1 18 15 13 13 16 9 20 24 gene2 15 8 8 7 0 12 18 4 gene3 10 9 8 12 9 11 12 12 gene4 4 0 4 3 0 5 0 0 gene5 0 1 0 0 1 5 1 0 gene6 3 3 3 3 4 4 4 4 gene7 0 4 0

Re: [R] glm.nb error

2013-06-07 Thread Daofeng Li
Sorry Sarah. > dput(dat) structure(list(gene = structure(c(1L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 2L), .Label = c("gene1", "gene10", "gene2", "gene3", "gene4", "gene5", "gene6", "gene7", "gene8", "gene9"), class = "factor"), b1 = c(18L, 15L, 10L, 4L, 0L, 3L, 0L, 4L, 11L, 6L), b2 = c(15L, 8L,

Re: [R] glm.nb error

2013-06-07 Thread Sarah Goslee
As Marc already pointed out, take a close look at this part of your loop: R> i <- 6 R> R> y <- as.numeric(data[i,-1]) R> y [1] 3 3 3 3 4 4 4 4 R> group [1] 1 1 1 1 0 0 0 0 R> fit <- glm.nb(y~group) Error in while ((it <- it + 1) < limit && abs(del) > eps) { : missing value where TRUE/FALSE neede

Re: [R] glm.nb error

2013-06-07 Thread Sarah Goslee
Hi, On Fri, Jun 7, 2013 at 11:36 AM, Daofeng Li wrote: > Thank you Sarah and Marc for your fast and nice response. > Apology for didn't include all information. > > I have a input file like following: > > gene1 18 15 13 13 16 9 20 24 > gene2 15 8 8 7 0 12 18 4 > gene3 10 9 8 12 9 11 12 12 > gene4

Re: [R] glm.nb error

2013-06-07 Thread Marc Schwartz
On Jun 7, 2013, at 10:36 AM, Daofeng Li wrote: > Thank you Sarah and Marc for your fast and nice response. > Apology for didn't include all information. > > I have a input file like following: > > gene1 18 15 13 13 16 9 20 24 > gene2 15 8 8

Re: [R] glm.nb error

2013-06-07 Thread Marc Schwartz
On Jun 7, 2013, at 9:44 AM, Daofeng Li wrote: > Dear R Community, > > I have encountered a problem while using the R function glm.nb. > The code that produce the error was following two lines: > > group=c(1,1,1,1,0,0,0,0) > fit=glm.nb(y~group) > > While the y contains 8 sets of number like: >

Re: [R] glm.nb error

2013-06-07 Thread Sarah Goslee
Hi, On Fri, Jun 7, 2013 at 10:44 AM, Daofeng Li wrote: > Dear R Community, > > I have encountered a problem while using the R function glm.nb. > The code that produce the error was following two lines: > > group=c(1,1,1,1,0,0,0,0) > fit=glm.nb(y~group) > > While the y contains 8 sets of number li

[R] glm.nb error

2013-06-07 Thread Daofeng Li
Dear R Community, I have encountered a problem while using the R function glm.nb. The code that produce the error was following two lines: group=c(1,1,1,1,0,0,0,0) fit=glm.nb(y~group) While the y contains 8 sets of number like: gene2750 1 0 0 1 5 1

Re: [R] glm.nb - theta, dispersion, and errors

2012-10-21 Thread Achim Zeileis
On Sun, 21 Oct 2012, Eiko Fried wrote: I am running 9 negative binomial regressions with count data. The nine models use 9 different dependent variables - items of a clinical screening instrument - and use the same set of 5 predictors. Goal is to find out whether these predictors have different

[R] glm.nb - theta, dispersion, and errors

2012-10-21 Thread Eiko Fried
I am running 9 negative binomial regressions with count data. The nine models use 9 different dependent variables - items of a clinical screening instrument - and use the same set of 5 predictors. Goal is to find out whether these predictors have differential effects on the items. Due to various

Re: [R] glm.nb versus glm estimation of theta.

2009-08-19 Thread hesicaia
-project.org] On > Behalf Of hesicaia [dbo...@dal.ca] > Sent: 14 August 2009 04:31 > To: r-help@r-project.org > Subject: [R] glm.nb versus glm estimation of theta. > > Hello, > > I have a question regarding estimation of the dispersion parameter (theta) > for generalized linear

Re: [R] glm.nb versus glm estimation of theta.

2009-08-13 Thread Bill.Venables
ld be close to (though not necessarily equal to) unity. From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of hesicaia [dbo...@dal.ca] Sent: 14 August 2009 04:31 To: r-help@r-project.org Subject: [R] glm.nb versus glm estimation of

Re: [R] glm.nb versus glm estimation of theta.

2009-08-13 Thread Achim Zeileis
correspond to a specific likelihood). Thus, dispersion and theta are really different things although both of them can be used to capture overdispersion. I understand, there are two main methods to fit glm's using the nb error structure in R: glm.nb() or glm() with the negative.binomial(theta) f

[R] glm.nb versus glm estimation of theta.

2009-08-13 Thread hesicaia
Hello, I have a question regarding estimation of the dispersion parameter (theta) for generalized linear models with the negative binomial error structure. As I understand, there are two main methods to fit glm's using the nb error structure in R: glm.nb() or glm() with the negative.bin

Re: [R] glm.nb() giving strongly different results

2009-03-25 Thread Bill.Venables
ou cannot easily predict from the resulting fitted model object. Bill Venables http://www.cmis.csiro.au/bill.venables/ -Original Message- From: David Croll [mailto:david.cr...@gmx.ch] Sent: Wednesday, 25 March 2009 7:28 PM To: Venables, Bill (CMIS, Cleveland); r-help@r-project.org Subject

Re: [R] glm.nb() giving strongly different results

2009-03-25 Thread David Croll
y, 25 March 2009 12:36 PM To: r-help@r-project.org Subject: [R] glm.nb() giving strongly different results Dear colleagues, I have performed several dozens of glm.nb(response ~ variable) analyses weeks ago, and when I looked through the results today I saw that many of the results have quite dif

Re: [R] glm.nb() giving strongly different results

2009-03-24 Thread Bill.Venables
cmis.csiro.au/bill.venables/ -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David Croll Sent: Wednesday, 25 March 2009 12:36 PM To: r-help@r-project.org Subject: [R] glm.nb() giving strongly different results Dear colleagues, I have

[R] glm.nb() giving strongly different results

2009-03-24 Thread David Croll
Dear colleagues, I have performed several dozens of glm.nb(response ~ variable) analyses weeks ago, and when I looked through the results today I saw that many of the results have quite different intercept values despite the response part remained the same. I'm quite sure I did same kind

[R] glm.nb

2008-01-11 Thread Wensui Liu
dear listers, i tried to use glm.nb to estimate a nega. binomial but have no luck to get the result. here is the code: model <- glm.nb(Y ~ ., data = mydata) I am not sure if I have missed anything. thanks for your insight! wensui __ R-help@r-project.or