Hi all
First of all, apologies if I am not able to explain this very well. I am very new to Stata and still struggling with the lingo.
Essentially, I have a set of observations from different countries of the number of confirmed cases of a certain disease. The data is cumulative and each variable represents a single day in a series of days. An example below:
countryre~n | v5 | v6 | v7 | v8 | v9 | v10 | v11 | v12 | v13 | v14 | v15 | v16 | v17 | v18 | v19 | v20 | v21 |
| Australia | 0 | 0 | 0 | 0 | 4 | 5 | 5 | 6 | 9 | 9 | 12 | 12 | 12 | 13 | 13 | 14 | 15 |
|-----------------------+-----------------------------------------------------------------------------------------|
| v22 | v23 | v24 | v25 | v26 | v27 | v28 | v29 | v30 | v31 | v32 | v33 | v34 | v35 | v36 | v37 | v38 | v39 | v40 |
| 15 | 15 | 15 | 15 | 15 | 15 | 15 | 15 | 15 | 15 | 15 | 15 | 15 | 19 | 22 | 22 | 22 | 22 | 22 |
I need to separate this cumulative data into each individual day, i.e essentially I want 40 different variables that are xn = vn - vn-1 if that makes sense.
Is there a function I can use for this or will I have to separately generate a variable?
0 Response to Separating cumulative data into actuals
Post a Comment