Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require(rms)
- # Estimate 25th percentile of y as a function of x1 and x2
- f <- Rq(y ~ rcs(x1, 4) + rcs(x2, 4) + rcs(x1, 4) %ia% rcs(x2, 4), tau=.25)
- # rcs = restricted cubic spline, here with 4 default knots
- # %ia% = restricted interaction
- # To use general interactions (all cross product terms), use:
- # f <- Rq(y ~ rcs(x1, 4)*rcs(x2, 4), tau=.25)
- anova(f) # get automatic combined 'chunk' tests: nonlinearity, interaction
- # anova also provides the combined test of complexity (nonlin. + interact.)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement