Error combining splitapply and regress
이전 댓글 표시
Hello,
I have a table named 'T' containing a set of stock returns for different stocks as well as the market return for all days the stock returns are presented. I have divided my table into groups based on the stock and now I am trying to create a regression that uses the stock return as the dependant variable and a constant and the market return as the independant/explainatory variables, however I get the error message 'Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.'
I used the code as follow:
T.Groups = findgroups(T.Numero)
T.Ones = ones(length(T.MarketReturn),1);
X = splitapply(@regress(T.StockReturn,[T.Ones T.MarketReturn]),T,T.Groups);
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Multiple Linear Regression에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!