Date: Wed, 11 Feb 2004 09:35:24 -0800 Dale McLerran "SAS(r) Discussion" Dale McLerran Re: statistical analysis problem To: conjecture <3lhk20po17tr5hol4dl7pennpr3f5lck5f@4ax.com> text/plain; charset=us-ascii

Chris,

For the table you presented, the overall odds of being in group A are

P(G=A)/P(G=B) = P(G=A)/(1-P(G=A))

We can estimate the probability of being in group A as 1700/3950. Conversely, we estimate the probability of being in group B as 2250/3950. Thus, an estimate of the odds of being in group A is (1700/3950) / (2250/3950) = 1700/2250.

Now, if the probability of being in group A is the same for all occupations, then the odds of being in group A would also be the same for all occupations. We can construct the odds of membership in group A conditional on each occupation. Estimates of the odds of being in group A given each occupation are

Odds of A | occup=Police = 1000/1500 Odds of A | occup=Cook = 200/150 Odds of A | occup=Accountant = 500/600

Since the odds of membership in group A given occupation are a monotonic function of the probability of membership in group A given occupation, a test which compares the odds is asymptotically the same as a test that the probability of membership in group A is the same for each occupation. That is, since the odds increase with increased probability, any test about the odds would also be a test that the probabilities are the same in all groups if we have a large sample size.

An odds ratio is defined as the ratio of two odds. If the probability of membership in group A are the same for each occupation, then the odds of membership in group A are the same for each occupation. Now, we define the odds ratio as the ratio of two odds. The odds for membership in group A given occupation=Police relative to the odds for membership in group A given occupation=Accountant (the odds ratio for Police with reference occupation Accountant) is estimated as

OR(group=A|occup=Police vs Accountant) = (1500/2500)/(500/600)

This odds ratio will be 1 if the odds are the same for both occupations. The log-odds ratio will be 0. Logistic regression forms tests about the log-odds ratios. If the log-odds ratios are all zero, then there is no difference in the probability that group membership is in A across the different occupations. The Type III Analysis of Effects table provides a test that all independent odds ratios which can be formed for the variable occupation are zero. You will notice that the Type III test for occupation is approximately the same as the Chi-square test of independence given by Proc Freq. (It does not have exactly the same value. The magnitude of the difference between the two statistics should shrink to zero as the sample size increases to infinity.) The contrasts examine where the odds differ by occupation. Once again, differing odds can be interpreted as differing probabilities.

Dale

--- conjecture <chris.chan@WEBMININGPRO.COM> wrote: > Dale, > > I heard odd ratio of logistic regression but I don't know the idea > behind. Is it similar to what try to do?? What is the information the > logistic regression captured but not in the method I tried? > > Thanks > On 9 Feb 04 17:54:51 GMT, stringplayer_2@YAHOO.COM (Dale McLerran) > wrote: > > >Chris, > > > >If you want to see which occupations differ considerably by group, > >I would fit a logistic regression and look at the log-odds ratio > >differences between pairs of occupations. Employing the data > >you presented, we would have > > > > > >proc format; > > value occup > > 1 = '1: Police' > > 2 = '2: Cook' > > 3 = '3: Accountant'; > > > > value group > > 1 = 'A' > > 2 = 'B'; > >run; > > > >data test; > > group=1; > > occup=1; freq=1000; output; > > occup=2; freq=200; output; > > occup=3; freq=500; output; > > group=2; > > occup=1; freq=1500; output; > > occup=2; freq=150; output; > > occup=3; freq=600; output; > > format occup occup. > > group group.; > >run; > > > > > >title 'Chi-square test of independence'; > >proc freq data=test; > > weight freq; > > table group*occup / chisq; > >run; > > > > > >title 'Logistic regression approach to testing for independence'; > >title2 'and also testing pairwise log-odds ratios'; > >footnote 'Test for independence obtained from table'; > >footnote2 'Type III Analysis of Effects'; > >proc logistic data=test; > > freq freq; > > class occup / param=glm; > > model group = occup; > > contrast "log-odds(Police vs cook)" > > occup 1 -1 0; > > contrast "log-odds(Police vs accountant)" > > occup 1 0 -1; > > contrast "log-odds(Cook vs accountant)" > > occup 0 1 -1; > >run; > > > > > >Dale > > > > > >--- conjecture <chris.chan@WEBMININGPRO.COM> wrote: > >> On Mon, 09 Feb 2004 08:36:32 -0500, Paige Miller > >> <paige.miller@kodak.com> wrote: > >> > >> >conjecture wrote: > >> >> I've two groups of people, I try to compare the occupation > between > >> two > >> >> groups. > >> >> > >> >> eg > >> >> Police Cook Accountant > >> >> A 1000 200 500 > >> >> B 1500 150 600 > >> >> > >> >> The distribution is > >> >> Police Cook Accountant > >> >> A 59% 12% 29% > >> >> B 67% 7% 27% > >> >> > >> >> I try to compare the percentage, say Police, 59% vs 67% using > >> normal > >> >> test. > >> > > >> >I would not use a normal test on this data. The data are not > >> >normally distributed. > >> > > >> >Perhaps you meant that you are using a normal approximation to a > >> >binomial test. If that is what you are doing, that is probably > fine > >> >in this case. > >> > > >> Yes, I mean using a normal approximation to a binomial test > >> > >> >> Should I conclude the two group are different when we find the > >> test is > >> >> significant? I don't want to use chi square test because it is > not > >> as > >> >> detailed as the normal test to test all the occupation. Agree?? > >> > > >> >I don't understand your objection to chi-squared. Chi-squared > would > >> >be my first choice as a test to compare groups A and B across the > >> >three occupations. > >> Chi-squared test is best to compare two groups but I want to test > >> where the differences coming from. So I choose normal approx. to > test > >> the percentage by occupation. Is it reasonable and usual to use > the > >> above method to do this analysis?? Pls advise !! > >> > >> Thanks > >> Note: Please correct me if you find any mistakes in my sentences. > > > > > >===== > >--------------------------------------- > >Dale McLerran > >Fred Hutchinson Cancer Research Center > >mailto: dmclerra@fhcrc.org > >Ph: (206) 667-2926 > >Fax: (206) 667-5977 > >--------------------------------------- > > > >__________________________________ > >Do you Yahoo!? > >Yahoo! Finance: Get your refund fast by filing online. > >http://taxes.yahoo.com/filing.html > > Note: Please correct me if you find any mistakes in my sentences.

===== --------------------------------------- Dale McLerran Fred Hutchinson Cancer Research Center mailto: dmclerra@fhcrc.org Ph: (206) 667-2926 Fax: (206) 667-5977 ---------------------------------------

__________________________________ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html

Back to: Top of message | Previous page | Main SAS-L page