Re: Mixed Models

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Mixed Models

mils
Can anyone help me build this stata model

. xtreg cost output fuel load, fe i(airline) // within group effect

in spss?


thanks in advance!
mils
Reply | Threaded
Open this post in threaded view
|

Re: Mixed Models

David Marso
Administrator
Mils. First off LEARN how to begin a NEW topic rather than hijack really old ones.
Furthermore, explain WHAT this stats code does rather than throwing it at the wall and expecting the group to figure out whatever nuances lie in this rather cryptic syntax. I noticed you have done this twice.
I am moving this to a NEW topic and deleting the other one.

mils wrote
Can anyone help me build this stata model

. xtreg cost output fuel load, fe i(airline) // within group effect

in spss?


thanks in advance!
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Mixed Models

Andy W
In reply to this post by mils
The Stata code snippet is incomplete/incorrect:

1) You do not set the panel variable using xtset
2) i(airline) is not a valid option after fe
3) If you meant i(airline) to be a factor variable in the regression equation, it should probably be i.airline (assuming airline is the variable name). You can specify the reference category within parenthesis for factor variables, but the variable name still needs to be preceded by a period.

Now, to estimate this same model in SPSS you can use several commands. Fixed effects models are equivalent to fitting an equation with dummy variables (see http://www.stata.com/support/faqs/statistics/intercept-in-fixed-effects-model/), so you could fit this model in SPSS with REGRESSION, or GENLIN or MIXED! GENLIN and MIXED are slightly more convenient as they allow factor variables (similar to i.airline in Stata speak) while REGRESSION you would need to make your own dummy variables.

Ignoring that you haven't specified what the panel variable is in the model, an equivalent model using GENLIN would be (with my guess that airline is a factor variable):

GENLIN cost BY airline WITH output fuel load
  /MODEL airline output fuel load DISTRIBUTION=NORMAL.

I'm less familiar with MIXED or GENLINMIXED but these may be more efficient in fitting the model, especially if there are many airlines. Also note the intercept in the SPSS models will likely not be the same as the Stata model, see the Stata FAQ I linked to earlier in the post.



Andy W
apwheele@gmail.com
http://andrewpwheeler.wordpress.com/
Reply | Threaded
Open this post in threaded view
|

Re: Mixed Models

mils
Hi Andy,

Thanks for your response. The reason I asked about that Stata function.

xtreg cost output fuel load, fe i(airline)

It's because I was reading the following paper, trying to uderstand Panel Data Modeling.:

http://www.iuj.ac.jp/faculty/kucc625/method/panel/panel_iuj.pdf

This paper uses Stata to run all the analysis and I was trying to reproduce all steps in spss. I thought xtreg was Mixed models in SPSS.

I even watched the following video:

http://www.youtube.com/watch?v=LKT4brBV-jo

Which explains the Modern repeated measures analysis using mixed models in SPSS.

I've been posting separate threads because I'm really lost when it comes about this panel data stuff and I'm probably not making too much sense at this point.

Based on the below data, my objective is to understand which market penetrations are influencing (have the highst importance) the sales unit across different time periods.

DATA:


time sales_units penetration_market1 penetration_market2 penetration_market3
1 582 34.33 33.72 36.51
2 546 33.01 32.08 36.54
3 531 35.3 27.88 34.46
4 593 34.44 30.48 37.39
5 537 33.55 33.18 31.7
6 595 34.08 32.76 37.92
7 626 33.19 32.65 36.54
8 629 33 30.88 35.69
9 550 32.04 32.41 36.77
10 586 32.27 33.13 35.7
11 555 30.43 32.48 33.25
12 627 29.77 29.89 33.36
13 556 29.86 30.24 32.3
14 598 28.35 27.01 32
15 600 28.36 28.59 32.24
16 659 29.9 28.97 33.18
 
Thanks in advance.
mils
Reply | Threaded
Open this post in threaded view
|

Re: Mixed Models

Andy W
Like I said in my response and the Stata FAQ mentioned, you can fit the equivalent model different ways. Generically MIXED in SPSS and xtreg in Stata are close to equivalent commands, but for each software you could find example models you can fit in one but not the other (using those specific commands).

I'm going to avoid giving generic advice about estimating panel data models. Much more details would be needed, both in terms of the data you have and the goals of the study to give reasonable advice (and this is not amenable to a short response in a list-serve). FYI in the data you posted you don't even have panel data!
Andy W
apwheele@gmail.com
http://andrewpwheeler.wordpress.com/
Reply | Threaded
Open this post in threaded view
|

Re: Mixed Models

mils

A panel data set contains n entities or subjects, each of which includes T observations measured at 1 through t time period. Thus, the total number of observations in the panel data is nT. Ideally, panel data are measured at regular time intervals (e.g., year, quarter, and month). Otherwise, panel data should be analyzed with caution. A panel may be long or short, balanced or unbalanced, and fixed or rotating
mils