# Re: st: RE: Re: Examining sampling distribution

 From Babak Oskooei <[email protected]> To [email protected] Subject Re: st: RE: Re: Examining sampling distribution Date Tue, 17 Nov 2009 05:48:46 -0800 (PST)

```Dear Nick,

Thanks for your email and help. I am following your first suggestion to get what I want. I am using gammaden function to draw the chi2 curve that I need since Stata does not have similar function for chi2 distribution, i.e. chi2den. I will let you know when I successfully completed the task.

Nick, I have a further question if you do not mind. I came across DPPLOT program written by you. Could you please let me know where I can obtain this from.

Kind regards

Babak

--- On Tue, 11/17/09, Nick Cox <[email protected]> wrote:

> From: Nick Cox <[email protected]>
> Subject: st: RE: Re: Examining sampling distribution
> To: [email protected]
> Date: Tuesday, November 17, 2009, 5:43 AM
> You could add the curve of a function
> by using -twoway function- in
> conjunction with your histogram command. If it's
> -histogram-, you do
> that via -addplot()-. If it's -twoway histogram-, you do
> that via
> superimposition using the () or || notation.
>
> But there is a much, much, much better way for you to
> proceed. -qchi-
> and -pchi- are built-in commands for your exact purpose
> that allow you
> to focus on the overall form of the distribution without
> any arbitrary
> decisions about bin width (or possibly origin, although
> that presumably
> is 0 in your case) and without the contortions of comparing
> bin heights
> with a nonlinear curve. You should compare plots with a
> portfolio of
> similar plots showing random draws from a chi-square(1).
>
> My prejudice is that a good or lousy fit will be
> self-evident on such
> plots. Otherwise, consider the usual menagerie of
> Kolmogorov-Smirnov,
> etc.
> The portfolio technique provides an informal test.
>
> Nick
> [email protected]
>
>
> Babak Oskooei
>
> I have a question with respect to examining the sampling
> distribution
> visually and using statistical tests. I have carried out
> simulations in
> Stata with 5,000 replicates and obtained the statistic of
> interest. The
> sampling distribution of this statistics should be
> distributed as
> Chi-squared with 1 df. I would like to test this visually
> and unsing
> ststistical tests.
>
> My question is how I can add a curve of Chi2 distribution
> with 1 df to
> the histogram of the sampling distribution of my statistic.
> I know that
> in many softwares this is possible but I do not know how to
> do this in
> Stata. I found many options like kdensity in the histogram
> command but
> not an option which fits a curve with a specific
> distribution to my
> histogram. Also, I would like to know the name of the
> command in Stata
> which I tests this statistically.
>
>
> *
> *   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/
```