[This article was first published on Freakonometrics - Tag - R-english, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
In order to illustrate quantile regression, consider the following natality database,
base=read.table( "http://freakonometrics.free.fr/natality2005.txt", header=TRUE,sep=";")
We can use it produce those nice graphs we can find in several papers, modeling weight of newborns,
u=seq(.05,.95,by=.01) coefstd=function(u) summary(rq(WEIGHT~SEX+ SMOKER+WEIGHTGAIN+BIRTHRECORD+AGE+ BLACKM+ BLACKF+COLLEGE,data=base,tau=u))$coefficients[,2] coefest=function(u) summary(rq(WEIGHT~SEX+ SMOKER+WEIGHTGAIN+BIRTHRECORD+AGE+ BLACKM+ BLACKF+COLLEGE,data=base,tau=u))$coefficients[,1] CS=Vectorize(coefstd)(u) CE=Vectorize(coefest)(u)
|
Mcgill3< embed name="__sse12653996" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=mcgill3-120423094635-phpapp01&stripped_title=mcgill3&userName=charthur" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" width="450">
View more presentations from charthur.
To leave a comment for the author, please follow the link and comment on their blog: Freakonometrics - Tag - R-english.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.