Regression testing / Linear Analysis - Can you use dates in regression models?

S

simplegirl00

I am working on a regression model and need some help. Can you use dates in regression models? I am looking at stock prices and am trying to figure out what to use as my X and Y. I have dates, open, close, high, low and volume. I want to build a model that will predict stock prices.
 

Miner

Forum Moderator
Leader
Admin
The correct analysis for data involving a time variable is typically Time Series Analysis, not regression analysis. Regression involving time would be more rare.

Stock prices would fit the Time Series Analysis model.
 
S

simplegirl00

Thank you. So in an effort to predict future stock prices with the above mentioned variables, would you use the closing stock price as the Y variable and all other data points as a the X. I'm not even sure that the volume is even applicable.
 

Steve Prevette

Deming Disciple
Leader
Super Moderator
As far as a technical answer to the question, yes you could use dates on the x-axis, or if the specific software you are using does not allow it, set the first day to day 0 and then convert the dates to number of days since the first day.

One thing most folks do not take into account is that there are prediction and confidence intervals related to any regression that should be examined, not just the center line of the fitted curve or line.

No, I would not suggest a simple linear regression to try to predict stock prices. Personally, I'd work on an SPC based model.
 
K

keiko01

I've done that before however I had to tag the dates using Monday as 1,...Friday as 5. Good luck
 

Statistical Steven

Statistician
Leader
Super Moderator
I am working on a regression model and need some help. Can you use dates in regression models? I am looking at stock prices and am trying to figure out what to use as my X and Y. I have dates, open, close, high, low and volume. I want to build a model that will predict stock prices.

I doubt that stock price analysis meets the assumptions for linear regression. I doubt a stock continues to increase of decrease, so the linear model is probably inappropriate. I believe the suggestion of using something similar to SPC is a better approach. Though the most common (and used on Wall Street) is a EWMA (exponentially weighted moving average) model. Good luck with any approach you select.
 
Top Bottom