Displaying 1 result from an estimated 1 matches for "returns1".
Did you mean:
returns
2009 Mar 23
1
Basic regression output question
...access the data,
perhaps to extract a particular column or row, how do I do this? Code
such as (coef(summary(lm(t(returns)~factors)))[50])[1,4], which works
when I have only one response variable, returns me an error.
Thanks in advance
Lewis
EXAMPLE CODE
factors<-matrix(runif(400),nrow=40)
returns1<-matrix(runif(40),nrow=1)
returns2<-matrix(runif(2000),nrow=50)
coef(summary(lm(t(returns1)~factors)))[1,4]
[1] 0.01062590
(coef(summary(lm(t(returns2)~factors)))[50])
Response Y50 :
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.54829326 0.3230444 1.69726923...