# 2-dimensional response curve
n = 300; p = 5
b1 = c(1, 1, 1, rep(0, p-3))
b2 = c(1,-1,-1, rep(0, p-3))
b = cbind(b1,b2)
x = mvrnorm(n, mu = rep(0,p), Sigma = diag(p))
y = x %*% b1 + (x %*% b1)^3 + 4*(x %*% b2)^2 + rnorm(n)
MSIR = msir(x, y)
summary(MSIR)
plot(MSIR)
plot(MSIR, which = 1:2)
plot(MSIR, type = "2Dplot", which = 1, span = 0.7)
plot(MSIR, type = "2Dplot", which = 2, span = 0.7)
plot(MSIR, type = "spinplot")
plot(MSIR, type = "evalues")
plot(MSIR, type = "coefficients")Run the code above in your browser using DataLab