-
Notifications
You must be signed in to change notification settings - Fork 6
/
README.Rmd
84 lines (60 loc) · 2.12 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
output: md_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# vinereg
[![R build status](https://github.com/tnagler/vinereg/workflows/R-CMD-check/badge.svg)](https://github.com/tnagler/vinereg)
<!-- [![Coverage status](https://codecov.io/gh/tnagler/vinereg/branch/main/graph/badge.svg)](https://app.codecov.io/github/tnagler/vinereg?branch=main) -->
[![CRAN status](https://www.r-pkg.org/badges/version/vinereg)](https://cran.r-project.org/package=vinereg)
An R package for D-vine copula based mean and quantile regression.
## How to install
- the stable release from CRAN:
``` r
install.packages("vinereg")
```
- the latest development version:
``` r
# install.packages("remotes")
remotes::install_github("tnagler/vinereg", build_vignettes = TRUE)
```
## Functionality
See the [package website](https://tnagler.github.io/vinereg/).
## Example
```{r, warning=FALSE}
set.seed(5)
library(vinereg)
data(mtcars)
# declare factors and discrete variables
for (var in c("cyl", "vs", "gear", "carb"))
mtcars[[var]] <- as.ordered(mtcars[[var]])
mtcars[["am"]] <- as.factor(mtcars[["am"]])
# fit model
(fit <- vinereg(mpg ~ ., family = "nonpar", data = mtcars))
summary(fit)
# show marginal effects for all selected variables
plot_effects(fit)
# predict mean and median
head(predict(fit, mtcars, alpha = c(NA, 0.5)), 4)
```
## Vignettes
For more examples, have a look at the vignettes with
``` r
vignette("abalone-example", package = "vinereg")
vignette("bike-rental", package = "vinereg")
```
### References
Kraus and Czado (2017). D-vine copula based quantile regression.
*Computational Statistics \& Data Analysis*, 110, 1-18.
[link](https://www.sciencedirect.com/science/article/pii/S0167947316303073),
[preprint](https://arxiv.org/abs/1510.04161)
Schallhorn, N., Kraus, D., Nagler, T., Czado, C. (2017). D-vine quantile
regression with discrete variables. Working paper,
[preprint](https://arxiv.org/abs/1705.08310).