regress {pa} | R Documentation |
Create an object of either class regress or class regressMulti
Description
Conduct regression analysis for equity portfolio attribution. Create
an object of either class regression
for a single-period data set or
class regressionMulti
for a multi-period data set.
Usage
regress(x, date.var = "date", ret.var = "return", reg.var = c("sector",
"value", "growth"), benchmark.weight = "benchmark", portfolio.weight =
"portfolio")
Arguments
x |
A data frame containing the data from which regression analysis will be conducted. |
date.var |
A character vector which indicates the name
of the column in |
ret.var |
A character vector which indicates the name of the
column in |
reg.var |
Input variables to be used as independent variables in the regression analysis. |
benchmark.weight |
A character vector which indicates the name of the
column or columns in |
portfolio.weight |
A character vector which indicates the name of the
column or columns in |
Value
Return an object of class regression
when there is only one
unique date in the data frame x
. Otherwise, an object of class
regressionMulti
is returned.
Author(s)
Yang Lu Yang.Lu@williams.edu
Examples
## Single-period regression analysis
data(jan)
r1 <-regress(x = jan, date.var = "date", ret.var = "return", reg.var =
c("sector", "value", "growth"), benchmark.weight = "benchmark",
portfolio.weight = "portfolio")
summary(r1)
## Multi-period regression analysis
data(quarter)
r2 <-regress(x = quarter, date.var = "date", ret.var = "return", reg.var
= c("sector", "value", "growth"), benchmark.weight = "benchmark",
portfolio.weight = "portfolio")
summary(r2)