Suppose I am trying to derive an equation for estimating a person's weight. My first equation is based on a large sample of men and women and I simply regress height against weight using simple linear regression, and my stats package automatically generates the equation and r^2 value.

Now suppose I want to create a regression equation which estimates weight based on whether a person is male or female (categorical data). I would probably need to do this using dummy variables but is it possible to create an equation which has a corresponding R^2 value (correlation coefficient)?

I know how to do this for interval data but not sure it's even possible for categorical data. Does anyone know, and if so can provide some advice on the best way to proceed?