# Sample analysis

I have a regression with typical Stata output. The only independent variable is a dummy (=1 if person bought certain item). How can I find how many people in the sample bought the item?

-
Unless you can share your "typical Stata output" with us, it appears we don't have enough information to answer this question. – whuber Oct 28 '12 at 18:45
I'm not looking for a specific numerical answer, just for the procedure. I'm given the mean and standard error of the dependent variable, and the coefficients, standard errors and t statistics for the two coefficients (constant and the coefficient on the dummy variable) I also have the r-squared and the sample size. – user14386 Oct 28 '12 at 20:02
But because you are not given summary statistics for the independent variable, how can you hope to find its sum (for that's what you're asking)? All the statistics you describe depend essentially on the dependent variable. – whuber Oct 28 '12 at 20:07
The regression line goes through the point $(\bar{x},\bar{y})$. If you know $\bar{y}$, you can find $\bar{x}$ by solving for it after substituting $\bar{y}$ into the regression equation. $\bar{x}$ will be the ratio of the number of people that bought the item to the total number of people in the sample. It looks like Stata gives the number of observations in the sample, so just multiply $\bar{x}$ by the number of observations. – Max Oct 28 '12 at 20:12

Suppose your fitted regression model is the following: $\hat{y}=b_0+b_1x$. The fitted line goes through the point $(\bar{x},\bar{y})$. If you know $\bar{y}$, then $\bar{x}=\frac{\bar{y}-b_0}{b_1}$. $\bar{x}$ is the proportion of the sample that purchased the item. Multiplying $\bar{x}$ by the sample size gives the number of people in the sample that purchased the item.