Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

Using a data set of 209 countries, I have run a fixed effects regression for non-OECD countries.

When I summarize my variables, it gives me all of the variables in data set, but I only need a summary of those variables that have been used in my fixed effects regression. For instance, when I run fixed effects, the number of groups is 138. So, my total observations for a variable should be 138 multiplied by 26 years (1980-2006), which is only 3588 observations.

How can I ask Stata to generate this?

share|improve this question

2 Answers

Stata leaves the quasi-variable e(sample) after any estimation command. You can use it as summarize x1 x2 x3 if e(sample).

In general, you should develop a habit of looking into the guts of Stata with ereturn list after estimation. You may be able to find a lot of useful additional information.

share|improve this answer

-estat summarize- will give summaries of the sample used in the most recent estimation command. See -help postestimation-, or the postestimation help for the specific command you are using.

share|improve this answer
I agree with @timbp. But if you require summaries for variables not in the regression then stata can mark your sample by creating a dummy variable. Just type"mark sample" and you will get the dummy. Thus you can use the IF sample==1 along with your specific summary command. – JDav Aug 8 '12 at 14:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.