Hi all, I tried some ways to put "if" to the regressing statement but they all failed, can you please hint me to sort it out?

I want to regress wACC_REC_DAY on pt when wACC_REC_DAY<365

My code is:
HTML Code:
xtset TYPE2 yr
Code:
areg wACC_REC_DAY pt if (wACC_REC_DAY<=365) i.yr , a(TYPE2)
And the error is:
Code:
invalid 'i.yr'

Thank you.