Hello. I am working with the NYT COVID-19 data. The data presents two years worth of COVID-19 case and death data. Each month presents the geographic unit's case and death load for that month plus the case and death loads from the previous months ex. (two new cases per month):
```
Date Cases New_Cases
1-20 0 0
2-20 1 1
3-20 3 2
4-20 5 2
5-20 7 2
6-20 9 2
```
Is there a way to generate a variable (New_Cases) to subtract the number of cases from the previous month? For reference, I've included the NYT Github data below:
https://github.com/nytimes/covid-19-...s-counties.csv
Related Posts with Generate variable to subtract current value from previous value
Superscript and subscriptDear Stata users, I have a variable with both superscript and subscript. When I wrote both superscr…
wbopendata Multiple IndicatorsHi All, I am currently trying to download multiple indicators onto STATA from wbopendata, Currently…
'No observations' errorDear all, I'm trying to conduct a unit root test to my variables using the following code: Code: …
Comparison of predicted values after OLS regressionDear all, I am interested in predicted values after an OLS regression. Moreover, I am curious how t…
Complex survey settingsHi, I am trying to set-up a complex survey data set in Stata and Mplus so that they have the same s…
Subscribe to:
Post Comments (Atom)
0 Response to Generate variable to subtract current value from previous value
Post a Comment