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
Controlling for confounders in t-testsHi all, I'm a little stuck on a paper looking at differences in fasting glucose levels between diff…
Lags in time series with only trading daysHello together, for my thesis I have a dataset which contains stock prices over a period of 28 year…
Why are the arguments passed to my program through the syntax command not displaying per the STATA manual example?Please ignore this post …
Aggregating variablesGood day everyone, I am still an undergrad student so please excuse any elementary questions. I am…
Plot confidence interval for linear mixed modelHi, I'm running a linear mixed model, and am now trying to plot a fitted line with a 95% CI for thi…
Subscribe to:
Post Comments (Atom)
0 Response to reshape command
Post a Comment