hie all i am trying to carry out a categorical data analysis but my problem is that when in i use the chi squared test some of my expected values are less than 5. is there a test that can handle this situation. the data is not a 2*2 table. its more from the social sciences where you have from strongly agree to strongly disagree. i know i can collapse vthe tables but there is a loss of information . is the a test vthat i can for this kind of data. thanks in advancde. ray --------------------------------- [[elided Yahoo spam]] [[alternative HTML version deleted]]
Fisher's exact test works with small cells. See ?fisher.test -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org (801) 408-8111> -----Original Message----- > From: r-help-bounces at r-project.org > [mailto:r-help-bounces at r-project.org] On Behalf Of raymond chiruka > Sent: Tuesday, May 06, 2008 10:34 AM > To: r > Subject: [R] categorical data analysis > > hie all > > > i am trying to carry out a categorical data analysis but my > problem is that when in i use the chi squared test some of > my expected values are less than 5. is there a test that > can handle this situation. the data is not a 2*2 table. its > more from the social sciences where you have from strongly > agree to strongly disagree. i know i can collapse vthe tables > but there is a loss of information . is the a test vthat i > can for this kind of data. > thanks in advancde. > > ray > > > > --------------------------------- > [[elided Yahoo spam]] > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
raymond chiruka <rtchiruka at yahoo.com> wrote in news:485562.78562.qm at web33008.mail.mud.yahoo.com:> i am trying to carry out a categorical data analysis but my problem > is that when in i use the chi squared test some of my expected > values are less than 5. is there a test that can handle this > situation. the data is not a 2*2 table. its more from the social > sciences where you have from strongly agree to strongly disagree. i > know i can collapse vthe tables but there is a loss of information . > is the a test vthat i can for this kind of data. thanks in advancde.In addition to Snow's suggestion of fisher.test, you may want to look more closely at: ?chisq.test # read information on simulate.p.value # uses same algorithm (Patefield) as fisher.test # from help examples: x <- c(89,37,30,28,2) p <- c(0.40,0.20,0.20,0.19,0.01) # Expected count in category 5 # is 1.86 < 5 ==> chi square approx. chisq.test(x, p = p) # maybe doubtful, but is ok! chisq.test(x, p = p, simulate.p.value = TRUE) -- David Winsemius
The last example in ?fisher.test is not a 2x2 table, in fact it uses levels with a natural ordering similar to the original question. Why would this not be applicable to the situation? ________________________________________ From: r-help-bounces at r-project.org [r-help-bounces at r-project.org] On Behalf Of David Winsemius [dwinsemius at comcast.net] Sent: Wednesday, May 07, 2008 7:34 AM To: r-help at stat.math.ethz.ch Subject: Re: [R] categorical data analysis Simon Blomberg <s.blomberg1 at uq.edu.au> wrote in news:1210130089.9048.11.camel at sib-sblomber01d.sib.uq.edu.au:> But see these posts: > > http://finzi.psych.upenn.edu/R/Rhelp02a/archive/119079.html > > http://finzi.psych.upenn.edu/R/Rhelp02a/archive/119080.html > > Simon.Interesting reading, but the OP specifically said he was not dealing with 2x2 tables, so neither fisher.test nor the suggested alternatives would be applicable to his data situation. -- David Winsemius ______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
"Greg Snow" <Greg.Snow at imail.org> wrote in news:B37C0A15B8FB3C468B5BC7EBC7DA14CC60EDD50DBA at LP-EXMBVS10.CO.IHC.COM:> The last example in ?fisher.test is not a 2x2 table, in fact it uses > levels with a natural ordering similar to the original question. > Why would this not be applicable to the situation?Apologies. Clearly I misunderstood the R implementation. My parsing of the fisher.test code (influenced by having just read the Campbell article) lead me to erroneously conclude that it was only applicable to 2x2 tables. I see now that the error message says "_at_least_ 2 rows and columns" and that the error check is an inquality. -- David Winsemius> > ________________________________________ > From: r-help-bounces at r-project.org [r-help-bounces at r-project.org] On > Behalf Of David Winsemius [dwinsemius at comcast.net] Sent: Wednesday, > May 07, 2008 7:34 AM To: r-help at stat.math.ethz.ch > Subject: Re: [R] categorical data analysis > > Simon Blomberg <s.blomberg1 at uq.edu.au> wrote in > news:1210130089.9048.11.camel at sib-sblomber01d.sib.uq.edu.au: > >> But see these posts: >> >> http://finzi.psych.upenn.edu/R/Rhelp02a/archive/119079.html >> >> http://finzi.psych.upenn.edu/R/Rhelp02a/archive/119080.html >> >> Simon. > > Interesting reading, but the OP specifically said he was not dealing > with 2x2 tables, so neither fisher.test nor the suggested > alternatives would be applicable to his data situation. > > -- > David Winsemius > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html and provide commented, > minimal, self-contained, reproducible code. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html and provide commented, > minimal, self-contained, reproducible code. > >