chisq.test question

Hi,

This question is somewhat related to a previous post I made: Error in sum(x) : invalid 'type' (character) of argument - #2 by nirgrahamuk.

Off the back of this thread, I managed to run chisq.test. I was performing this to compare the frequency of four groups, in order to report if the frequency is statistically significantly different.

For reference, this is the contingency table:

> table (Group4_subset$Mood.Change)

      Declined       Improved Neg_maintained Pos_maintained 
             3             57             35             53 

This is the chisq.test code I ran:

> chisq.test(table(Group4_subset$Mood.Change), correct=FALSE)

From running the above chisq.test, I get this output:

>  Chi-squared test for given probabilities

data:  table(Group4_subset$Mood.Change)
X-squared = 49.081, df = 3, p-value = 1.254e-10

My question is, does this mean that chi-square goodness of fit test has run rather than Chi-Square Test of Independence?

If this is the case, which I think is the right approach based on my aim(?), should I be using code similar to this:

> chisq.test(x, p) 

or is my original code okay?

Many thanks in advance,
Phoenix

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.