Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Importing a variable from another STATA file and an "xtregar" question

From   Maarten Buis <>
Subject   Re: st: Importing a variable from another STATA file and an "xtregar" question
Date   Tue, 7 Jun 2011 17:17:15 +0200

On Tue, Jun 7, 2011 at 4:45 PM, Jason Hecht wrote:
> 1.  I created a smaller panel STATA datafile from a larger panel
> datafile by discarding unneeded variables.  I now want to bring in a
> single variable from the larger datafile into the smaller panel
> datafile.  Is there an easy way to do this.

You can cure the problem with -help merge-, but better yet is to
prevent the problem: If you had done your datapreparation in a .do
file you easily change that .do file and re-run it. The kind of
changes you report happen during every research project, so doing your
data preparation in a .do file will almost always save you huge
amounts of time. This is also a good strategy as that way you
automatically keep a record of exactly how you "tortured" your data.

> 2.  I am running the following model:
> xtregar capexppenet salesppenet if totalassets>1000, re rhotype(theil) twostep
> However, instead of using "totalassets>1000,"  I now want to run the
> model on the upper 5% of the distribution of total assets.

sum totalassests, detail
xtregar ... if totalassest > r(p95), ...

Hope this helps,

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index