-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
executable file
·86 lines (64 loc) · 2.51 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
85
86
---
output:
md_document:
variant: markdown_github
editor_options:
markdown:
wrap: 72
---
<!-- badges: start -->
[![R-CMD-check](https://github.com/EnriquePH/marketconf/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/EnriquePH/marketconf/actions/workflows/R-CMD-check.yaml)
[![AppVeyor Build
Status](https://ci.appveyor.com/api/projects/status/github/EnriquePH/marketconf?branch=master&svg=true)](https://ci.appveyor.com/project/EnriquePH/marketconf)
![License](https://img.shields.io/:license-mit-blue.svg)
<!-- badges: end -->
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# Package `marketconf`: Stock Market Confidence Indexes
The R package `marketconf` reads data on **U. S. Stock Market Confidence
Indexes** from the [Yale School of Management's International Center
for
Finance](https://som.yale.edu/faculty-research/our-centers-initiatives/international-center-finance/data/stock-market-confidence)
web page.
This package is designed for stock market prediction and risk valuation,
and it is compatible with other packages like:
[`quantmod`](https://cran.r-project.org/web/packages/quantmod/index.html),
[`TTR`](https://cran.r-project.org/web/packages/TTR/index.html) or
[`tidyquant`](https://cran.r-project.org/web/packages/tidyquant/index.html)
## Package installation
```{r, eval=FALSE}
library(devtools)
devtools::install_github("EnriquePH/marketconf")
```
## Examples
### Listing confidence indices
The four U.S. stock market confidence indexes are derived monthly from
survey data on investors' behavior. These indexes are:
```{r}
library(marketconf)
library(knitr)
kable(US_confidence_indices())
```
### Plotting
This is a basic example that plots the **U.S. Valuation Index**:
```{r example}
library(ggplot2)
index_symbol <- "USVI"
index_df <- get_index(index_symbol)
ggplot(index_df, aes(x = Date, y = USVI.Value, color = Investor)) +
geom_line() +
ggtitle(get_index_description(index_symbol))
```
## License
The `markerconf` package is licensed under the **MIT License (MIT)**, but the
__Stock Market Confidence Indexes__ are produced and copyrighted by the
__International Center of Finance at the Yale School of Management__. Please
refer to the [TERMS OF
USE](https://som.yale.edu/centers/international-center-for-finance/data/stock-market-confidence-indices/united-states)
on [Yale University](https://som.yale.edu/)'s web page for further information.