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
Converting a code from Stata to RHello guys, I'm new to both Satata and R. I'm trying to do a regression to find the causal effect be…
data structure transformationHi How can the left structure be transformed into the right one? The 'school' indicates school id.…
How to correct for attrition with IPW in a DID setting?Hi everyone, I am working with a panel dataset from a project that is about giving health and nutri…
Negative predicted values after xtnbreg on nested count dataI am analyzing how many comments a social media picture of a women gets based on how good looking th…
Poisson regression formulaHello everyone, I am trying to write this Code: xtpoisson patents cl.ln_xrdintensity##cl.Numberof…
Subscribe to:
Post Comments (Atom)
0 Response to Generate variable to subtract current value from previous value
Post a Comment