Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(car)
- library(quantreg)
- library(boot)
- newdata = Prestige[,c(1:4)]
- education.c = scale(newdata$education, center=TRUE, scale=FALSE)
- prestige.c = scale(newdata$prestige, center=TRUE, scale=FALSE)
- women.c = scale(newdata$women, center=TRUE, scale=FALSE)
- new.c.vars = cbind(education.c, prestige.c, women.c)
- newdata = cbind(newdata, new.c.vars)
- names(newdata)[5:7] = c("education.c", "prestige.c", "women.c" )
- mod1 = lm(income ~ education.c + prestige.c + women.c, data=newdata)
- mod2 = rq(income ~ education.c + prestige.c + women.c, data=newdata)
- mod1.boot <- Boot(mod1, R=999)
- boot.ci(mod1.boot, level = .95, type = "all")
- dat2 <- newdata[5:7]
- mod2.boot <- boot.rq(cbind(1,dat2),newdata$income,tau=0.5, R=10000)
- boot.ci(mod2.boot, level = .95, type = "all")
- Error in if (ncol(boot.out$t) < max(index)) { :
- argument is of length zero
- t(apply(mod2.boot$B, 2, quantile, c(0.025,0.975)))
- Warning message:
- In sqrt(tv[, 2L]) : NaNs produced
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement