Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jebyrnes/quantreglines
A function to plot quantile regression lines
https://github.com/jebyrnes/quantreglines
Last synced: 25 days ago
JSON representation
A function to plot quantile regression lines
- Host: GitHub
- URL: https://github.com/jebyrnes/quantreglines
- Owner: jebyrnes
- Created: 2013-12-04T15:39:20.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2013-12-04T15:46:06.000Z (almost 11 years ago)
- Last Synced: 2023-03-11T22:23:39.991Z (over 1 year ago)
- Language: R
- Size: 172 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
README
quantRegLines
========================================================This is an R function to plot multiple quantile regression lines at different levels of tau. It's adapted from the rq helpfile.
```{r fig.width=7, fig.height=6}
source("./quantRegLines.R")library(scales)
data(engel)
attach(engel)taus <- c(.05,.1,.25,.75,.9,.95)
plot(income,foodexp,xlab="Household Income",ylab="Food Expenditure",
pch=19, col=alpha("black", 0.5))rq_fit <- rq((foodexp)~(income),tau=taus)
quantRegLines(rq_fit)
```Or try it with multiple colors
```{r fig.width=7, fig.height=6}
plot(income,foodexp,xlab="Household Income",ylab="Food Expenditure",
pch=19, col=alpha("black", 0.5))quantRegLines(rq_fit, rainbow(6))
legend(4000, 1000, taus, rainbow(6), title="Tau")
```