# What kind of test do I need to perform for categorical variable with negative values? [closed]

Suppose I have two categorical variables: 1. Person, and 2. Color of clothes. Each person will wear different color of clothes and will be asked to walk along a line back and forth (like random walk) and stop after 10 seconds. The following is the table of position of each person with different clothes after 10 seconds (w.r.t. the origin):

A B C D
Red -1.3 5.2 6.2 5.5
Blue 6.2 -3.2 4.9 4.9
Green -5.1 -8.3 20.1 4.6
Black 4.9 3.14 40.5 -1.5

(all measurements are in meter)

Now, I want to verify if there is any association between variable Person and variable Color.

1. There are two categorical variables, and if all values were positive, I could perform Chi-squared test. However, Chi-squared cannot be applied since the table contains negative value. What test should I perform instead?

2. In addition to two categorical variables, suppose that I have another continuous variable. Hence, $$F: C_1 \times C_2 \times \mathbb R \rightarrow \mathbb R$$, where $$C_1, C_2$$ are categories 1 and 2, respectively. If so, what test should I perform? Or is there a way to create a model (or an equation) that predicts the outcome?

• What do the labels mean? You can't perform a Chi-squared test unless (at the very least) these "labels" are counts of independent occurrences. Obviously a negative value isn't a count. This raises a prior question: what are you really trying to learn about these data? How were they generated and measured?
– whuber
Jan 26, 2023 at 18:35
• Question #1 is a reasonable question, and it comes down to what @whuber commented: those negative values must mean something (or be typos). // Question #2 is a legitimate question but is sufficiently different from question #1 that it warrants its own post.
– Dave
Jan 26, 2023 at 19:10
• I edited the question so that you could see what I meant more clearly. Jan 26, 2023 at 20:41
• It would probably be best to state what your data actually are, not just something that they could be 'like'. Whether they are called "properties" or "labels" is irrelevant. What are they actually? What are the numbers measurements of? Your question arises from some confusions about the situation and the test, so the clearer you can put it, the better off everyone will be. Jan 26, 2023 at 20:41
• @gung-ReinstateMonica I edited the question. Hopefully it clarified what I meant. Jan 26, 2023 at 20:43

Person and color are independent in your setup.

Person A wears each color exactly once. Person B wears each color exactly once. Person C wears each color exactly once. Person D wears each color exactly once.

Red is worn by each person exactly once. Blue is worn by each person exactly once. Black is worn by each person exactly once. Green is worn by each person exactly once.

Therefore, the probability of wearing a particular color does not depend on the person, and the probability of a particular person performing the walk does not depend on the color. No matter what, if you see a color, there is a $$0.25$$ probability of being each person, and if you see any person, there is a $$0.25$$ probability of that person wearing each color.

• Your questions about how color impacts the direction someone walks are separate and really warrant a separate post that contains considerable detail about your experiment. For that, you seem to have two predictors of location, which sounds like the beginning of a fairly standard regression model.
– Dave
Jan 26, 2023 at 20:54
• "how color impacts the direction someone walks", that is what I wanted to know. Jan 26, 2023 at 21:01
• This is the correct answer to a question, but it is unlikely that what is written on this page is closely related to whatever question lies behind the OP's study. I voted to close. Jan 26, 2023 at 21:02
• @JamesC Then please ask that (interesting) follow-up as a new question. How to include that additional variable in your question #2 would make sense to discuss there, too. However, if you "want to verify if there is any association between variable Person and variable Color," then the answer is that you filled in the wrong values in your contingency table. Every value should be a $1$, and the chi-squared test will report no association between person and clothes color, as the experimental design intentionally makes the two independent.
– Dave
Jan 26, 2023 at 21:12