Using the help on other threads from Nick Cox I've been able to generate a variable that expresses the percentage change in price of house plants from one month to the next, with the code:
Code:
tsset price date sort date gen price_change = (price - price[_n-1]) / (price[_n-1])
Any advice on how I might go about adjusting the code to get the desired outcome? I'm new to Stata and this is my first post, so I apologise if I'm posting in the wrong area etc.
Thanks!
0 Response to Creating a variable to express percentage change, but based on a the change from fixed points in time, not [n-1] for example.
Post a Comment