Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[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
Jorge Eduardo Pérez Pérez <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: Importing a variable from another STATA file and an "xtregar" question
Date
Tue, 7 Jun 2011 11:19:17 -0400
1. Use -merge- to bring back the variable, using the "panel" and
"time" identifiers. In version 11:
* Large and small dataset
webuse nlswork, clear
save large.dta, replace
keep idcode year age
save small.dta, replace
* Bring back race from large
merge 1:1 idcode year using large.dta, keepusing(race)
2. Use -_pctile_ and -if-
_pctile totalassets, nq(100)
gen in=(totalassets>=r(r95))
xtregar capexppenet salesppenet if in, re rhotype(theil) twostep
_______________________
Jorge Eduardo Pérez Pérez
On Tue, Jun 7, 2011 at 10:45 AM, Jason Hecht <[email protected]> wrote:
> Any help with the following questions would be greatly appreciated:
>
> 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.
>
>
> 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.
>
> Is there an easy way to do this in the above model estimation code?
>
>
> Thanks so much.
>
> Jason Hecht
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
>
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/