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
 analysing categorical data with very high of outcome of interestHello to all.
we are looking at possibilities for further analysis of knowledge of Family planning (… analysing categorical data with very high of outcome of interestHello to all.
we are looking at possibilities for further analysis of knowledge of Family planning (…
 Eigenvectors in Stata (mata) vs. MatlabHi everyone,
maybe this is a very silly question and I am overlooking something very, very obvious. … Eigenvectors in Stata (mata) vs. MatlabHi everyone,
maybe this is a very silly question and I am overlooking something very, very obvious. …
 What causes the following error: data not spset r(459);copy http://www.stata-press.com/data/r15/homicide1990.dta ., replace
copy http://www.stata-press.com… What causes the following error: data not spset r(459);copy http://www.stata-press.com/data/r15/homicide1990.dta ., replace
copy http://www.stata-press.com…
 Reclink not returning any matchesI'm attempting to merge two datasets together using reclink, but I'm not understanding exactly why I… Reclink not returning any matchesI'm attempting to merge two datasets together using reclink, but I'm not understanding exactly why I…
 Expanding an observation to various rowsHi,
I have a data set of a household survey with hhcode denoting the household code and migrant den… Expanding an observation to various rowsHi,
I have a data set of a household survey with hhcode denoting the household code and migrant den…
Subscribe to:
Post Comments (Atom)
0 Response to reshape command
Post a Comment