STAT 13

(Sec. 1a-1c)

Introduction to Statistical Methods for the Life and Health Sciences

Instructor: Ivo Dinov, Asst. Prof.

Departments of Statistics & Neurology
    http://www.stat.ucla.edu/~dinov/


Lab 3

Also see this for an additional tutorial.

Thursday, Oct. 18, 2001


This lab involves random number generation. It is meant to give you a feel for the binomial distribution.

First, obtain the probability distribution (by hand, not from the table) for a binomial random variable X with n = 10 and p = 0.3. That is, for each possible value x of X, find P(X = x).

Now, set the seed to your 9-digit student id number :

set seed your_id

Generate 1000 observations of a binomial (n = 10, p = 0.3) random variable with the Stata command:

rndbin 1000 0.3 10

This command produces a variable called xb. Make a histogram of the distribution with graph xb. How well does the observed distribution match what you expect? (You have already figured out what you expect the distribution to look like.)

Get summary statistics for the observations (using summarize or summarize, detail). What values do you expect for the mean and SD? Are the summary statistics close to the expected values?


You may want to try some additional examples.
And compare your work to the template solution (this is not a unique solution, just a template)
\Ivo D. Dinov, Ph.D., Departments of Statistics and Neurology, UCLA School of Medicine/