Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Alex Olssen <alex.olssen@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Can -bootstrap- handle vectors |
Date | Mon, 15 Aug 2011 08:51:01 +1200 |
Ah, thanks a lot Jorge. I had searched Statalist quickly. As well as answering my question you have re-alerted me to an importan resource. Cheers, Alex 2011/8/15 Jorge Eduardo Pérez Pérez <perez.jorge@ur.edu.co>: > This is in the FAQs > > http://www.stata.com/support/faqs/stat/bs_b_trick.html > > ______________________ > Jorge Eduardo Pérez Pérez > > > > On Sat, Aug 13, 2011 at 9:28 AM, Matthew White > <mwhite@poverty-action.org> wrote: >> >> Good point... But you'll have to be careful when using -st_local()-. >> st_local("test", 1) fails, so you'll have to execute st_local("test", >> "1"). But once you have local test in Stata, you can use it as a >> numeric fine. In my example before, you could execute something like >> st_local("rows", strofreal(rows(X)). Probably better than messing with >> scalars... >> >> On Sat, Aug 13, 2011 at 4:13 PM, Nick Cox <njcoxstata@gmail.com> wrote: >> > A side issue: The distinction between numeric and string does not bite here >> > for returning macros to Stata. >> > >> > A local macro is a place for holding character strings, which can be numeric >> > characters. Thus -st_local()- will work fine regardless of content. >> > >> > Nick >> > >> > On 13 Aug 2011, at 10:12, Matthew White <mwhite@poverty-action.org> wrote: >> > >> >> I don't know of a way to use Mata to put numeric values in a local. >> >> st_local only works with string values, I think. But you could return >> >> each element of a Mata vector to separate Stata scalars. Say X is a >> >> Mata column vector: >> >> mata: st_numscalar("r(rows)", rows(X)) >> >> forvalues row = 1/`r(rows)' { >> >> mata: st_numscalar("r(v`row')", X[`row', >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> > * >> > * 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/ >> > >> >> >> >> -- >> Matthew White >> Evaluation Coordinator >> Urban Micro-Insurance Project >> Innovations for Poverty Action >> >> +254 (0)701 025 276 >> mwhite@poverty-action.org >> >> * >> * 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/ >> >> > > > * > * 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/ > * * 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/