0

To make things simple, let say I ran a basic psychometric experiment and I want to test whether the response time (i.e. a continuous variable) can predict the performance score (i.e. a continuous variable). Besides, there are 3 different conditions (e.g. Conditions A,B,C). I want to test whether the effect of response time differs between conditions.

Particularly, I am only interested in the difference in effect of response time between Conditions A and C. Hence, I create an effect-coded variable (i.e. X2) in which Conditions A,B,C are coded as 1,0,-1 respectively (please see the table below for illustration). And then I carry out a regression including the following regressors: response time (i.e. X1), the effect-coded variable for conditions (i.e. X2), and an interaction term by multiplying X1 and X2 (i.e. X3).

Response time Condition X1 X2 X3
335 A 335 1 335
253 B 253 0 0
166 C 166 -1 -166
420 B 420 0 0
347 A 347 1 347
506 C 506 -1 -506

I wonder if I am doing the correct thing? Any explanation and clarification would be appreciated. Thank you.

  • I must miss the point... but if you have only 3 conditions, why won't you just keep this variable as categorical? Why keeping B if it is not of your interest? Also, not sure to understand what is your dependent variable... – Pitouille Nov 30 '21 at 13:27
  • If you are using only one of the two contrast variables, the model does not know that there are 3 and not 2 conditions. Single variable X2 coded 1,0,-1 is not fundamentally different, by meaning, from single variable coded 1,0 or 1,-1. In your X2, 0 is just some intemediate value of a quantitative scale. Whereas if you enter both effect-coded predictors, the meaning of 0 is different, it is a sign of the presence of category B. – ttnphns Nov 30 '21 at 13:37
  • @Pitouille Thanks for your reply. Sorry for using a confusing example. I think we can just take the dependent variable as a continuous variable without knowing that what it actually is (perhaps I should make some changes in the question) .One reason that I also include the uninterested B is that the correlation between X1 and X3 will become very high if a dummy variable is used instead. Would you mind telling me more that whether my current approach is statistically wrong or just not recommended? Thank you. – Christopher Nov 30 '21 at 13:47
  • 1
    You need a known independent variable for your regression... by essence. You want to be able to quantify the impact of a change in the predictors on your response. – Pitouille Nov 30 '21 at 13:53
  • @ttnphns Thank you for your explanation. Do you mean that even though effect-coding is used, two variables should be created to indicate 3 group, as if dummy coding is used? If this is the case, would you mind telling me what another effect-coded variable will be? I only want to contrast Conditions A and C. Thank you. – Christopher Nov 30 '21 at 13:58
  • Reading again the question, I feel that you want more to test the effect between condition A and condition C... which, in this case, a test statistic (hypothesis testing) might be more relevant... – Pitouille Nov 30 '21 at 14:03
  • `Do you mean that even...` Yes, always. Whichever the encoding type of the contrast variables representing a k-level categorical factor, all k-1 contrast variables must be entered in the model in order to do the job (to represent a categorical factor). Please [read](https://stats.stackexchange.com/a/221868/3277) how the contrast variables are coded and what your 2nd variable will be. Note that deviation aka effect contrast type does _not_ compare a group with a group, but compares a group with the overall effect. Use dummy type to compare a group with a group. – ttnphns Nov 30 '21 at 14:04
  • @Pitouille In fact, my actual data involves some jargon and hence I try to make the words as general as possible. I have modified my question. Let say the DV is a performance score of the experiment on every trial. May I know if my current approach is statistically wrong or just not recommended? Thanks. – Christopher Nov 30 '21 at 14:04
  • 1
    Thank you both for your help. I think you did solve my query. – Christopher Nov 30 '21 at 14:27
  • You might consider posting your selected approach as an answer. It might help future users in the same situation and won’t let the question “unanswered”. – Pitouille Nov 30 '21 at 15:31

0 Answers0