Revision 9db5cb10e6504bf07dee9dff590abf263209d7c1 authored by Andrej-Nikolai Spiess on 08 August 1977, 00:00:00 UTC, committed by Gabor Csardi on 08 August 1977, 00:00:00 UTC
0 parent
Raw File
pcrpred.R
pcrpred <- function(object, newdata, which = c("y", "x"), ...)
{
	which <- match.arg(which)

	if (which == "y") {
		pred <- sapply(newdata, function(x) predict(object, newdata = data.frame(x), ...)[1])
	}

     	if (which == "x") {
		if (is.null(object$fct$inversion)) stop("no inverse function available for this model!")
		pred <- object$fct$inversion(newdata, object$parmMat)
	}
		
	pred <- as.numeric(pred)
	return(pred)
}
back to top