0
$\begingroup$

Let's say I have the following summary data/observed counts.

             Choice 1    Choice 2
Category 1     500          100 
Category 2     350          250
Category 3     400          200

What I want to do is a goodness of fit chi-square test (meaning check whether the variables - type of category and type of choice are significantly associated). However, I need to check the fit against specific counts/proportions, i.e:

             Choice 1    Choice 2
Category 1     1/6          1/6 
Category 2     1/6          1/6
Category 3     1/6          1/6

I am using R. The data is encoded in the following way:

observed <- matrix(c(500, 100, 350, 250, 400, 200),
                   ncol = 2,
                   byrow = T)
colnames(observed) <- c("Choice 1", "Choice 2")
rownames(observed) <- c("Category 1", "Category 2", "Category 3")

goodness <- chisq.test(observed, p = matrix(c(1/6, 1/6, 1/6, 1/6, 1/6, 1/6),
                                            ncol = 2,
                                            byrow = T))

However, when I check the expected counts of goodness, they certainly don't state 300 for every cell.

How could I actually include the 50/50 frequency for the chisquare test that I actually expect?

$\endgroup$
  • $\begingroup$ What you need seems clear enough until the last line: exactly how does this "50/50 frequency" relate to the cell probabilities of 1/6 you posit earlier? $\endgroup$ – whuber Aug 29 '19 at 15:54
  • $\begingroup$ By 50/50 I mean that for each category in 50%s of the cases the people make Choice 1 and in the other 50%s they choose Choice 1. There are 3 categories, hence 3x2 equals 6 entry cells (from where I get the 1/6 proportions). $\endgroup$ – petro.y Aug 29 '19 at 16:36
2
$\begingroup$

You are trying to do two separate things which in fact require looking at the data in two ways.

To test whether each cell is equi-probable (has p = 1/6) you need to treat the table as a vector with 6 entries.

To test for independence you need to use the matrix as you suggest. You cannot mix them.

I leave on one side why you want to do this as you have not given us your scientific question.

$\endgroup$
  • $\begingroup$ My scientific question is whether the type of Choice depends on the Category (people perform a forced-choice classification task; they see a stimulus which is from one of three possible categories and classify it as either Choice 1 or Choice 2). As all stimuli are ambiguous, my prior expectation is that people should respond on random (that is, for all of the three categories half of the times they should choose Choice 1 and the other half - Choice 2). My end goal is to check for which Category the responses differ significantly from the expected 50/50 frequencies. $\endgroup$ – petro.y Aug 29 '19 at 17:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.