Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Chris Parker <cparker.phd2007@london.edu> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: byable program speed performance on statamp |
Date | Fri, 6 May 2011 15:58:08 +0100 |
On re-reading, I think my question may be a bit vague. What I mean to say is will Stata run the program for multiple cropmarkets at the same time (similar to parfor in matlab)? Chris Chris Parker ________________________________ PhD Candidate | Management Science & Operations London Business School | Regent's Park | London NW1 4SA | United Kingdom Direct line +44 (0)20 7000 8816 | Email cparker.phd2007@london.edu On Fri, May 6, 2011 at 3:50 PM, Chris Parker <cparker.phd2007@london.edu> wrote: > > Hello, > > Sorry if this is an obvious question, but I have been looking online > with no luck. I am using StataMP/4 version 11.2. I have daily data for > crops and markets that I am trying to combine with data on individuals > who have subscribed to a price information service for that crop and > market. However both datasets are very large and even with 16GB of > memory I can't do a single joinby call. I therefore wrote a loop to > perform the joinby and process the data for each crop market and > create individual dta files which I will then append at the end (see > below). If I write this as a byable program and then execute it, will > I run on all 4 cores on my computer? > > levelsof cropmarket, local(levels) > > foreach tempArg of local levels { > preserve > keep if cropmarket ==`tempArg' > decode cropmarket, gen(cropmarketstr) > joinby cropmarketstr using subscriptiondata, unmatched(master) > drop cropmarketstr > > * Find out which subscriptions are active > gen active =cond((date>=startdate) & (date<=enddate),1,0) > > * find out how many active subscriptions there are > bysort crop market date: egen numsubscriptions= total(active) > > * Need to keep the active subscription data points plus one price > point with no active subscriptions > egen tag = tag(crop market date) > drop if (numsubscriptions==0)& missing(tag) > drop if (numsubscriptions>0)&(active==0) > > drop active tag startdate enddate subscriptionstate > > save t`tempArg' > > restore > } > > Thanks! > Chris > > > Chris Parker > > ________________________________ > > PhD Candidate | Management Science & Operations > London Business School | Regent's Park | London NW1 4SA | United Kingdom > Direct line +44 (0)20 7000 8816 | Email cparker.phd2007@london.edu > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ > > ______________________________________________________________________ > > This email has been scanned by the MessageLabs Email Security System > on behalf of the London Business School community. > For more information please visit http://www.messagelabs.com/email > ______________________________________________________________________ > > ______________________________________________________________________ > > This email has been scanned by the MessageLabs Email Security System > on behalf of the London Business School community. > For more information please visit http://www.messagelabs.com/email > ______________________________________________________________________ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/