I have an unbalanced panel data about U.S. equity funds Variables:
yrqt: a date variable, such as 1981q1, 1981q2…
wficn: fund identifier
fund_name: the name of a mutual fund

Mutual fund may change its name over time. I want to create a new variable to identify these quarters when the fund’s name is different from the previous quarter. We can call this new variable is_change, whose value takes 1 if the fund’s name at current quarter is different from last quarter, and takes value of 0 if the fund’s name stays the same.

How can I accomplish the task described above with stata codes? Any advice would be greatly appreciated. Thank you.Array