R/predict.design.matrix.DDPstar.R

Defines functions predict.design.matrix.DDPstar

predict.design.matrix.DDPstar <-
function(object, newdata, ...) {
	if(object$fit$mm$iformula$npartial == 0) { # Only the intercept
        Xp <- matrix(1, ncol = 1, nrow = nrow(newdata))
    } else {
		select <- 1:object$fit$mm$iformula$npartial
		Xp <- predict_design.matrix.DDPstar.aux(object = object$fit$mm, newdata = newdata, select = select)
	
		# Add the intercept
		Xp <- cbind(1, Xp)
	}
	res <- list()
	res$X <- Xp
	res
}

Try the DDPstar package in your browser

Any scripts or data that you put into this service are public.

DDPstar documentation built on April 3, 2025, 8:46 p.m.