# Re: AW: st: AW: Hello listers

 From Evans Jadotte To statalist@hsphsun2.harvard.edu Subject Re: AW: st: AW: Hello listers Date Tue, 13 Oct 2009 16:31:38 +0200

```Martin Weiss wrote:
```
<>
```-cumul- takes given values and forms the cumulative distribution function.
These values could be distributed according to any density. -normal- gives
you the cumulative of the normal, and -normalden- gives you the density
function of the normal.

*************
clear*
set obs 10000

gen x=-5+10*runiform()

gen z=normalden(x)
cumul z, gen(cumz)

```
line z x, sort name(den, replace) /* */ nodraw
```
gen y=rnormal()

cumul y, gen(cumy)

```
line cumy y, sort name(cumul, replace) /* */ nodraw
```
gr combine den cumul
*************

Note the -egen, std()- function for your standardization purposes (such as

HTH
Martin

-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Evans Jadotte
Gesendet: Dienstag, 13. Oktober 2009 16:01
An: statalist@hsphsun2.harvard.edu
Betreff: Re: st: AW: Hello listers

Martin Weiss wrote:
```
<>
```Not sure what "...cumulative standard normal distribution of a variable"
means, but maybe this will help:

*************
tw (function normal(x), range(-5 5))
*************

HTH
Martin

-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Evans Jadotte
Gesendet: Dienstag, 13. Oktober 2009 15:20
An: statalist@hsphsun2.harvard.edu
Betreff: st: Hello listers

Hi statalisters,

```
I have a very simple and maybe stupid question, hope someone can help. I am trying to get the correct syntax for /_normal_ /to get the cumulative standard normal distribution of a variable. Any help?
```
EJ
*
*   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/
```
```Thanks Martin,

```
Sorry for not being clear on this list. What I am trying to calculate is , cumulative density of the standard normal or the standard normal density, respectively. I was trying with
```
cumul x, gen(y)       // x = ((z-m)/sqrt(s))

```
but what I am getting is not consistent. By the way, does /cumul/ do the same job as normal(.) or normalden(.) in Stata?
```

EJ
*
*   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/
```
```Many thanks Martin!

```
Simple stuff can sometimes make one lose precious time when knowledge is lacking!
```
Evans
*
*   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/
```