Dear all,
I am using this code to reshape data. It does reshape but the date order of the original file gets altered. i want to reshape but keep the order of date and entity intact. Kindly help me to update this code:
foreach var of varlist * {
local j = "`: variable l `var''"
local newname = strtoname("`j'", 1)
rename `var' V_`newname'
}
destring,replace
generate id = _n
reshape long V_ , i(id) j(dat) string
list, sepby(id)
Thanks in anticipation.
Related Posts with Reshape Long
How to extract element of a matrix and put it to new rows of this matrixDear Statalists, I am not very familiar with the matrix in Stata. I just have a simple question bel…
IVtobit aweight and clusteringDear friends, if I use tobit for dependent variable, Y, with lots of zero or negative values, can I …
Manual -xtprobit, fe- and -xtoprobit, fe-?Dear listers, after estimating fixed effect regressions for an outcome with a limited number of val…
Categorical covariate for Parametric Survival ModelHello House, I am running parametric survival models using Code: streg Xlist distribution () time f…
inquire about ORDERED LOGISTIC REGRESSIONHello, in my research paper, I have a dependent variable: financial stress level 1-10. I have a set …
Subscribe to:
Post Comments (Atom)
0 Response to Reshape Long
Post a Comment