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
Frequency table for logistic regressionI'm running a multi-level miseducating effect logistic regression. I know that STATA will remove any…
Use a time-limited outcome variable with xtgls?We have a dataset of heart rate variation over time during a 5-minute session (increments of 30 data…
Reliability coefficient omega and alphaDear all, using Code: ssc install omega , I calculated the reliability coefficient omega and alpha…
Simulation generating the exact same data.Dear All, I am running a computationally intensive simulation on Stata-16 MP-32 core on a high-powe…
Fixed effect ordered logitHi Stata users, I have an ordered dependent variable and I am trying to implement fixed effect orde…
Subscribe to:
Post Comments (Atom)
0 Response to Generate variable to subtract current value from previous value
Post a Comment