Advertisement
Guest User

Untitled

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