if (FALSE) {
options(crs.messages=FALSE)
set.seed(42)
n <- 1000
z <- rbinom(n,1,.5)
x1 <- rnorm(n)
x2 <- runif(n,-2,2)
z <- factor(z)
## z is irrelevant
y <- x1 + x2 + rnorm(n)
model <- crs(y~x1+x2+z,complexity="degree",segments=c(1,1))
summary(model)
model.sigtest <- crssigtest(model)
summary(model.sigtest)
}
Run the code above in your browser using DataLab