FAQ
Dear R help
I have been trying to conduct a chi square test on two groups of variables
to test whether there is any relationship between the two sets of variables

chisq.test(oxygen, train)

Pearson's Chi-squared test

data: oxygen
X-squared = 26.6576, df = 128, p-value = 1
chisq.test(oxygen)
Pearson's Chi-squared test

data: oxygen
X-squared = 26.6576, df = 128, p-value = 1

It looks as if R is only reading the first set of variables pertaining to
oxygen. Is there a way for it to test for two groups of variables?

brett stansfield

Brett Stansfield
Environmental Scientist - Water Quality
Hawke's Bay Regional Council
102 Vautier Street
Private Bag 6006
Napier
Phone (06) 835-9200 extn 9334
Fax (06) 835-3601

## Search Discussions

•  at May 27, 2005 at 1:22 am ⇧
If 'oxygen' is a matrix with one row or column, 'oxygen' is treated as
a one-dimensional contingency table. In this case, the hypothesis
tested is whether the population probabilities equal those in 'p', or
are all equal if 'p' is not given.

you can convert the 'oxygen' and 'train' variables to vector or take a
two-dimensional contingency table by matrix(c(oxygen, train), nr=2).

2005/5/27, Brett Stansfield <brett@hbrc.govt.nz>:
Dear R help
I have been trying to conduct a chi square test on two groups of variables
to test whether there is any relationship between the two sets of variables

chisq.test(oxygen, train)

Pearson's Chi-squared test

data: oxygen
X-squared = 26.6576, df = 128, p-value = 1
chisq.test(oxygen)
Pearson's Chi-squared test

data: oxygen
X-squared = 26.6576, df = 128, p-value = 1

It looks as if R is only reading the first set of variables pertaining to
oxygen. Is there a way for it to test for two groups of variables?

brett stansfield

Brett Stansfield
Environmental Scientist - Water Quality
Hawke's Bay Regional Council
102 Vautier Street
Private Bag 6006
Napier
Phone (06) 835-9200 extn 9334
Fax (06) 835-3601

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help

--
ADDRESS: Bioinformatics Center, Shanghai Institutes for Biological
320 Yueyang Road, Shanghai 200031, P.R.China
TELEPHONE: 86-21-54920086

## Related Discussions

Discussion Overview
 group r-help categories r posted May 26, '05 at 10:00p active May 27, '05 at 1:22a posts 2 users 2 website r-project.org irc #r

### 2 users in discussion

Content

People

Support

Translate

site design / logo © 2015 Grokbase