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

From |
Tanveer Shehzad <C.T.Shehzad@rug.nl> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Fixing the value in egen command |

Date |
Wed, 11 Feb 2009 14:21:53 +0100 |

Dear Statalisters: Some time back, I asked in a panel data if I want to generate a variable which takes the value equal to the mean of GDP I use the command by country year, sort : egen float abxx = mean(GDP) I wanted to make another variable that contains initial value of GDP fixed (for all years) equal to e.g. value of GDP in year 1885 corresponding to each country. The solution for this modification suggested by Maarten and Blasnik worked well for the problem. Now I face a a bit different but related problem. If e.g. the value of 1885 (as in the above question) is missing for one country then it will take the initial value equal to zero for all other years. Now my problem is: I have something like 10,000 banks and I need to take their initial level of assets (the first available value and not corresponding to a fixed year). Could their be any solution? I would be really thankful for the solution. Best regards, Tanveer Maarten buis wrote: > --- Choudry T Shehzad <C.T.Shehzad@rug.nl> wrote: > >> Now I want to make another variable that contains initial value of >> GDP fixed (for all years) equal to e.g. value of GDP in year 1885 >> corresponding to each country. >> > > bys country (year): gen initgdp = gdp[_n==1] > bys country (year): replace initgdp = sum(initgdp) > > Hope this helps, > Maarten > > > ----------------------------------------- > Maarten L. Buis > Department of Social Research Methodology > Vrije Universiteit Amsterdam > Boelelaan 1081 > 1081 HV Amsterdam > The Netherlands > > visiting address: > Buitenveldertselaan 3 (Metropolitan), room N515 > > +31 20 5986715 > > http://home.fsw.vu.nl/m.buis/ > ----------------------------------------- > > > > * > * 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/ > -- Choudhry Tanveer Shehzad (Tanveer) PhD Student Department of Finance, Faculty of Economics & Business, University of Groningen, Nettelbosje 2 9747 AE Groningen The Netherlands Mobile: 0031-644801970 Home Page: http://www.rug.nl/staff/c.t.shehzad/ * * 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: Fixing the value in egen command***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**AW: st: Fixing the value in egen command***From:*"Martin Weiss" <martin.weiss1@gmx.de>

- Prev by Date:
**st: How does -kwallis2- compute adjusted p-values for significance?** - Next by Date:
**AW: st: Fixing the value in egen command** - Previous by thread:
**st: Common legend with -graph combine-** - Next by thread:
**AW: st: Fixing the value in egen command** - Index(es):

© Copyright 1996–2016 StataCorp LP | Terms of use | Privacy | Contact us | What's new | Site index |