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
Running regressions with an index I createdHi all, I am running a regression on the impact of freedom in a country on socioeconomic developmen…
Importing delimited csv with special characters including double quotesI am trying to import a large comma-delimited csv (~1M rows). Variables are bound by double quotes b…
gender changes in the panel surveyDear Statalist Community, due to my thesis I am allowed to work with stata. My dataset comes from a…
Transfering Kendal correlations into WordDear all contributors, I am calculating Kendal correlations of more than 100 variable couples and w…
Generating new columns for each unique value of a categorical variableDear All, The issue I am trying to resolve here is as follows- I have a dataset where customers pur…
Subscribe to:
Post Comments (Atom)
0 Response to reshape command
Post a Comment