[R] glmD error

Bond, Stephen Stephen.Bond at cibc.com
Mon Jan 9 16:17:59 CET 2012


I am attemting to use glmD in order to use latex(obj) afterwards.

Glm works fine, glmD throws an error:
> conv.go <- glmD(cbind(go.cnt,tot.cnt-go.cnt)~sn+rcs(relAge,4)+termfac+rate:termfac+
+                           I(relAge*term>(term-1.25))+I((prevbal/tot.cnt)*1e-4)+prod+newmort+
+                           I(dnorm(relAge*term-round(relAge*term/12)*12,sd=1.2)*as.integer((relAge*term)>3))+
+                           I(term %in% c(36,60,72,120))
+                           ,data=conv,
+                           family="quasibinomial")
Error in if (!length(fname) || !any(fname == zname)) { : 
  missing value where TRUE/FALSE needed

> conv.go <- glm(cbind(go.cnt,tot.cnt-go.cnt)~sn+rcs(relAge,4)+termfac+rate:termfac+
+                           I(relAge*term>(term-1.25))+I((prevbal/tot.cnt)*1e-4)+prod+newmort+
+                           I(dnorm(relAge*term-round(relAge*term/12)*12,sd=1.2)*as.integer((relAge*term)>3))+
+                           I(term %in% c(36,60,72,120))
+                           ,data=conv,
+                           family="quasibinomial")
> latex(conv.go)
Error in format == "" : 
  comparison (1) is possible only for atomic and list types

> str(conv)
'data.frame':	25537 obs. of  18 variables:
 $ prod   : Factor w/ 4 levels "CD","CL","CO",..: 2 2 2 1 2 2 2 4 2 2 ...
 $ strt   :Class 'Date'  num [1:25537] 10623 11354 11382 12084 12084 ...
 $ matym  :Class 'Date'  num [1:25537] 13180 13180 13180 13180 13180 ...
 $ ins    : Factor w/ 2 levels "0","1": 1 1 1 1 1 1 1 1 1 1 ...
 $ ym     :Class 'Date'  num [1:25537] 13149 13149 13149 13149 13149 ...
 $ tot.cnt: int  24 117 25 17 25 26 102 95 52 52 ...
 $ prevbal: num  1435380 8991665 1652058 1056949 2240357 ...
 $ RAM    : num  139 160 150 107 160 ...
 $ age    : num  83.4 59.4 58.9 35.3 35.3 ...
 $ rate   : num  6.46 7.4 7.6 6 5.44 ...
 $ go     : num  0 0 0 0 0 0 0 0 0 0 ...
 $ go.cnt : num  0 0 0 0 0 0 0 0 0 0 ...
 $ SMM.go : num  0 0 0 0 0 0 0 0 0 0 ...
 $ term   : num  84 60 59 36 36 24 12 6 84 84 ...
 $ relAge : num  0.993 0.99 0.999 0.981 0.981 ...
 $ sn     : Factor w/ 12 levels "Jan","Feb","Mar",..: 1 1 1 1 1 1 1 1 1 2 ...
 $ termfac: Factor w/ 7 levels "1","2","3","4",..: 6 5 5 3 3 2 1 1 6 6 ...
 $ newmort: int  0 0 0 0 0 0 0 0 0 0 ...

Thanks everybody.

Stephen B



More information about the R-help mailing list