Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: RE: foreach command


From   William Buchanan <william@williambuchanan.net>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: RE: foreach command
Date   Wed, 12 Dec 2012 16:37:25 -0800

Get rid of the single quotes in the -foreach- statement and use the left and right single quotes inside the loop.

HTH,
Billy

Sent from my iPhone

On Dec 12, 2012, at 16:26, megan rossi <megan_rossi@msn.com> wrote:

> Hi all,
> I am trying to use the loop function on a set of pre -existing variables 
> variable 1) total_IS_0
> variable 2) free_IS_0 
> Variable 3) total_PCS_0 
> Variable 4) free_PCS_0 
> My syntax is....
> foreach 'var' of varlist total_IS_0 free_IS_0 total_PCS_0 free_PCS_0 {
> summarize 'var'
> }
> I have stat 12 and it is coming up with r 198 invalid name... I am not sure what is wrong with my syntax? Also is there a way to incorporate this loop function with the drop down selections option or is it only avaliable with manual entry?
> Cheers,
> 
> PhD Candidate School of Medicine, University of Queensland
> Accredited Practicing Dietitian
> Princess Alexandra Hospital Nutrition & Dietetic Department
> m: 0402 931 441 | e: megan_rossi@msn.com
> "Let food be thy medicine and medicine be thy food." — Hippocrates (ca. 460 – 377 BC)
> ********************************************************************************
> This email, including any attachments sent with it, is confidential and for the sole use of the intended recipient(s). This confidentiality is not waived or lost, if you receive it and you are not the intended recipient(s), or if it is transmitted/received in error.
> Any unauthorised use, alteration, disclosure, distribution or review of this email is strictly prohibited. The information contained in this email, including any attachment sent with it, may be subject to a statutory duty of confidentiality if it relates to health service matters.
> **********************************************************************************
> ----------------------------------------
>> Date: Wed, 12 Dec 2012 18:25:34 -0500
>> Subject: Re: st: fixed effects quantile regression
>> From: jvverkuilen@gmail.com
>> To: statalist@hsphsun2.harvard.edu
>> 
>> On Wed, Dec 12, 2012 at 2:49 PM, Austin Nichols <austinnichols@gmail.com> wrote:
>>> JVerkuilen (Gmail) <jvverkuilen@gmail.com>:
>>> -suest- does not work with -qreg-.
>> 
>> :(
>> 
>> 
>> 
>>> Lisa Marie Yarnell <lisayarnell@yahoo.com>:
>>> On -qreg- with FE, there are many different forms, all interpreted differently.
>>> See e.g.
>>> http://www.rand.org/content/dam/rand/pubs/working_papers/2012/RAND_WR710-2.pdf
>>> for a good review of how people have tackled it.
>> 
>> That's a nice reference, thanks.
>> 
>> Jay
>> *
>> * For searches and help try:
>> * http://www.stata.com/help.cgi?search
>> * http://www.stata.com/support/faqs/resources/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/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index