I will illustrate my question with an example.
Say I have a variable called Temperature for 100 years in a country X.
I would like to create a variable Temperature_Record such that for year n Temperature_Record=max(Temperature(year 1:year n))
That is I want it to record the maximum temperature reached as of year n. This will give me a variable that will only increase over time naturally.
In addition I would like to do that in a panel of countries if possible.
Thoughts very much appreciated. I am new to STATA.
Thank you
Related Posts with Record-to-date value in a time series or panel
Can I Collapse or Reshape to Wide?I am struggling to do the right thing here, as well as use the right terminology because I'm not pos…
Group by order of event occurrenceHi, It may be a relatively simple problem to order dates, but I cannot find an elegant solution. I h…
Dealing with line breaks in observationsI have data where each drug ID corresponds to multiple patent numbers in a single observation, for i…
Generating categorical variable from other variablesHello statalist, I hope everyone are doing good. I have a question a bout: how to create a categor…
Help for DCCE-GMM Stata commandHello ! I have a panel data with cross sectional dependence.and I want to estimate dynamic heterogen…
Subscribe to:
Post Comments (Atom)
0 Response to Record-to-date value in a time series or panel
Post a Comment