I'm fitting a linear regression model in R. Initially, I included only a dummy coded dichotomous variable as a predictor. Thus, the values of the predictor are X0 (set to 0) and X1 (set to 1). Thus, I know the regression coefficient indicates the expected mean difference between X0 and X1.
However, I then used the predict function to get the estimated values for my participants. I then calculated the estimated values across X0 and X1 and surprisingly found that the mean is different that what was indicated by the regression coefficient. Why? Moreover, I'm now wondering what the predict function is useful for?