[R] Missing data (Na) and chi-square tests

Rerda gerda.lindsted at gmail.com
Fri Oct 5 15:26:19 CEST 2012

Dear everyone

I am a bit of a computer imbecile and are having problems with R.
I am using R in my research project to do chi-square tests on data imported
from excel .
However I have som missing data in one of my variables (columns) and I need
R to "exclude" these and make chi-square test on the data that I have.

I use a formula to make 2x2 tables which is:
data <- matrix(c(sum(!Variable[Group....==1]), sum(Variable[DAAC....==1]),
sum(!Variable[Group....==0]), sum(Variable[DAAC....==0])),2,2)

How can I get R to ignore Na's in this formula?

Many Regards

View this message in context: http://r.789695.n4.nabble.com/Missing-data-Na-and-chi-square-tests-tp4645167.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list