continuous independent variable with three levels I have a model with a variable named "Delay" as a predictor (measured in seconds). It sounds reasonable to treat it as a continuous variable. However, I have two thoughts regarding this:



*

*I sampled only three levels of Delay (assuming "levels" is the right terminology in this case): 0, 3 and 6. Is there any reason to believe it is better to think of it as a categorical variable? I saw there was also an option in R to define a variable as ordinal (ordered(Delay)). I found that the results of my regression analysis were different for each of the three options (continuous, categorical, ordinal). What is best and why?

*Assuming I expect a decrease in the effect between Delay=0 and Delay=3, but a milder decrease between Delay=3 and Delay=6 - does that change the answer in 1?



Thank you.
 A: There is no definitive best option and your final choice should depend on the goal of your analysis. From what I know, the interpretation of your model's output will differ as follows:


*

*Delay entered as a continuous variable: The model's intercept represents the value of the outcome for a delay of 0 and the $\beta_i$ of the delay variable represents a the change in the outcome associated with a one unit change in delay. This is the most parsimonious option as only one parameter for the effect of delay is estimated and could make sense if a one unit change in delay is meaningful and a linear trend is of interest for your research question.

*Delay entered as a factor: The model's intercept represents the value of the outcome for the chosen reference level of delay and the k-1 $\beta_i$ represent the difference between the reference level and the level of delay associated with $\beta_i$. This option estimates k-1 parameters to quantify the effect of delay and could make sense if you are interested in comparing the effects of different levels of delay, as several options for post-hoc comparisons are available.

*Delay entered as an ordinal factor: The model's intercept represents the value of the outcome at the mean factor level and the k-1 $\beta_i$ correspond to polynomial contrasts. For $k-1 = 2$, as in your case, this would be equivalent to a linear and a quadratic trend across the factor levels. See also the answer to this question. Again, k-1 parameters are estimated. This might make sense if you are interested in quantifying and differentiating between linear and non-linear trends.


From what you have written in your question and comments, I'd guess coding delay as a factor might make sense, but again this has to be decided considering the goal of your analysis and your research question. Given a possible weaker trend between a delay of 3 and a delay of 6, I'd be cautious with coding delay as numeric since only a linear trend will be modelled.
