Hi, I have a long-long format data set as below, I made reshaping before, but this time it is hard to find "j()" in the general reshape code. As you see 5678000 id numbered respondent has 4 observation and variable "activity_rtr " repeats 3 times and "spell_rtr" variable repeats itself as well. I have no other choice to create a variable having a unique value within the same id. Lets say this new variable is "newid ". I want to have this kind of look at below. How can I code this?
id newid
5678000 1
5678000 2
5678000 3
5678000 4
5780000 1
5843000 1
Array
Related Posts with reshaping and creating unique "j()" within same id
PSM method againHello every one i m doing my analysis for my research and i need to do endogeneity test by using PSM…
Help with merging variablesGood afternoon, I am new here and would greatly appreciate some help. I have two variables about we…
matrix operation not foundDear All, I need some advice on how to deal with an error: matrix operation not found I get th…
Help estimating 3d panel dataHello, I'm working with this dataset Array and I want to run a fixed effects regression, so I type …
match couples in a pooled quarterly cross section (Q1 only) with hhid, wave and survey year known, hhid unique to each quarter only.Dear Statalist, I am trying to match couples (married or cohab) in a pooled cross section. I have a…
Subscribe to:
Post Comments (Atom)
0 Response to reshaping and creating unique "j()" within same id
Post a Comment