[R] categorical data analysis

David Winsemius dwinsemius at comcast.net
Thu May 8 05:00:40 CEST 2008


David Winsemius <dwinsemius at comcast.net> wrote in 
news:Xns9A96E61EE39A8dNOTwinscomcast at 80.91.229.13:

> 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
snip

Another possibility for the analysis of ordered catergorical response 
might be proportional odds regression. The MASS package has polr:

library(MASS)
?polr
------------
polr(formula, data, weights, start, ..., subset, na.action,
     contrasts = NULL, Hess = FALSE, model = TRUE,
     method = c("logistic", "probit", "cloglog", "cauchit"))

Arguments
formula:     a formula expression as for regression models, of the form 
response ~ predictors. The response should be a factor (preferably an 
ordered factor), which will be interpreted as an ordinal response, with 
levels ordered as in the factor.  
-----------------
My copy of Venables&Ripley's MASS is an older version and neither the 
index nor the TOC tells me where to find worked examples. Harrell's 
Regression Modeling Strategies has a case study illustrating the use of  
his lrm function. So you might also look at:

library(Design)
?lrm
-- 
David Winsemius



More information about the R-help mailing list