After doing a linear regression with 1 continuous response variable (number) and 1 categorical predictor variable I plotted the residuals and they are all on the 0,0 line. What does this mean and what can possibly cause that?
If your categorical independent variable has a number of levels equal to the number of samples, then you get that.
On further clarifications
So I would probably have to change my dataset? The original dataset had a column with height (continuous) and a column with the species that was found at that height. What I did is categorize the height and then count the number of species that were present in each height-class. I wanted to know if the number of species increases with height. How do I do this then?
Height is by no means a categorical variable and, even if binned, the new binary variables should not be considered independent.
You can still bin height though, but keep it as an ordered categorical variable (in R, that's an "ordered factor") so the intrinsic ordering is maintained.
A more principled approach would be to keep height as it is and model the number of species using a Poisson generalized linear model (GLM, for short).