[Depmix-commits] r217 - trunk/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Aug 1 16:23:17 CEST 2008
Author: ingmarvisser
Date: 2008-08-01 16:23:17 +0200 (Fri, 01 Aug 2008)
New Revision: 217
Modified:
trunk/R/responseGLM.R
Log:
Changed show method to deal with multinomial(identity) objects.
Modified: trunk/R/responseGLM.R
===================================================================
--- trunk/R/responseGLM.R 2008-08-01 11:56:47 UTC (rev 216)
+++ trunk/R/responseGLM.R 2008-08-01 14:23:17 UTC (rev 217)
@@ -108,10 +108,11 @@
if(object at family$family=="multinomial") {
# also print probabilities at covariate values of zero
cat("Probalities at zero values of the covariates.\n")
- if(!(is.null(dim(object at parameters$coefficients)))) {
+ if(!(is.null(dim(object at parameters$coefficients)))&dim(object at parameters$coefficients)[1]>1) {
cat(object at family$linkinv(object at parameters$coefficients[1,],base=object at family$base),"\n")
} else {
- cat(object at family$linkinv(object at parameters$coefficients,base=object at family$base),"\n")
+ if(object at family$link=="identity") cat(object at family$linkinv(object at parameters$coefficients),"\n")
+ else cat(object at family$linkinv(object at parameters$coefficients,base=object at family$base),"\n")
}
}
if(object at family$family=="binomial") {
@@ -134,11 +135,8 @@
switch(which,
"pars"= {
if(object at family$family=="multinomial") {
-
object at parameters$coefficients <- matrix(values,ncol(object at x),byrow=TRUE)
-
if(prob) object at parameters$coefficients[1,] <- object at family$linkfun(values[1:ncol(object at parameters$coefficients)],base=object at family$base)
-
# object at parameters$coefficients[1,] <- values[1:ncol(object at parameters$coefficients)]
# values <- matrix(values,,ncol(object at x),byrow=TRUE)
# if(ncol(object at x)>1) object at parameters$coefficients[2:ncol(object at x),] <- values[2:ncol(object at x),]
More information about the depmix-commits
mailing list