Re: [R] testing independence of categorical variables

2007-12-06 Thread Petr PIKAL
Hi Well, R does exactly what it says. From help page. Otherwise, x and y must be vectors or factors of the same length I do not know SAS but I presume that tables bloodtype*state gives you something like tab - table(bloodtype, state) and chisq.test(tab) shall give you the expected

Re: [R] testing independence of categorical variables

2007-11-26 Thread Bernardo Rangel Tura
On Thu, 2007-11-22 at 16:16 +0500, Shoaaib Mehmood wrote: hi, is there a way of calculating of measuring dependence between two categorical variables. i tried using the chi square test to test for independence but i got error saying that the lengths of the two vectors don't match. Suppose

Re: [R] testing independence of categorical variables

2007-11-26 Thread John Kane
prettyR --- Shoaaib Mehmood [EMAIL PROTECTED] wrote: i cant find help for xtab. Which package contains this function On Nov 24, 2007 12:16 PM, G Ilhamto [EMAIL PROTECTED] wrote: hi shohaib, have you tried xtab instead of chisq.test? Ilham On Nov 22, 2007 6:16 AM, Shoaaib

Re: [R] testing independence of categorical variables

2007-11-25 Thread Shoaaib Mehmood
i cant find help for xtab. Which package contains this function On Nov 24, 2007 12:16 PM, G Ilhamto [EMAIL PROTECTED] wrote: hi shohaib, have you tried xtab instead of chisq.test? Ilham On Nov 22, 2007 6:16 AM, Shoaaib Mehmood [EMAIL PROTECTED] wrote: hi, is there a way of

[R] testing independence of categorical variables

2007-11-22 Thread Shoaaib Mehmood
hi, is there a way of calculating of measuring dependence between two categorical variables. i tried using the chi square test to test for independence but i got error saying that the lengths of the two vectors don't match. Suppose X and Y are two factors. X has 5 levels and Y has 7 levels. This

Re: [R] testing independence of categorical variables

2007-11-22 Thread Moshe Olshansky
Hi, When testing whether random variables X and Y are independent the usual assumption is that you have n pairs of outcomes - (X1,Y1), (X2,Y2), ... , (Xn,Yn) and you are basically checking whether the value of X affects the value of Y. If you have 7 observations of X and 5 separate observations