EXERCISE 2 ON HOMEWORK Suppose there are 100 undergraduate math education majors at BGSU. You are interested in the number theta that are interested in going to graduate school in mathematics. You plan on learning about theta by taking a survey of 20 math ed majors selected at random. MTB > # my prior probabilities for theta in the MTB > # sets [0, 5], [6, 10], [11, 20], [21, 100] are MTB > # .3 .4 .25 .05 MTB > MTB > # to obtain a simulated sample from this prior: MTB > # - I first simulate the intervals (1,2,3,4) MTB > MTB > set c1 DATA> 1:4 DATA> set c2 DATA> .3 .4 .25 .05 DATA> rand 1000 c3; SUBC> discrete c1 c2. MTB > MTB > # next I simulate uniform values of theta in first interval MTB > # put the results in c11, uniform values in second interval, MTB > # put the results in c12, and so on. MTB > MTB > rand 1000 c11; SUBC> integer 0 5. MTB > rand 1000 c12; SUBC> integer 6 10. MTB > rand 1000 c13; SUBC> integer 11 20. MTB > rand 1000 c14; SUBC> integer 21 100. MTB > MTB > # finally, I put everything together using a let statement MTB > MTB > name c4 'prior_s' MTB > let 'prior_s'=c11*(c3=1)+c12*(c3=2)+c13*(c3=3)+c14*(c3=4) MTB > MTB > # now I have to tell you the data MTB > # 20 of the 100 students were randomly selected -- 2 expressed MTB > # interest in math MTB > MTB > # I update my probabilities using the program 'mod_cont' MTB > MTB > exec 'mod_cont' INPUT THE NUMBER OF THE LIKELIHOOD: (1-Binomial P, 2-Normal M, 3-Poisson L, 4-Hypergeometric S, 5-Discrete Uniform N, 6-Capture/Recapture N, 7-Exponential M) DATA> 4 INPUT (population size, sample size, number of successes) DATA> 100 20 2 Input number of simulated values: DATA> 1000 Each dot represents 11 points . ..: ::: :.::: ::::: .:::::..: : ::::::::::: :::::::::::. .. ........ ........ ... .... .... . +---------+---------+---------+---------+---------+-------prior_s Each dot represents 19 points . : : ::: ::: ::: .::::::.. .:::::::::. +---------+---------+---------+---------+---------+-------POST_S 0 20 40 60 80 100