更新时间:2023-12-02 13:51:40
@jogo给出了一种更改for循环方法并使用sapply的想法,并将对象beta更改为list().结果就是这样:
@jogo give an idea to change the for-loop method and use sapply, and change the object beta to list(). This was the result:
beta <- sapply(1:n, function(i) coef(lm(Premium ~ Liquidity +Leverage+ hubris_dataset[,i], data=dt_deals2)))
它奏效了