Learn R Programming

FinAna (version 0.1.1)

betaf: Calculating beta for a company or a select of companies

Description

Calculating beta using common method or linear regression(OLS)

Usage

betaf(x,y,method)

Arguments

x
:a vector or a data.frame of rate of return of companies
y
:name of the independent variable
method
:method of calculation; method = 1 for a common expression of beta(see detail); method = 2 using linear regression to estimate the beta

Examples

Run this code
#betaf(appl,sp500)

Run the code above in your browser using DataLab