How to do the equivalent of Excel linest function?

19 views (last 30 days)
I have been solving these problems using Excel linest for years, but I want to solve problems that are too large for Excel. Something on the order of 200 independent variables (predictors) and 5000 observations. I've looked at some of the examples and tried to follow the help, but as with all programming, unless you do it exactly right you get nothing. I need a little guidance to build my first model. Once I have the coefficients, I will move them to another environment for further evaluation. The predictors are financial market technicals. The observations are hypothetical profit or loss.
Thanks for any assistance. I can load my data (csv file) into a workspace and then to the command window, but when I open the curvefit toolbox, I can get no further.

Answers (1)

Walter Roberson
Walter Roberson on 14 Aug 2017
  1 Comment
Tom Graney
Tom Graney on 14 Aug 2017
This is what I have found with internet search: 1)Put my data in an Excel file, naming the columns with the independent and dependent variable names. 2) In the command window: MyTable = readtable("filespec") 3) In the command window: MyModel = fitlm(MyTable)
Presto, I have my answer. Thanks MatLab.

Sign in to comment.

Categories

Find more on Data Import from MATLAB in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!