var.cov.comparison: Comparing Variance,Volatility,Covariance and Beta

View source: R/var_cov_comparison.R

var.cov.comparisonR Documentation

Comparing Variance,Volatility,Covariance and Beta

Description

This function enables to select different stocks and creates a table that compares variance,volatility, covariance and beta of these stocks with a market index of your choice.

Usage

var.cov.comparison(ticker, market_index = "^GSPC", from, to)

Arguments

ticker

A character vector storing the tickers of the stocks of which you want the correlation. Note that since data are downloaded from Yahoo finance, the ticker should be the same as the ones reported on Yahoo finance. See examples.

market_index

A single character variable storing the ticker of the market index you want to download. Default to "^GSPC" (S&P500)

from

A single character variable storing the starting date from which we want to download the data. The format should be "yyyy-mm-dd"

to

A single character variable storing the ending date up to the day in which we want to download the stock data. The format should be "yyyy-mm-dd"

Examples

## Not run: 
var.cov.comparison(ticker =c("AA","AAPL","AXP","BA","BAC","CAT","CVX","DD","DIS",
"GE","HD","HPQ","INTC","IBM","JNJ","JPM","KO","MCD","MMM",
"MRK","MSFT","NKE","PFE","PG","TRV","VZ","WMT","XOM","T"),
from = "2020-01-01", to = "2022-01-01" )


var.cov.comparison( ticker = c ("AAPL" , "AMZN" ), market_index =   "FTSEMIB.MI",
from = "2020-01-01" , to = "2022-01-01" )


## End(Not run)



gabrielebonvicini/aaa documentation built on May 21, 2022, 12:07 a.m.