Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • SEM for panel data

    Dear Stata Users

    I am investigating the link between rural poverty and some categories of public investment using panel data of 24 states for 9 years using Stata 13. Looking through the manual as well as the other sources I did not find examples how to use structural equation model (sem) technique with all observable variables for panel data as all of the examples focus on cross-sectional data. The only difference I found so far is that in sem panel data must be changed from long to wide. I was wondering if you can suggest where I can find the examples of using sem for panel data or any suggestions on using panel sem would be appreciated. Thank you.

    Regards
    Héctor.

  • #2
    SEM applications using panel data are usually described as "latent growth models" intended for the analysis of person-level data, but they are far more general than than. If you look in the online documentation for SEM you will see a brief discussion of such models under "Intro Tour 5".See also Example 18. The documentation contains references that you might peruse, particularly Bollen, Kenneth A. and Patrick J. Curran, 2006, Latent Curve Models: A Structural Equation Perspective.
    Richard T. Campbell
    Emeritus Professor of Biostatistics and Sociology
    University of Illinois at Chicago

    Comment


    • #3
      Fixed and Random Effects in panel data using SEM: Bollen & Brand also gives a good reference.

      Comment


      • #4
        Can the sem module in stata deal with unbalanced panel data?

        Comment


        • #5
          It seems to take unbalanced panel data in stride:

          .ÿversionÿ14.1

          .ÿ
          .ÿclearÿ*

          .ÿsetÿmoreÿoff

          .ÿsetÿseedÿ`=date("215-01-14",ÿ"YMD")'

          .ÿ
          .ÿquietlyÿsetÿobsÿ200

          .ÿgenerateÿintÿpidÿ=ÿ_n

          .ÿgenerateÿdoubleÿuÿ=ÿrnormal()

          .ÿtempfileÿtmpfil0

          .ÿquietlyÿsaveÿ`tmpfil0'

          .ÿ
          .ÿtempnameÿCorr

          .ÿmatrixÿdefineÿ`Corr'ÿ=ÿJ(3,ÿ3,ÿ0.5)ÿ+ÿI(3)ÿ*ÿ0.5

          .ÿquietlyÿdrawnormÿy1ÿy2ÿy3,ÿdoubleÿcorr(`Corr')ÿn(2000)ÿclear

          .ÿgenerateÿintÿpidÿ=ÿmod(_n,ÿ200)ÿ+ÿ1

          .ÿmergeÿm:1ÿpidÿusingÿ`tmpfil0',ÿassert(match)ÿnogenerateÿnoreport

          .ÿbysortÿpid:ÿgenerateÿbyteÿxÿ=ÿ_n

          .ÿ
          .ÿforeachÿvarÿofÿvarlistÿy?ÿ{
          ÿÿ2.ÿÿÿÿÿÿÿÿÿquietlyÿreplaceÿ`var'ÿ=ÿ`var'ÿ+ÿu
          ÿÿ3.ÿ}

          .ÿ
          .ÿquietlyÿreplaceÿy1ÿ=ÿ.ÿifÿruniform()ÿ>ÿ0.95

          .ÿgsemÿ(y?ÿ<-ÿxÿM1[pid]),ÿcovariance(e.y1*e.y2ÿe.y1*e.y3ÿe.y2*e.y3)ÿnocnsreportÿnodvheaderÿnolog

          GeneralizedÿstructuralÿequationÿmodelÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿÿÿ=ÿÿÿÿÿÿ2,000
          Logÿlikelihoodÿ=ÿ-7955.3379

          -------------------------------------------------------------------------------
          ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿCoef.ÿÿÿStd.ÿErr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿConf.ÿInterval]
          --------------+----------------------------------------------------------------
          y1ÿ<-ÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿÿÿÿxÿ|ÿÿÿ.0055276ÿÿÿ.0079954ÿÿÿÿÿ0.69ÿÿÿ0.489ÿÿÿÿ-.0101431ÿÿÿÿ.0211983
          ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿM1[pid]ÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
          ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿ_consÿ|ÿÿ-.0774201ÿÿÿ.0822274ÿÿÿÿ-0.94ÿÿÿ0.346ÿÿÿÿ-.2385829ÿÿÿÿ.0837427
          --------------+----------------------------------------------------------------
          y2ÿ<-ÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿÿÿÿxÿ|ÿÿ-.0014159ÿÿÿ.0077538ÿÿÿÿ-0.18ÿÿÿ0.855ÿÿÿÿ-.0166131ÿÿÿÿ.0137813
          ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿM1[pid]ÿ|ÿÿÿ1.026337ÿÿÿ.0256722ÿÿÿÿ39.98ÿÿÿ0.000ÿÿÿÿÿ.9760204ÿÿÿÿ1.076653
          ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿ_consÿ|ÿÿ-.0424121ÿÿÿ.0827952ÿÿÿÿ-0.51ÿÿÿ0.608ÿÿÿÿ-.2046878ÿÿÿÿ.1198635
          --------------+----------------------------------------------------------------
          y3ÿ<-ÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿÿÿÿxÿ|ÿÿÿ.0119377ÿÿÿ.0077325ÿÿÿÿÿ1.54ÿÿÿ0.123ÿÿÿÿ-.0032177ÿÿÿÿ.0270932
          ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿM1[pid]ÿ|ÿÿÿ.9853309ÿÿÿ.0256148ÿÿÿÿ38.47ÿÿÿ0.000ÿÿÿÿÿ.9351268ÿÿÿÿ1.035535
          ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿ_consÿ|ÿÿ-.0938943ÿÿÿ.0805406ÿÿÿÿ-1.17ÿÿÿ0.244ÿÿÿÿ-.2517511ÿÿÿÿ.0639624
          --------------+----------------------------------------------------------------
          ÿÿvar(M1[pid])|ÿÿÿ.8620651ÿÿÿ.0967787ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.6918007ÿÿÿÿ1.074235
          --------------+----------------------------------------------------------------
          ÿÿÿÿÿvar(e.y1)|ÿÿÿ1.020957ÿÿÿ.0346557ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.9552432ÿÿÿÿ1.091191
          ÿÿÿÿÿvar(e.y2)|ÿÿÿÿ.992011ÿÿÿ.0331088ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.9291958ÿÿÿÿ1.059073
          ÿÿÿÿÿvar(e.y3)|ÿÿÿ.9865697ÿÿÿ.0327174ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.9244843ÿÿÿÿ1.052825
          --------------+----------------------------------------------------------------
          cov(e.y2,e.y1)|ÿÿÿ.5233578ÿÿÿ.0269444ÿÿÿÿ19.42ÿÿÿ0.000ÿÿÿÿÿ.4705477ÿÿÿÿ.5761679
          cov(e.y3,e.y1)|ÿÿÿ.4908664ÿÿÿ.0266868ÿÿÿÿ18.39ÿÿÿ0.000ÿÿÿÿÿ.4385613ÿÿÿÿ.5431716
          cov(e.y3,e.y2)|ÿÿÿ.4875273ÿÿÿÿ.025843ÿÿÿÿ18.86ÿÿÿ0.000ÿÿÿÿÿÿ.436876ÿÿÿÿ.5381786
          -------------------------------------------------------------------------------

          .ÿ
          .ÿexit

          endÿofÿdo-file


          .

          Comment


          • #6
            If you are thinking about a dynamic panel model, the following might be of interest to you:
            • Richard Williams, Paul Allison, and Enrique Moral-Benito. 2015. "Linear Dynamic Panel-Data Estimation using Maximum Likelihood and Structural Equation Modeling". Presented July 30, 2015 at the 2015 Stata Users Conference in Columbus, Ohio.
            Dynamic Panel Data Modeling using Maximum Likelihood
            https://twitter.com/Kripfganz

            Comment

            Working...
            X