简体   繁体   中英

regression on many variables - extract b1 value

i have a dataframe containing 211 columns where the first column every cell represents a day for and this for 10 years, and the other 210 variables are representing daily values for a corresponding firm. Each column represents the y-values for the regressions I want to do. In the end, I want to have the corresponding Beta1 for each regression for each column. My X values are also in a dataframe and containing of the same amount of dates and one column of the X values.

Does anyone have an idea of how I can run the regression for each column of my first dataframe on the same column of the second dataframe and always extract the beta1 value from the regression?

Thanks in advance!!

you are right, this is some exmaple data - now I need a regression for every firm on the x-values and from the regression only the beta1 value

so: lm(y-values$FIRM-a ~ x_values$rf) --> extract beta1 value and sort it to the related firm, so I need an final data frame containing beta1 for each firm

Y-values data frame

x-values data frame

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM