# st: graph twoway function

 From BISSERY Alvine To statalist@hsphsun2.harvard.edu Subject st: graph twoway function Date Thu, 29 Jan 2004 16:07:26 +0100

```Dear all,

I try to graph a function (y=exp(1.84*ln(x) - 0.579)).

I would like to specify the range of xscale and yscale.

I can specify xscale with the syntax:

twoway function f(x)=exp(1.84*ln(x) - 0.579) , range(20 70)

but I didn' t find how specify the range of yscale.
Is it possible to graph this function only on range (0 1) for y axis ?

Thank you

Alvine

-----Message d'origine-----
De: Stephen P Jenkins [mailto:stephenj@essex.ac.uk]
Date: jeudi 29 janvier 2004 09:58
À: statalist@hsphsun2.harvard.edu
Objet: st: RE: mean of variable

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of
> aschaefer@diw.de
> Sent: 29 January 2004 08:46
> To: statalist@hsphsun2.harvard.edu
> Subject: st: mean of variable
>
>
> Hi All,
>
> I try to generate a new variable out of the mean of another
> variable (for each person)! Is there an easy way to solve
> this problem?

Example:

Suppose you have data for individuals, and also know which household
they belong to, and the age of each person in the household. You want to
attribute to each person the mean age among the individuals of the
household to which he belongs.
by hh_id: egen mean_age = mean(age)

More generally, look through -egen- in the manual; read about "by group"
operations in the User Guide, and also look through the Stata FAQs

Stephen
-------------------------------------------------------------
Professor Stephen P. Jenkins <stephenj@essex.ac.uk>
Institute for Social and Economic Research
University of Essex, Colchester CO4 3SQ, U.K.
Tel: +44 1206 873374.  Fax: +44 1206 873151.
http://www.iser.essex.ac.uk

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```