Here is an example of the dataset where I have date, two mutual funds and the market excess return.
datapasta::df_paste(head(dataframe, 5)[, c('Date','Alfred Berg Global C (NOK)', 'APS Global Equity R', 'mkt-rf')])
check.names = FALSE,
Date = c("2016-01-01","2016-02-01","2016-03-01",
Alfred Berg Global C (NOK) = c(-0.0708041333333334,0.0115925,0.00619040000000006,
APS Global Equity R = c(-0.0681767333333333,0.0077110000000001,
mkt-rf = c(-0.0743514443678082,-0.00884050754326752,
I want to regress both of the funds individually on the market return.
I have written the following code for the linear model:
Alfred Berg Global C (NOK~ df.t18$
Is there a way I can do this regression on all the mutual funds at the same time? Now I manually change the name of the dependent variable for every regression, but this is very time consuming.
I appreciate all help I can get!