hi, I need to reshape a huge data set wide to long (2557 binary variables and 1.6 million observations). I m using stata mp 15 on a supercomputer and am grouping the masterfile into 6000 groups and using for loops to reshape as follows:
forv m=1/6000{
use Y:\master_event.dta if groupid == `m', clear
drop groupid
reshape long opioid_ bzd_ conc ,i(patid) j(day)
save Y:\first_reshape_of_collapsed`m'.dta
}
this is still taking 10 minutes per file to run , which means a very long time to complete. i ve noticed that the cpu's are not being used to their full capabilities. are there stata memory settings i need to adjust or something else to make this reshape command run faster?
thanks
Related Posts with reshape command
Minimum number of groups for conducting multilevel latent class analysisHi Statalisters, My question is as the title. I am working on a survey data that has around 9,000 o…
Inflation inexHello forum members< I have panel data for many years, and I need to adjust the Dollar value (in…
Binary regression and dummies variablesHi everyone, I want to estimate the coefficient of the following regression : y = Alpha0 + Theta* d…
Population pyramid, graph hbar and blabelDear Stata users, I want to use graph hbar to draw a population pyramid. Regular procedure is to ge…
Staggered policy with boundary discontinuity designDear Statalists, Please, could anyone help me? I have a panel data set from 2001-2020, municipality …
Subscribe to:
Post Comments (Atom)
0 Response to reshape command
Post a Comment