<< Chapter < Page Chapter >> Page >

The principal feature of the m-procedure odds is the scheme for selecting the numbers from the A and B matrices. If E = [ y y n y u u n n y y ] , then the coding translates this into the actual numerical matrix

[ 1 1 2 1 3 3 2 2 1 1 ] used internally. Then A ( : , E ) is a matrix with columns corresponding to elements of E . Thus

e = A(:,E) e =   42    42    22    42     5     5    22    22    42    42      34    34    27    34     8     8    27    27    34    34       15    15    45    15     9     9    45    45    15    15      19    19    44    19     6     6    44    44    19    19       22    22    43    22     4     4    43    43    22    22      41    41    13    41    15    15    13    13    41    41        9     9    52     9     8     8    52    52     9     9      40    40    26    40     3     3    26    26    40    40       48    48    12    48     9     9    12    12    48    48      20    20    37    20    12    12    37    37    20    20

The i th entry on the i th column is the count corresponding to the answer to the i th question. For example, the answer to the third question is N (no), and the corresponding count is the third entry in the N (second) column of A . The element on the diagonal in the third column of A ( : , E ) is the third element in that column, and hence the desired third entry of the N column. Bypicking out the elements on the diagonal by the command diag(A(:,E)), we have the desired set of counts corresponding to the profile. The same is true for diag(B(:,E)).

Sometimes the data are given in terms of conditional probabilities and probabilities. A slight modification of the procedure handles thiscase. For purposes of comparison, we convert the problem above to this form by converting the counts in matrices A and B to conditional probabilities. We do this by dividing by the total count in each group (69 and 56 in this case). Also, P ( G 1 ) = 69 / 125 = 0 . 552 and P ( G 2 ) = 56 / 125 = 0 . 448 .

GROUP 1 P ( G 1 ) = 69 / 125 GROUP 2 P ( G 2 ) = 56 / 125
Q Yes No Unc. Yes No Unc.
1 0.6087 0.3188 0.0725 0.3571 0.5536 0.0893
2 0.4928 0.3913 0.1159 0.2857 0.6607 0.0536
3 0.2174 0.6522 0.1304 0.5893 0.3393 0.0714
4 0.2754 0.6376 0.0870 0.5536 0.3214 0.1250
5 0.3188 0.6232 0.0580 0.4107 0.5000 0.0893
6 0.5942 0.1884 0.2174 0.2500 0.6607 0.0893
7 0.1304 0.7536 0.1160 0.5536 0.3036 0.1428
8 0.5797 0.3768 0.0435 0.2321 0.6786 0.0893
9 0.6957 0.1739 0.1304 0.4821 0.4286 0.0893
10 0.2899 0.5362 0.1739 0.6250 0.2857 0.0893

These data are in an m-file oddsp4.m . The modified setup m-procedure oddsdp uses the conditional probabilities, then calls for the m-procedure odds.

Calculation using conditional probability data

oddsp4                 % Call for converted data (probabilities) oddsdp                 % Setup m-procedure for probabilitiesEnter conditional probabilities for Group 1  A Enter conditional probabilities for Group 2  BProbability p1 individual is from Group 1  0.552  Number of questions = 10 Answers per question = 3  Enter code for answers and call for procedure "odds"y = 1; n = 2;u = 3; oddsEnter profile matrix E  [y n y n y u n u y u] Odds favoring Group 1:  5.845Classify in Group 1

The slight discrepancy in the odds favoring Group 1 (5.8454 compared with 5.8452) can be attributed to rounding of the conditional probabilities to four places. Thepresentation above rounds the results to 5.845 in each case, so the discrepancy is not apparent. This is quite acceptable, since the discrepancy has no effect on the results.

Got questions? Get instant answers now!

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Applied probability. OpenStax CNX. Aug 31, 2009 Download for free at http://cnx.org/content/col10708/1.6
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Applied probability' conversation and receive update notifications?

Ask