For my project, I have a set of search terms and their daily observations for 18 years from 1-1-2004 to 29-11-2022. I want to regress each word with the Fama French factors 'rmf' variable over this time, to form an index of search terms. As each word will be searched at different quantities throughout the 18 years, I want to do rolling regressions to extract those with the most negative t-statistic with the market every 6 months.
This is the current code I am running:
I am not sure how to correct this
This is the current code I am running:
Code:
. foreach var of varlist ldiffcost_w - ldiffexpense_w {
2. tsset date, daily
3. rolling _b, window(6/12*`=_N'): regress `var' rmrf, robust if date >= "1-1-2004" & time <= "29-11-202
> 2"
4. if e(b)[1,1] < 0 local negvars `negvars' `var'
5. }
Time variable: date, 1/1/2004 to 11/29/2022
Delta: 1 day
window() invalid -- single number required
r(123);

Comment