R/bbase.interaction.vc.bs.R

Defines functions bbase.interaction.vc.bs

bbase.interaction.vc.bs <- function(x1, x2, ndx, bdeg = 3, pord = 2, eps = 1e-5) {
	
	# Intercept included by hand: here main effect of x2
	# MM <- bbase.bs(x = x1,  ndx = ndx, bdeg = bdeg, pord = pord, intercept = FALSE)
	# B <- cbind(x2, x2*MM$B)
	# MM$K[[1]] <- as.matrix(bdiag(0, MM$K[[1]]))
	
	MM <- bbase.bs(x = x1,  ndx = ndx, bdeg = bdeg, pord = pord, intercept = TRUE)
	B <- x2*MM$B
	
	res <- list()
	res$B <- B
	res$K <- MM$K
	res$terms <- MM
	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.