1. ## Regression Analysis

Hey everyone,

I have a regression model where I have as a dependent variable daily stock prices over 365 days for multiple stocks.

I am wondering in which format I would arrange the data if I am interested in say predicting each stocks value in the future periods.

My initial thought was to stack all the individual time series for each stock on top of each other, i.e. something like this:

stock1price_day1 explVar1_for_Stock1_day1
stock1price_day2 explVar1_for_Stock1_day2
stock1price_day3 explVar1_for_Stock1_day3

stock2price_day1 explVar1_for_Stock2_day1
stock2price_day2 explVar1_for_Stock2_day2
stock2price_day3 explVar1_for_Stock2_day3

stock3price_day1 explVar1_for_Stock3_day1
stock3price_day2 explVar1_for_Stock3_day2
stock3price_day3 explVar1_for_Stock3_day3

Would this be a meaningful approach or would this be problematic, because I would be assuming that each stock has the same sensitivity to the explVar1. Basically, I am wondering if I should be running a different regression for each stock?

Thanks for any input.

Tartaglia

2. ## Re: Regression Analysis

I think many forecasting models use long data, so you list each stock's price as an observation (row) and have another variable called day. Day goes from 1 to your last date. Then you plot day on the X-axis and price on the Y-axis. I am not following your other concerns, so you have an explanatory variable that does not change??

3. ## Re: Regression Analysis

Thank you hlsmith for your response.

What you described is what I would like to do. However, I want to do this for multiple stocks. So I would have each row representing a daily observation for that one stock. Then after say 100 days, I have the same 100 days for stock 2 right underneath in that same column, and so on for the other stocks. So in the time column, I have values going from Day1 to Day100, and then starting again as Day1 to Day100 for each stock. Then I do the same for the explanatory variables, also repeating themselves.

1) If I run one regression for the entire dataset, I would obtain a beta that would tell me how all of the stocks react on average to that one explanatory variable.

2) If I run one regression for each stock separately, I would obtain a beta for each stock that reflects how that one stock reacts to that one explanatory variable.

I am basically wondering if the first approach would make sense.

My question then is, could I run a regression of the form: StockPrice on Explanatory variable

for this entire data set or would I have to split the data for each stock and then run a regression for each stock separately.

I hope this is clear, if not, please let me know.

 Tweet

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts