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
Exponentially Weighted Moving Average (EWMA) Control ChartHi Statalisters I was wondering if anyone can share example codes for graphing Exponentially Weight…
Multiple regression analysis bachelor thesis HelpDear Stata experts, I currently am writing my bachelor thesis regarding the topic International Joi…
Panel data analysisHi evryone. What is wrong in may data? I cannot do xtpcse analysis. Please HELP!!!. …
Average marginal effects of the structural model using gsemHello everybody! Currently, I am fitting a structural equation model using gsem in Stata 16. My c…
summarize variable by group with max and min valuesHi, How can I summarize a variable by group including maximum and minimum value? This only calcula…
Subscribe to:
Post Comments (Atom)
0 Response to Reshape Long
Post a Comment