Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Stata/SPSS

  • 13-01-2010 3:54pm
    #1
    Registered Users, Registered Users 2 Posts: 3,483 ✭✭✭


    Please bear with me, I am a lowly sociologist and figured this would be the best place to go :)

    For those of you who use stata - I am just beginning to use it, and having gotten over the syntax hurdle, am finding it much nicer to use than SPSS. Our department doesn't have stata, and I dont have much chance of a successful request. I understand there is a way to navigate SPSS using syntax, although I haven't tried to (and wont be able to as I am working from another college for the next few weeks - the computer I am using just has stata).

    For those of you that might have some familiarity with both, do you know if the syntax tends to be consistent across the two? I'm working with patchy historical datasets and the ease of subtle adjustment with the syntax is particularly useful.


Comments

  • Posts: 5,589 ✭✭✭ [Deleted User]


    Depending on what you are doing, R might help. Its free and there are loads of guides on the internet, as well as loads of packages to add on.

    For time series work, R > Stata although there is a steep initial learning curve.

    www.r-project.org


  • Registered Users, Registered Users 2 Posts: 8,452 ✭✭✭Time Magazine


    efla wrote: »
    For those of you that might have some familiarity with both, do you know if the syntax tends to be consistent across the two?

    Not really. They both have the feel of an old-school computer language, but it's definitely not a copy and paste job. Writing a set of commands in one language will provide a general framework for a copy and paste job, but you'll have to adapt each line to fit.

    As far as I know, you're a sociology student so I'm going to be appropriately condescending and presume you're dealing with a relatively small dataset :pac:. By that I mean you don't need a super powerful version of Stata. In that case, you might be interested in purchasing Stata yourself on a student package, for the very reasonable price of about €60 for a one-year licence of €120 for a perpetual licence. You can even buy "Small Stata" (but that limits your n to 1200) for €35.

    Zaraba is right to suggest R. It's free, widely used among statisticians and a bit more powerful for number crunching than either of Stata or SPSS.


  • Closed Accounts Posts: 6,609 ✭✭✭Flamed Diving


    Depending on what you are doing, R might help. Its free and there are loads of guides on the internet, as well as loads of packages to add on.

    For time series work, R > Stata although there is a steep initial learning curve.

    www.r-project.org

    Could you point me to a decent guide?


  • Posts: 5,589 ✭✭✭ [Deleted User]


    Google for 'Farnsworths guide to econometrics in r'


  • Posts: 5,589 ✭✭✭ [Deleted User]


    its here:
    http://cran.r-project.org/doc/contrib/Farnsworth-EconometricsInR.pdf

    good intro which gets you used to the specifics.

    There are some amazing financial packages available on the net which are really cool if you have the data to use them on.


  • Advertisement
  • Closed Accounts Posts: 6,609 ✭✭✭Flamed Diving


    its here:
    http://cran.r-project.org/doc/contrib/Farnsworth-EconometricsInR.pdf

    good intro which gets you used to the specifics.

    There are some amazing financial packages available on the net which are really cool if you have the data to use them on.

    Farnsworth...

    professor-farnsworth.gif

    I love this package already!


  • Posts: 5,589 ✭✭✭ [Deleted User]


    Yeah, that is the only reason I can ever remember who wrote it!


  • Registered Users, Registered Users 2 Posts: 3,483 ✭✭✭Ostrom



    As far as I know, you're a sociology student so I'm going to be appropriately condescending and presume you're dealing with a relatively small dataset :pac:. By that I mean you don't need a super powerful version of Stata. In that case, you might be interested in purchasing Stata yourself on a student package, for the very reasonable price of about €60 for a one-year licence of €120 for a perpetual licence. You can even buy "Small Stata" (but that limits your n to 1200) for €35.

    Zaraba is right to suggest R. It's free, widely used among statisticians and a bit more powerful for number crunching than either of Stata or SPSS.

    The datasets are countrywide - demography and agriculture. Quite large with a small few categorical variables. I'm planning to spend a few months on them (its for my phd) so am willing to invest the time in the learning curve. Categoricals are important so mostly logistic regression. I have a few small sample case studies alright but not sure what to do with them yet. Am expectings around 700 cases overall. Fuppin sociologists etc :) Thanks for the advice


  • Posts: 5,589 ✭✭✭ [Deleted User]


    Stata and R will do logit models quite easily. I've done a lot of logit modelling in stata, its easy enough to run. I wouldn't shell out for Stata-SE just for logits before trying R though.

    If you want to really get to grips with the maths (and issues) with them, then Greene's Econometric Analysis and Cameron and Trivedi's Microeconometrics give quite nice and not that technical (for this type of work) overviews and discussion about logit modelling.


  • Registered Users, Registered Users 2 Posts: 3,483 ✭✭✭Ostrom


    Stata and R will do logit models quite easily. I've done a lot of logit modelling in stata, its easy enough to run. I wouldn't shell out for Stata-SE just for logits before trying R though.

    If you want to really get to grips with the maths (and issues) with them, then Greene's Econometric Analysis and Cameron and Trivedi's Microeconometrics give quite nice and not that technical (for this type of work) overviews and discussion about logit modelling.

    Thanks - if small stata is that price though, i'll probably go with it. I'll check out the books too, could do with going over the maths again.


  • Advertisement
  • Posts: 5,589 ✭✭✭ [Deleted User]


    I don't know if you are going to venture to the world of multinomial logits, but really, really study the problem of Independence of Irrelevant Alternatives.

    And if you want any help just post here, there are lots of people with good knowledge of econometrics who are normally very willing to help


  • Registered Users, Registered Users 2 Posts: 3,483 ✭✭✭Ostrom


    I don't know if you are going to venture to the world of multinomial logits, but really, really study the problem of Independence of Irrelevant Alternatives.

    And if you want any help just post here, there are lots of people with good knowledge of econometrics who are normally very willing to help

    Thanks, i'm sure i'll be back soon! I may end up there yet when i have a look at whats available in the other datasets.


  • Closed Accounts Posts: 6,609 ✭✭✭Flamed Diving


    This book is great:

    Regression models for categorical and limited dependent variables, J. Scott Long (1997)


  • Registered Users, Registered Users 2 Posts: 3,483 ✭✭✭Ostrom


    Rather than starting a new thread -

    I'm still flitting between SPSS and stata - anyone know offhand if there is an SPSS syntax equivalent of stata's */ for inserting notes into your SPSS do file?


  • Registered Users, Registered Users 2 Posts: 8,452 ✭✭✭Time Magazine


    Click on File > I am stupid so I use SPSS > New > Totally talk it over section

    Just start with an asterix and finish with a full stop :)


  • Registered Users, Registered Users 2 Posts: 3,483 ✭✭✭Ostrom


    Click on File > I am stupid so I use SPSS > New > Totally talk it over section

    Just start with an asterix and finish with a full stop :)

    Unfortunately I dont have a choice in the matter. For now....

    And I am feeling a little more stupid than usual today.

    Thanks!


  • Closed Accounts Posts: 563 ✭✭✭BESman


    I like the pretty pictures SPSS produces.


  • Registered Users, Registered Users 2 Posts: 142 ✭✭chave


    hi,

    I would like to test my panel data for autocorrelation and heteroskedasticty?

    I know the DW and Breusch Pagan are the tests to do this but I cant find out
    how to get stata to do it for panel data.

    i used xtreg . . . , fe to do my regressions.

    thanks


  • Registered Users, Registered Users 2 Posts: 8,452 ✭✭✭Time Magazine


    chave wrote: »
    I would like to test my panel data for autocorrelation and heteroskedasticty?

    http://www.stata.com/support/faqs/stat/panel.html


  • Closed Accounts Posts: 6,609 ✭✭✭Flamed Diving


    What frequency are your panels?

    Have you tried "hettest"?

    and "estat dwatson"?

    Try xtgls, which is Generalised Least Squares for panel data models:

    xtgls fits cross-sectional time-series linear models using feasible generalized least squares. This command allows estimation in the presence of AR(1) autocorrelation within panels and cross-sectional correlation and heteroskedasticity across panels.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 142 ✭✭chave


    What frequency are your panels?

    Have you tried "hettest"?

    and "estat dwatson"?

    Try xtgls, which is Generalised Least Squares for panel data models:

    xtgls fits cross-sectional time-series linear models using feasible generalized least squares. This command allows estimation in the presence of AR(1) autocorrelation within panels and cross-sectional correlation and heteroskedasticity across panels.

    Im dont really know what im doing, basically did a hausman and it said use random effects , I just need the commands to do the tests for Heteroskedasticity and Autocorrelation within a RE model???? Ive read in a book that they differ from the FE tests.

    thanks


  • Closed Accounts Posts: 6,609 ✭✭✭Flamed Diving


    chave wrote: »
    Im dont really know what im doing, basically did a hausman and it said use random effects , I just need the commands to do the tests for Heteroskedasticity and Autocorrelation within a RE model???? Ive read in a book that they differ from the FE tests.

    thanks

    Ok, I know little of FE and RE, but...

    A recommendation in Econometric Analysis of Cross-Section & Panel Data (Woolridge, 2002), suggests that, under certain assumptions, the Langrange multiplier statistic in a likeihood setting, developed by Breusch and Pagan (1980) will detect serial correlation. The book was more or less silent on heteroscedasticity tests or dealing with it.

    Ok, so then I referenced Econometric Analysis (Greene, 2002). On page 316, section 13.7.2, he discusses possible ways to deal with it, but actually arrives at a indeterminate conclusion. He does mention that using GLS will correct for this (as it always does) and doing a little jig with the regression will get you FGLS, if that's what you want. There is a very recent journal paper in Econometrica which is still aiming to solve this problem, so my guess is that it hasn't been resolved yet. Greene's book is the bible in econometrics, so if he doesn't have the answer, no one does.

    I also found this suggestion:

    http://www.stata.com/statalist/archive/2005-01/msg00330.html

    Which isn't a terrible idea, and bootstrapping your SE's is just a case of typing 'bootstrap'. But no test.


  • Registered Users, Registered Users 2 Posts: 142 ✭✭chave


    Ok, I know little of FE and RE, but...

    A recommendation in Econometric Analysis of Cross-Section & Panel Data (Woolridge, 2002), suggests that, under certain assumptions, the Langrange multiplier statistic in a likeihood setting, developed by Breusch and Pagan (1980) will detect serial correlation. The book was more or less silent on heteroscedasticity tests or dealing with it.

    Ok, so then I referenced Econometric Analysis (Greene, 2002). On page 316, section 13.7.2, he discusses possible ways to deal with it, but actually arrives at a indeterminate conclusion. He does mention that using GLS will correct for this (as it always does) and doing a little jig with the regression will get you FGLS, if that's what you want. There is a very recent journal paper in Econometrica which is still aiming to solve this problem, so my guess is that it hasn't been resolved yet. Greene's book is the bible in econometrics, so if he doesn't have the answer, no one does.

    I also found this suggestion:

    http://www.stata.com/statalist/archive/2005-01/msg00330.html

    Which isn't a terrible idea, and bootstrapping your SE's is just a case of typing 'bootstrap'. But no test.


    thanks man


  • Registered Users, Registered Users 2 Posts: 3,483 ✭✭✭Ostrom


    Anyone know if stata press books are sold in any Dublin bookshops? Or Uni bookshops - I'm within range of trinity and UCD


  • Registered Users, Registered Users 2 Posts: 8,452 ✭✭✭Time Magazine


    efla wrote: »
    Anyone know if stata press books are sold in any Dublin bookshops? Or Uni bookshops - I'm within range of trinity and UCD

    Most decent Stata press books (as in the ones by Cameron and Trivedi, Baum, etc.) are available at reasonable prices online. The manuals are crap imho, just use the website.

    You might also grow a bit of a brass neck and email some economists. Most people have books just sitting on their shelves and they wouldn't mind lending them to a respectable PhD student who would benefit from borrowing it for a month.

    You can PM me the book(s) you need and I'll see what I can source for you, if you want.


  • Closed Accounts Posts: 15 Snackie


    SPSS is good for data management, but you should run regressions on Stata


Advertisement