# 2.2 Panel data models  (Page 5/10)

 Page 5 / 10

. xtreg depvar [varlist], fe

The command for estimating the random-effects model is:

. xtreg depvar [varlist], re

If the part of the command with the comma and either re or fe is omitted, Stata will assume that you want to estimate the random-effects model.

## Understanding stata output

To understand the Stata output we need to return to the algebra of the model. Assume that we are fitting a model of the following form:

${y}_{it}=\alpha +\sum _{j=1}^{k}{\beta }_{j}{x}_{jit}+{\nu }_{i}+{\epsilon }_{it},\text{}i=1,\dots ,N,\text{and}t=1,\dots ,T.$

We can sum (13) over t (holding the individual unit constant) and divide by T to get:

${\overline{y}}_{i}=\alpha +\sum _{j=1}^{k}{\beta }_{j}{\overline{x}}_{ji}+{\nu }_{i}+{\overline{\epsilon }}_{i},$

where ${\overline{y}}_{i}=\frac{\sum _{t=1}^{T}{y}_{it}}{T},$ ${\overline{x}}_{ji}=\frac{\sum _{t=1}^{T}{x}_{it}}{T},$ and ${\overline{\epsilon }}_{i}=\frac{\sum _{t=1}^{T}{\epsilon }_{it}}{T}.$ Thus, (14) uses the mean values for each cross-sectional unit. We can subtract (14) from (13) to get:

$\left({y}_{it}-{\overline{y}}_{i}\right)=\sum _{j=1}^{k}{\beta }_{j}\left({x}_{jit}-{\overline{x}}_{ji}\right)+\left({\epsilon }_{it}-{\overline{\epsilon }}_{i}\right).$

Equations (13), (14), and (15) are the basis of Stats’s estimates of the parameters of the model. In particular, the command xtreg, fe uses OLS to estimate (15); this is known as the fixed-effects estimator (or the within estimator). The command xtreg, be uses OLS to estimate (14) and is known as the between estimator. The command xtreg, re —the random-effects estimator—is a weighted average of the between and within estimators, where the weight is a function of the variances of and ( and respectively). See Cameron and Trivedi (2005: 705] for a detailed discussion of the random-effects estimator.

In general, you will not make use of the between estimator. However, these three equations do lie at the basis of the goodness-of-fit measures that Stata reports. In particular, Stata output reports three “R-squareds” R-squared is in quotes in this line because these R-squareds do not have all the properties of OLS R-squareds. —the overall-R 2 the between-R 2 and the within-R 2 These three R-squareds are derived using one of the three equations. In particular, the overall- R 2 uses (13); the between- R 2 uses (14); and the within- R 2 uses (15).

## A panel data analysis using Stata

In this example we follow the example offered in the Stata manual and use a large data set from the National Longitudinal Survey of wage data on 28,534 women who were between 14 and 26 years of age in 1968. The women were surveyed in each of the 21 years between 1968 and 1988 except for the six years 1974, 1976, 1979, 1981, 1984, and 1986. The study is focused on the determinants of wage levels, as measured by the natural logarithm of real wages. Loading in the data set into Stata with a description of the data.

Figure 1 shows the commands used to put the data into Stata . The first command ( set memory 5m ) increases the size of the memory that the program uses; I did this because of the large sample size. The use command accesses that data from the Stata web site. The describe command calls up a description of the variables. Figure 2 presents a summary of the data using the command summerize . Summary of the data.

There are several transformations of the variables that we will need. In particular, we want to include the squares of several of the variables in our regression—age ( age ), work experience ( ttl_exp ), and job tenure ( tenure ). The reason we want to use the square of these variables is that we have reason to believe that wages have a non-linear relationship with these variables. For instance, consider the number of years a worker has been on the job, Tenure . Theory suggests that wages increase over a worker’s work-life at a decreasing rate. Thus, if the equation we are estimating is $y=\mathrm{ln}w={\beta }_{0}+{\beta }_{1}Tenure+{\beta }_{2}Tenur{e}^{2}+\cdots ,$ what we expect is that: $\frac{\partial y}{\partial Tenure}={\beta }_{1}+2{\beta }_{2}Tenure>0$ and $\frac{{\partial }^{2}y}{\partial Tenur{e}^{2}}=2{\beta }_{2}<0.$ The only way that this last equation can be true is if ${\beta }_{2}<0.$ Moreover, if this is true, the first-derivative implies that ${\beta }_{1}>-2{\beta }_{2}Tenure>0.$ Also, notice that we can determine the number of years in a job when wages reach a peak; y reaches a maximum at the age where $\frac{\partial y}{\partial Tenure}={\beta }_{1}+2{\beta }_{2}Tenure=0$ . or when $Tenure=-\frac{{\beta }_{1}}{2{\beta }_{2}}.$ The fact that $\frac{{\partial }^{2}y}{\partial Tenur{e}^{2}}=2{\beta }_{2}<0$ guarantees that this point is indeed a maximum.

#### Questions & Answers

Is there any normative that regulates the use of silver nanoparticles?
Damian Reply
what king of growth are you checking .?
Renato
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
Stoney Reply
why we need to study biomolecules, molecular biology in nanotechnology?
Adin Reply
?
Kyle
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
Adin
why?
Adin
what school?
Kyle
biomolecules are e building blocks of every organics and inorganic materials.
Joe
anyone know any internet site where one can find nanotechnology papers?
Damian Reply
research.net
kanaga
sciencedirect big data base
Ernesto
Introduction about quantum dots in nanotechnology
Praveena Reply
what does nano mean?
Anassong Reply
nano basically means 10^(-9). nanometer is a unit to measure length.
Bharti
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
Damian Reply
absolutely yes
Daniel
how to know photocatalytic properties of tio2 nanoparticles...what to do now
Akash Reply
it is a goid question and i want to know the answer as well
Maciej
characteristics of micro business
Abigail
for teaching engĺish at school how nano technology help us
Anassong
Do somebody tell me a best nano engineering book for beginners?
s. Reply
there is no specific books for beginners but there is book called principle of nanotechnology
NANO
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
s.
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
Tarell
what is the actual application of fullerenes nowadays?
Damian
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
Tarell
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
Mostly, they use nano carbon for electronics and for materials to be strengthened.
Virgil
is Bucky paper clear?
CYNTHIA
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
NANO
so some one know about replacing silicon atom with phosphorous in semiconductors device?
s. Reply
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Harper
Do you know which machine is used to that process?
s.
how to fabricate graphene ink ?
SUYASH Reply
for screen printed electrodes ?
SUYASH
What is lattice structure?
s. Reply
of graphene you mean?
Ebrahim
or in general
Ebrahim
in general
s.
Graphene has a hexagonal structure
tahir
On having this app for quite a bit time, Haven't realised there's a chat room in it.
Cied
what is biological synthesis of nanoparticles
Sanket Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

### Read also:

#### Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, Econometrics for honors students. OpenStax CNX. Jul 20, 2010 Download for free at http://cnx.org/content/col11208/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Econometrics for honors students' conversation and receive update notifications?   By  By Eric Crawford   By  