Biostatistics and Computer Applications - PowerPoint PPT Presentation

1 / 49
About This Presentation
Title:

Biostatistics and Computer Applications

Description:

PROBIT(p) 43. Sampling distribution of mean. Data sample_mean; miu ... normal=probit(p); t=tinv(p,df); chi_square=CINV(p,df); f=FINV(p,df1,df2); output; end; ... – PowerPoint PPT presentation

Number of Views:524
Avg rating:3.0/5.0
Slides: 50
Provided by: dafen
Category:

less

Transcript and Presenter's Notes

Title: Biostatistics and Computer Applications


1
Biostatistics and Computer Applications
Sampling mean Difference between means Students
t distribution Chi-square distribution F
distribution SAS programming 12/30/02
2
Recap (Probability and variable distribution)
  • Event and probability P(E)n/N (n is large)
  • Additive rule and multiplication rule
  • Binomial distribution
  • Poisson distribution
  • Normal distribution

3
Binomial Distribution
Poisson Distribution
4
Normal Distribution
5
Standard Normal Distribution
In general, 68.26 of data within ?1? of ?,
95.45 of data within ?2? of ?, 99.73
of data within ?3? of ?, 95 ?
?1.96? 99 ? ?2.58?
0.025
0.025
6
Distribution of the Sample Mean
Parameters are constant Statistics are
variable This is a critically important
concept!!!
Population N (?, )
sample of size n
sample of size n
n
n
n
Mathematical derive or Sampling
?
7
Random Samples
  • Infer the characteristics of a population from a
    representative sample
  • Usual strategy is through a random sample
  • Random sample
  • Each object has a equal probability of being
    selected as a random number
  • Two methods
  • Exhaustive (all possible) sampling from a small
    population (Nn) (Lecture).
  • Large number of sampling from a infinite
    population (SAS program).

8
Sampling Distributions
  • Definition
  • Distribution of all possible values that can be
    assumed by some statistic, computed from samples
    of the same size randomly drawn from the same
    population, called the sampling distribution of
    that statistic
  • Statistic Mean, difference between two means,
    variance etc.

9
Sampling Distributions
  • Construction
  • From a finite population of size N, randomly draw
    all possible samples of size n (total number of
    sample Nn).
  • Compute the statistic of interest for each sample
    (mean, standard deviation)
  • Investigate the distribution of that statistic
    and relate it to the population parameter.

10
Sampling Distribution of mean
  • Example An approximately normal distributed
    population with N4, Xi2,3,3,4
  • n2, independent random sampling,
  • Total sample is Nn42 16.

11
Sampling Distribution of mean
Mean of sampling statistics
Unbiased estimate
12
Sampling Distribution of mean
Frequency distribution of sample means
If we draw n4, then total sampling is 44 256
13
Distribution of Sample Mean
  • 1. Mean of sampling distribution of mean has same
    mean as original population
  • 2. Variance of sampling distribution of mean is
    the population variance divided by sample size
  • and
  • called standard error of mean. A measure of
    sampling error of x-bar, and decrease as n
    increase.

14
Distribution of Sample Mean
  • 3. If , then
  • 4. Given a population of unknown distribution or
    nonnormal distribution with a mean and
    variance , the sampling distribution of

    will be approximately normally distributed
    with a mean of and variance of
    when n is large (Central limit theorem).

15
Implications of Central Limit Theorem
  • Assured of approximately normal sampling
    distribution
  • Normally distributed population
  • Nonnormal population with large sample size
  • Population with unknown functional form with
    large sample size
  • How large is large for sample size?
  • at least 30, but as many as practical (20 may be
    ok if not much skewed)

16
Application of sample distribution
  • Example 1. Suppose we have a normal population
    with mean12.5 year and variance 0.78 year2.
    If we draw a random sample with n10 and, whats
    the probability the sample mean is large than
    14.7 year?

17
Application of sample distribution
  • Example 2. Cotton, fiber length (mm),
    . Whats the
    probability if we draw an sample with n4, the
    difference between sample mean and population
    mean is larger than 0.5 mm? What if n25?
  • If n25,

18
Distribution of the Sample Mean
Another example Suppose that for Oklahoma sixth
grade students the mean number of missed school
days is 5.4 days with a standard deviation of 2.8
days. What is the probability that a random
sample of size 49 will have a mean number of
missed days greater than 6 days? Find the
probability that a random sample of size 49 from
this population will have a mean greater than 6
days. ? 5.4 days ? 2.8 days n 49
19
Distribution of the Sample Mean
Sampling distribution of (for samples of
size 49)
Population distribution of individual Xs
0.0668
What is the probability that a random sample
(size 49) from this population has a mean between
4 and 6 days? Check that .
20
Sampling Distributions of
n2
21
Sampling Distributions of
22
Distribution of
  • 1.
  • 2.
  • and
  • called standard error of the difference
    between two means.

23
Distribution of
  • 3. If and
    , then

24
Summary
25
Students t-distribution
What happen if s is unknown? is normally
distributed, is not (quite)!
W.S. Gosset worked for Guinness Brewing in
Dublin, IR. He was forced to publish under the
pseudonym Student. In 1908 he derived the
distribution of which is now known as
Students t-distribution.
26
Normal distribution and t distributions
When ? is unknown we replace it with the
estimate, s. The statistic has a t-distribution
with n-1 degrees of freedom.
27
Students t Distribution
Cumulative function F(t) Right tail
probability Two tails probability (t
symmetrical distribution) Students
t-distribution table (two sides, selected t for
certain probabilities 0.05, 0.01)
28
Students t distribution table
29
Distribution of sample variance
  • Same method for sample mean
  • N4, Xi2,3,3,4 n2 and n4 sampling

30
Distribution of sample variance
  • Left skewed distribution, not z or t distribution
  • Central Limit Theorem For a normal distributed
    population, when ngt100, the distribution of
    sample standard deviation s is approximately
    normal distributed with a mean and standard
    deviation of s
  • Standard error of sample standard deviation

31
Chi-square distribution
  • Definition (population)
  • Sample

32
Chi-square distribution
  • Probability density function
  • Cumulative function
  • Right side (tail) probability

2
33
Properties of the Chi-Square Distribution
  • 1.      The distribution is not symmetric,
    (as the df increases, the distribution becomes
    more symmetric) 
  • 2.      All values are gt 0 (positive) 
  • 3.      The distribution is different for
    each df (df n-1). As df (dfgt30) increases, the
    distribution approaches a Normal distribution.

34
Example
  • A normal distributed population with variance 2,
    please calculate if n5, the probability that
    and the probability that

35
Chi-square table
36
F distribution
  • Draw two independent random samples from a normal
    distribution with variance
  • Definition

37
F distribution
  • Probability density function
  • Cumulative function
  • Right tail probability

38
F distribution table
  • Only F values for P0.95, 0.99 etc.
  • Two degree of freedom (df1, df2)
  • Right side (tail) probability, arranged for
    P(FgtFi)0.05 or 0.01, denote as F0.05 and F0.01.

39
F distribution table
40
F distribution table
41
SAS programming
  • Distribution of the sample mean
  • Distribution of the difference of two means
  • Students t distribution
  • Chi-square distribution
  • F distribution

42
SAS functions for sampling distribution
  • Useage xfunction_name(arguments)
  • Probability and density function
  • PROBT(x,df lt,ncgt) probability of t
    distribution
  • PROBCHI(x,df) Chi-square
  • PROBF(x,ndf,ddflt,ncgt) F distribution
  • Quantile function
  • CINV(p,dflt,ncgt)
  • FINV(p,ndf,ddflt,ncgt)
  • TINV(p,dflt,ncgt)
  • PROBIT(p)

43
Sampling distribution of mean
  • Data sample_mean
  • miu100
  • sigma10
  • do k1 to 1000
  • do i1 to 100 by .5
  • zrannor(0)
  • xmiuzsigma
  • output
  • end
  • end
  • proc sort
  • by k
  • Proc means noprint
  • var x
  • by k
  • output outmean_sample meansample_mean
  • run
  • proc print datamean_sample
  • run
  • proc univariate datamean_sample
  • var sample_mean
  • run

44
Sampling distribution of difference between two
means (1/3)
  • / This program draw two samples from two normal
    distributions and shows the distribution of
    difference between sample means /
  • Data sample_mean
  • miu1100 sigma110
  • miu2200 sigma210
  • do k1 to 1000
  • do i1 to 100 by .5
  • z1rannor(0) z2rannor(0)
  • x1miu1z1sigma1 x2miu2z2sigma2
  • output end end

45
Sampling distribution of difference between two
means (2/3)
  • proc sort
  • by k
  • Proc means noprint
  • var x1 x2 by k
  • output outtwo_means meanmean1 mean2
  • run
  • data dmeans
  • set two_means
  • dmeanmean1-mean2
  • run

46
Sampling distribution of difference between two
means (3/3)
  • proc print datadmeans
  • run
  • proc univariate datadmeans
  • var mean1 mean2 dmean
  • run

47
SAS program (t distribution)
  • options nodate
  • data tdistribution
  • df15
  • do i-5 to 5 by .1
  • prob_zprobnorm(i)
  • prob_tprobt(i,df)
  • output
  • end
  • proc print
  • var i prob_z prob_t df
  • proc plot
  • plot prob_zi prob_ti
  • run

48
SAS program (Chi-square and F distributions)
  • data distribution
  • df15 df15 df220
  • do i0 to 50 by .5
  • prob_chi2probchi(i,df)
  • prob_fprobf(i,df1,df2)
  • output
  • end
  • proc print
  • var i prob_chi2 prob_f df df1 df2
  • proc plot
  • plot prob_chi2i prob_fi
  • run

49
SAS program (distribution table)
  • data sampling
  • df30 df15 df210
  • do p0 to 1 by 0.01
  • normalprobit(p)
  • ttinv(p,df)
  • chi_squareCINV(p,df)
  • fFINV(p,df1,df2)
  • output
  • end
  • proc print
  • var normal t chi_square f p df df1 df2
  • run
  • proc plot
  • plot pnormal pt pchi_square pf
  • run
  • quit
Write a Comment
User Comments (0)
About PowerShow.com