I have a dataset akin to this
User Date Value
A 2012-01-01 4
A 2012-01-02 5
A 2012-01-03 6
A 2012-01-04 7
B 2012-01-01 2
B 2012-01-02 3
B 2012-01-03 4
B 2012-01-04 5
I want to create a lag of Value, respecting User.
User Date Value Value.lag
A 2012-01-01 4 NA
A 2012-01-02 5 4
A 2012-01-03 6 5
A 2012-01-04 7 6
B 2012-01-01 2 NA
B 2012-01-02 3 2
B 2012-01-03 4 3
B 2012-01-04 5 4
how can i do this in stata??
Related Posts with How to find lag of a variable in long format panel dataset?
Help with text on a graph aligning when there are negative numbers eg [-1.23] lining up with [1.23]Hi all, I'm hoping the tag line explains the issue! I'm plotting on a graph (like a forestplot) a co…
Changing three-language value labels of a variable into one-language value labelsI imported survey data into STATA from RedCap software. Three languages were used while administerin…
Adding error bars to bar graphHi all, can someone please assist me with how to add error bars to the bar graph attached. Thanks. …
Removing unnecessary observationsHello, I have data containing on retail investor trading (see below). The data set consists of trad…
Create two-way line graph with shaded confidence intervals from dstdize resultsHello, I am struggling to create a simple, two-way line graph representing the results from my stand…
Subscribe to:
Post Comments (Atom)
0 Response to How to find lag of a variable in long format panel dataset?
Post a Comment