# Chi-square Goodness of fit with specific expected values

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?

• 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? – whuber Aug 29 '19 at 15:54
• 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). – petro.y Aug 29 '19 at 16:36