Re: [R] Finding Beta

2013-06-04 Thread R. Michael Weylandt
Put your data in a real time series (xts) object and use the CAPM.* functions from the PerformanceAnalytics package. MW On Tue, Jun 4, 2013 at 10:15 AM, Katherine Gobin wrote: > Dear R forum > > I have a dataframe (of prices) as given below - > > dat > = data.frame(company = rep(c("A", "B", "C"

[R] Finding Beta

2013-06-04 Thread Katherine Gobin
Dear R forum I have a dataframe (of prices) as given below - dat = data.frame(company = rep(c("A", "B", "C", "D", "index"), each = 5), prices = c(runif(5, 10, 12), runif(5, 108, 112), runif(5, 500, 510), runif(5, 40, 50), runif(5, 1000, 1020)))    company prices 1    A   10.61727 2