Learn R Programming

DATAstudio (version 1.2.1)

marketsUS: NASDAQ and NYSE Indices

Description

Daily quotations at close of the NASDAQ and NYSE stock market indices from February 1971 till November 2021.

Usage

marketsUS

Arguments

Format

The marketsUS data frame has 12562 rows and 3 columns: date and quotation at close of the nasdaq and nyse indices.

References

de Carvalho, M., Huser, R., Naveau, P., and Reich, B. J. (2025, to appear). Handbook on Statistics of Extremes. Chapman & Hall/CRC. Boca Raton, FL.

de Carvalho, M., Kumukova, A., and dos Reis, G. (2022) Regression-type analysis for multivariate extreme values. Extremes, 25, 595-622.

Examples

Run this code
if (FALSE) {
## de Carvalho et al (2022; Fig 5.1)
data(marketsUS)
packages <- c("ggplot2", "scales")
sapply(packages, require, character.only = TRUE)
ggplot(data = marketsUS, aes(x = date, y = value, color = Indices)) + 
    geom_line(aes(y = nasdaq, col = "NASDAQ"), alpha = 0.5,
              position = position_dodge(0.8), size = 1.1) +
    geom_line(aes(y = nyse, col = "NYSE"), alpha = 0.5,
              position = position_dodge(0.8), size = 1.1) + 
    scale_y_continuous(breaks = seq(2000, 14000, by = 2000)) + 
    scale_x_date(labels = date_format("%Y"), 
                 breaks = as.Date(c("1971-01-01", "1978-01-01",
                                    "1985-01-01", "1992-01-01",
                                    "1999-01-01", "2006-01-01",
                                    "2013-01-01", "2020-01-01"))) + 
    scale_color_manual(values = c("red", "blue")) +
    labs(y = "Value (in USD)", x = "Time (in Years)") +
    theme_minimal()
}

Run the code above in your browser using DataLab