Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: Calculating SD of a variable

 From Oliver Jones To statalist@hsphsun2.harvard.edu Subject Re: st: Calculating SD of a variable Date Fri, 20 May 2011 13:01:14 +0200

```Hi,
one question for you:
What is the standard deviation of the number 1.448922432?

This is what you are asking Stata do calculate!

Leave out the variable year in the by() option and that should do what
you want.

Best
Oliver

Am 20.05.2011 12:45, schrieb lreine ycenna:
```
```Hello,

I have a list of countries and their annual GDP growth rates. I need
to calculate the standard deviations of the growth rate. But I seem to
have done it wrong:

Using the command egen sd = sd(gdp) gives me the same number for the
entire column

Using egen sd= sd (gdp), by(countryno year) gives me missing values.

Am I missing something?

My panel data looks like this:

countryno  year         gdp
122	1995	1.448922432
122	1996	1.802327838
122	1997	1.939189289
122	1998	3.486108757
122	1999	3.057156394
122	2000	3.403232592
122	2001	0.706544087
122	2002	0.572674299
122	2003	0.806288363
122	2004	2.143516615
122	2005	2.0000
122	2006	3.021230987
124	1970	6.058892112
124	1971	3.1155209
124	1972	4.699826137
124	1973	6.212549621
124	1974	4.21133101
124	1975	-2.174872486
124	1976	5.612220928
124	1977	0.585991929
124	1978	2.844723097
etc..
*
*   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/
```
```
--
Universität Bielefeld
Fakultät für Wirtschaftswissenschaften
Lehrstuhl für Ökonometrie und Statistik
- -
Bielefeld University
Chair of Econometrics and Statistics
- -
Raum / room:  V9-110
Tel / phone:  +49 (0)521 106 4871
---
*
*   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/
```