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
Having time-specific control and IV variablesHello everyone, I am currently working on a data set that has both a year variable along with pertin…
Multiple Regression Issues - Stata not showing any informationHi! I am trying to do a multiple regression but when I try to do it, I don't get any of the p-values…
Ask help for xttobit model with fixed effect.Stata cannot execute fixed effect panel tobit model of course, but what if I doubt the result of ran…
Transform time series into panel dataDear Statalist experts, I have the following time series of the US population by city and state in 2…
drop observations in long panel data set if variable changes over time, ignoring missing valuesI am working with data where certain time-invariant variables, e.g. sex and birth year, are changing…
Subscribe to:
Post Comments (Atom)
0 Response to Generate variable to subtract current value from previous value
Post a Comment