I am doing a study correlating stock market (S&P 500) valuations to future annual market returns and want to use time series operators to find the lag that produces the best fit. Being new to Stata my first approach was to generate 20 new variables representing forward annual returns for each year 1 through 20. My data is monthly so the variable, for example, for 6-year forward returns is: sp500_6yf_ret = (((f72.sp500/sp500)^(1/6)) -1). I can then do 20 correlations of the valuation variable against each of these 20 return variables and find the time period with the highest correlation. The approach works but is sloppy and the output is limiting. I've searched the documentation and Statlist for help on this but I am stumped. Is there a single time series operator that would allow me to iterate/loop through the S&P500 monthly price data to generate the time lag that best correlates valuation with future annual returns?
Related Posts with Time series operators to find optimal lag in a regression
 Mata debugging strategiesMight anyone suggest helpful references on strategies for Mata debugging?
… Mata debugging strategiesMight anyone suggest helpful references on strategies for Mata debugging?
…
 nested loopsI divided a variable in quintiles and I want to summarize a list of variables for each quintiles. I … nested loopsI divided a variable in quintiles and I want to summarize a list of variables for each quintiles. I …
 Confidence Intervals / Errr plots with binscatterI am trying to include confidence intervals / errors bars in a plot for two variables using -binscat… Confidence Intervals / Errr plots with binscatterI am trying to include confidence intervals / errors bars in a plot for two variables using -binscat…
 Count dates within previous 31 day range for each date using forvaluesDear Stata colleagues,
I created a loop in order to count the number of dates following 3 condition… Count dates within previous 31 day range for each date using forvaluesDear Stata colleagues,
I created a loop in order to count the number of dates following 3 condition…
 Analytical weight in a count model with an exogenous treatmentHello,
I have a quick question regarding weights in 'teffects'. Could you please point me towards t… Analytical weight in a count model with an exogenous treatmentHello,
I have a quick question regarding weights in 'teffects'. Could you please point me towards t…
Subscribe to:
Post Comments (Atom)
0 Response to Time series operators to find optimal lag in a regression
Post a Comment