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]

From |
Fabien Bertho <fabien.bertho@sciences-po.org> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: A loop for each couple of variables (instead of for each variable) |

Date |
Mon, 12 Sep 2011 12:53:40 +0200 (CEST) |

Hi, I created a loop in order to estimate various specifications of my model foreach variables in ""var_1 var_2 { reg dep_var control_var `variables’ } Now, I would like to run this loop not for two variables but for two locals that comprises two variables. I tried the following code. local local_1 “var_1 var_2” local local_2 “var_3 var_4” foreach local_variables in ""`local_1’ ` var_2’ { reg dep_var control_var `local_variables’ } But it does not work because during the loop Stata splits my local into two variables… Do you think that it is possible to estimate a loop for each couple of variables instead of for each variable? How can I do this? Thank you. Fabien -------------------------------------------------------------------------- Tous les courriers électroniques émis depuis la messagerie de Sciences Po doivent respecter des conditions d'usages. Pour les consulter rendez-vous sur http://www.ressources-numeriques.sciences-po.fr/confidentialite_courriel.htm * * 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/

**Follow-Ups**:**Re: st: A loop for each couple of variables (instead of for each variable)***From:*Maarten Buis <maartenlbuis@gmail.com>

**Re: st: A loop for each couple of variables (instead of for each variable)***From:*Nick Cox <njcoxstata@gmail.com>

- Prev by Date:
**Re: st: Trends and Time dummies** - Next by Date:
**Re: st: Problems with copying a file from the Internet.** - Previous by thread:
**st: Problems with copying a file from the Internet.** - Next by thread:
**Re: st: A loop for each couple of variables (instead of for each variable)** - Index(es):