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

From |
"Martin Weiss" <martin.weiss1@gmx.de> |

To |
<statalist@hsphsun2.harvard.edu> |

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

Date |
Wed, 11 Feb 2009 14:36:11 +0100 |

<> Try http://www.stata.com/support/faqs/data/missing.html http://www.stata.com/support/faqs/data/dropmiss.html HTH Martin -----Ursprüngliche Nachricht----- Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Tanveer Shehzad Gesendet: Mittwoch, 11. Februar 2009 14:22 An: statalist@hsphsun2.harvard.edu Betreff: Re: st: Fixing the value in egen command 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/ * * 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/

**References**:**Re: st: Fixing the value in egen command***From:*Tanveer Shehzad <C.T.Shehzad@rug.nl>

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

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