I know that there many dangers and disadvantages of treating a continuous variable as a categorical variable. However, I also read in some cases it is applicable (e.g. when the relationship is non linear: say, you have data for workers aged 30, 35, 40, 45, 50, and 55. If the first four ages have similar mean amounts of retirement planning, but at age 50 it starts to go up, and at 55 it jumps much higher, one approach would be to consider age as categorical, and see at which age retirement planning increased. Taken from: https://www.theanalysisfactor.com/3-situations-when-it-makes-sense-to-categorize-a-continuous-predictor-in-a-regression-model/)
In my case, I have 1 categorical [item type: apples and oranges] and 1 continuous [the number of items: 1,2,3,4,5 (for apples) and 3 (for oranges)] variable. As you can see I have unequal number of levels for different item types. So, I cannot simply have two regression lines (one for apples ad one for oranges) and compare them with each other. Besides, my main interest is comparing the responses to '3 apples' vs '3 oranges'. So here is what I thought I might do:
-Produce a regression line for responses to 1-5 apples (i.e., rightfully treating them as continuous variables), and conduct a t-test for comparing the responses to '3 oranges' vs '3 apples' (i.e., treating them as categorical variables).
Would this be applicable? If not, I would really appreciate any other suggestions!
p.s.1. This is a within-subject design, the data for apples and oranges come from the same subjects.
p.s.2. The effect I found is quite robust, so even if I lose power I am okay with it. My only concern is about applicability.