Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

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

From |
Thomas <tpt21@cam.ac.uk> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: variable naming problem |

Date |
Mon, 06 Sep 2010 15:39:45 +0100 |

The first loop generate various scaled mean values.

Any ideas how I can get around this? ________________ foreach var of varlist yU yD{ sum `var' if e(sample) local m`var' = `r(mean)' local m25`var' = 0.25*`r(mean)' local m50`var' = 0.5*`r(mean)' local m75`var' = 0.75*`r(mean)' local m2`var' = 2*`r(mean)' local m3`var' = 3*`r(mean)' local m4`var' = 4*`r(mean)' } foreach i in `myU' `m25yU' `m50yU'{ foreach p in `myD' `m25yD' `m50yD'{ gen c`i'_`p' = _b[_cons]+_b[yU]*(`i')+_b[yU2]*((`i')^2/2) /// +_b[yD]*(`p')+_b[yD2]*((`p')^2/2) if e(sample) } } ____________________ Thanks, Thomas * * 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**:**st: RE: variable naming problem***From:*Nick Cox <n.j.cox@durham.ac.uk>

- Prev by Date:
**Re: st:Testing dependence in a 2x2 table for clustered observations** - Next by Date:
**st: RE: variable naming problem** - Previous by thread:
**RE: st: RE: Testing dependence in a 2x2 table for clustered observations** - Next by thread:
**st: RE: variable naming problem** - Index(es):