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
Sample selection in the control function approachI am trying to understand what sample it is correct to use when estimating the models using the cont…
Subpop MLM: Xtmixed Hi all, I am running a multi-level modeling using complex survey data, which used a stratified, clu…
lower what does mean?hi friends. please help me to understand this code. what does mean lower? gen cityname2=lower(cityof…
Can't open miest.sterDear Statalist, I am trying do run a Cox regression on an imputed dataset using restricted cubic sp…
How to compare prognostic models with a survivaldecision curve analysis for survival outcomes?Hello, i am currently using the dca (stdca) command in stata 14.0 I research a dataset of patients w…
Subscribe to:
Post Comments (Atom)
0 Response to reshape command
Post a Comment