Topic 18: Learning About a Mean Using Discrete Models
Minitab Local Macro m_disc
Computes
the posterior distribution for a mean M using a discrete set of models
(sampling standard deviation h known).
TO RUN:
Name two
Minitab columns 'm' and 'prior'. Place
the values of the mean M in 'm' and the prior probabilities in 'prior'. In the college student study on page 426,
the following values of M and prior probabilities were used:
Row m prior
1 6.0 0.0625
2 6.1 0.0625
3 6.2 0.0625
4 6.3 0.0625
5 6.4 0.0625
6 6.5 0.0625
7 6.6 0.0625
8 6.7 0.0625
9 6.8 0.0625
10 6.9 0.0625
11 7.0 0.0625
12 7.1 0.0625
13 7.2 0.0625
14 7.3 0.0625
15 7.4 0.0625
16 7.5 0.0625
Place the
data in a column named 'data'. and
suppose that the standard deviation is .5.
In this example 'data' contains the sleeping times for 28 students:
MTB > prin 'data'
data
8.0 6.0 6.5
7.0 7.0 6.5
6.5 6.0 7.0
7.0
6.0 6.0 7.5
6.0 7.0 7.0
6.5 6.0 6.5
6.5
9.0 9.0 7.0
5.0 8.0 6.5
6.0 6.0
To compute
the posterior probabilities for M, type the following command in the Minitab
Session Window. A graph of the prior,
likelihood and posterior probabilities is also created.
MTB > %m_disc 'm' 'prior' .5 'data';
SUBC> plot.

PRIOR AND POSTERIOR DENSITIES OF M:
Row M PRIOR LIKE
PRODUCT POSTR
1 6.0 0.0625 0 0.0 0.000000
2 6.1 0.0625 0 0.0 0.000000
3 6.2 0.0625 0 0.0 0.000000
4 6.3 0.0625 14 0.9 0.000005
5 6.4 0.0625 1207 75.4 0.000443
6 6.5 0.0625
34735 2171.0 0.012749
7 6.6 0.0625
326280 20392.5 0.119759
8 6.7 0.0625
1000000 62500.0 0.367044
9 6.8 0.0625
1000000 62500.0 0.367044
10 6.9 0.0625
326280 20392.5 0.119759
11 7.0 0.0625
34735 2171.0 0.012749
12 7.1 0.0625 1207 75.4 0.000443
13 7.2 0.0625 14 0.9 0.000005
14 7.3 0.0625 0 0.0 0.000000
15 7.4 0.0625 0 0.0 0.000000
16 7.5 0.0625 0 0.0 0.000000
PRIOR MEAN OF M:
MEAN 6.75000
POSTERIOR MEAN OF M:
MEAN 6.75000
Other subcommands:
The full macro command is
%m_disc
M1 PRI PS DATA;
summ;
store pos;
plot.
Use the 'summ' subcommand when the data vector 'data' contains the mean x and the sample size n.
The 'store' subcommand stores the posterior probabilities in the column 'pos'.