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
Readying My Data for Panelwise AnalysisHello Statalist, I have been working on a dataset in Stata for the past month or so, but have recen…
expanding single observation into panel data with observations for each year an item existsDear , I want to transform my dataset into panel dataset. Currently my dataset looks like this (fi…
Continuous dependent variable, use of regressionI am trying do make some descriptive statistic. In my dataset I have ID, Age, time from start of bei…
Converting monthly data into quarterly for a panel with multiple variablesHi all, I am working with a panel dataset which contains the following variables: wage bin (define…
Country specific time trends with first-differenced regressionDear all, I am running a first-differences regression and was wondering if country specific time tr…
Subscribe to:
Post Comments (Atom)
0 Response to Reshape Long
Post a Comment