Announcement

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

  • Help with Path analysis

    Hi, I need help with Path analysis. First of all
    a) im new to Stata
    b) I never did path analysis
    c) Im a sociologst, so i suck ath math

    I downloaded pathtreg via findit command and I´ve using this FAQ http://www.ats.ucla.edu/stat/stata/faq/pathreg.htm I tried doing a very simple model with just 3 variables and i think it worked

    But i need to be able to do this classic model by Blau and Duncan http://dspace.library.uu.nl/bitstrea...802/image2.gif

    How can i write the hole command to get that ?

    Also, how should i interpret the data ? I´ve tried reading some manuals, but there mostly for mathematicians or statisticians, i need to be able to read understand them in layman´s terms, any recomendations?

    What happens if some cases have missing data?

    Any other advic onPath analysis or Stata in general?

    THANKS!

  • #2
    Hello Joaquin,

    Welcome to the Stata Forum.

    It seems you need to get acquainted with the method (path analysis) and the software (Stata) as well.

    A great start is the Stata manual on SEM (Structural Equation Models). Really didatic.

    By the way, Stata has a quite friendly way to use such models: just type sembuilder in the command window, and you are already with an amazing graphical editor!

    Shall you need excellent books on the matters, I suggest two works that may appeal to a broad audience, even for the ones not interested in stats:

    Principles and Practice of Structural Equation Modeling (Rex Kline, 4 ed., Guilford, 2016)

    Discovering Structural Equation Modeling Using Stata (Alan Acock, StataPress, 2013). For instance, this book presents a whole chapter on how to use the graphical interface.


    Best,

    Marcos
    Best regards,

    Marcos

    Comment


    • #3
      Thanks, ill check all that out!
      That sem builder command seems really helpful!!
      I tried using AMOS on SPSS a couple of times, i was able to make it work but its complicated and i have no real way of knowing if im doing things correctly or not.
      Ill read the manual and ill try to get Kline and Acock, do you have links for that? or are they easily findable online?

      Comment


      • #4
        Also, do you know if theres any difference between using pathreg and using the sembuilder interface ?

        Comment


        • #5
          First off, if you have the data (or the published means, correlations and standard deviations -- in this case you may only need the correlations) -- pathreg would be sufficient to reproduce the results. But sem would also give you a chi-square test of whether the omitted paths differ from 0; and sem lets you do much more complicated models.

          With sem it would also be simple to set up the model. So simple that I might not even bother with the sembuilder, but sembuilder is good as models get more complicated.

          Do you actually have the data, or a link to it? If so the only trick is getting it info a format that sem or pathreg can read.

          I recommend the same sources Marcos does. The sem manual itself is also excellent. For some quicker intros that include some of the math and a bunch of examples, see

          http://www3.nd.edu/~rwilliam/stats2/l62.pdf

          http://www3.nd.edu/~rwilliam/stats2/l95.pdf
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          StataNow Version: 18.5 MP (2 processor)

          EMAIL: [email protected]
          WWW: https://www3.nd.edu/~rwilliam

          Comment


          • #6
            Here is the Acock book. Available as an Ebook if you prefer.

            http://www.stata.com/bookstore/disco...g-using-stata/

            As I think about it, the SEM and pathreg results would probably be similar but not identical. If the paths constrained to be 0 were freed up then I think the results would be identical.
            -------------------------------------------
            Richard Williams, Notre Dame Dept of Sociology
            StataNow Version: 18.5 MP (2 processor)

            EMAIL: [email protected]
            WWW: https://www3.nd.edu/~rwilliam

            Comment


            • #7
              I have the data.
              You are being very helpful, Thanks.
              I think ill be able to make it work, i have to work with the data a little bit more and get acquainted with Stata, pathreg and sem

              Comment


              • #8
                Thanks for the book.
                Also, thanks for the pdf, its really helping me.

                I tested a simpler version of the model using just ISEI scores for Father occupation, Respondat first occupation and respondant current occupation (with some missing values, i still have to work a little bit with the data) i used both pathreg and sem and got exact results (i think) .. what i still havent figured out is how to get sqrt(1 - R2) values with sem. (i havent read the manuals yet, but i will, i m not in a rush to make this work)


                Code:
                 sem (A_isei08PADRE -> A_isei08Primer) (A_isei08PADRE -> A_isei08ENC) (A_isei08Primer -> A_
                > isei08ENC), standardized nocapslatent
                (1796 observations with missing values excluded;
                 specify option 'method(mlmv)' to use all observations)
                
                Endogenous variables
                
                Observed:  A_isei08Primer A_isei08ENC
                
                Exogenous variables
                
                Observed:  A_isei08PADRE
                
                Fitting target model:
                
                Iteration 0:   log likelihood = -19535.358  
                Iteration 1:   log likelihood = -19535.358  
                
                Structural equation model                       Number of obs      =      1517
                Estimation method  = ml
                Log likelihood     = -19535.358
                
                -------------------------------------------------------------------------------------
                                    |                 OIM
                       Standardized |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                --------------------+----------------------------------------------------------------
                Structural          |
                  A_isei08Primer <- |
                      A_isei08PADRE |    .003014   .0256745     0.12   0.907    -.0473071    .0533351
                              _cons |   1.783505   .0628081    28.40   0.000     1.660404    1.906607
                  ------------------+----------------------------------------------------------------
                  A_isei08ENC <-    |
                     A_isei08Primer |  -.0052542   .0230325    -0.23   0.820    -.0503971    .0398888
                      A_isei08PADRE |   .4418273   .0196285    22.51   0.000     .4033562    .4802985
                              _cons |   .9641173   .0715773    13.47   0.000     .8238284    1.104406
                --------------------+----------------------------------------------------------------
                Variance            |
                   e.A_isei08Primer |   .9999909   .0001548                      .9996876    1.000294
                      e.A_isei08ENC |    .804775   .0173453                      .7714868    .8394995
                -------------------------------------------------------------------------------------
                LR test of model vs. saturated: chi2(0)   =      0.00, Prob > chi2 =      .
                .
                
                
                
                . pathreg ( A_isei08Primer A_isei08PADRE) ( A_isei08ENC A_isei08Primer A_isei08PADRE)
                
                -------------------------------------------------------------------------------
                A_isei08Pri~r |      Coef.   Std. Err.      t    P>|t|                     Beta
                --------------+----------------------------------------------------------------
                A_isei08PADRE |   .0027898   .0237808     0.12   0.907                  .003014
                        _cons |   29.55549   .8904392    33.19   0.000                        .
                -------------------------------------------------------------------------------
                                 n = 1517  R2 = 0.0000  sqrt(1 - R2) = 1.0000
                
                --------------------------------------------------------------------------------
                   A_isei08ENC |      Coef.   Std. Err.      t    P>|t|                     Beta
                ---------------+----------------------------------------------------------------
                A_isei08Primer |  -.0066067   .0289904    -0.23   0.820                -.0052542
                 A_isei08PADRE |   .5142379   .0268341    19.16   0.000                 .4418273
                         _cons |    20.0896   1.320493    15.21   0.000                        .
                --------------------------------------------------------------------------------
                                 n = 1517  R2 = 0.1952  sqrt(1 - R2) = 0.8971
                Last edited by Joaquin Carrascosa; 25 Sep 2016, 12:17.

                Comment


                • #9
                  If it was me one of the first things I would do is change the variable names! As for sqrt(1 - R2), note that the standardized residual variances are being reported. If you do

                  Code:
                  . di sqrt(.804775)
                  .89709253
                  you get the same value pathreg reported.

                  You aren't estimating the exact same model as was shown in the earlier diagram, so I can't tell if your replication is perfect or not. Remember, this stuff was done 50 years ago. Little things like whether or not listwise deletion was used across all equations could affect how precise your replication is.
                  -------------------------------------------
                  Richard Williams, Notre Dame Dept of Sociology
                  StataNow Version: 18.5 MP (2 processor)

                  EMAIL: [email protected]
                  WWW: https://www3.nd.edu/~rwilliam

                  Comment


                  • #10
                    One more question, is there a way to get weighted results directly with sem or pathreg? (i have a weight variable, and i think its what stata calls "iweight")
                    I wasnt able to use this weight variable on stata for correlations either.

                    What i think a could do, but would require more work, is doing the weighted correlations in SPSS (i was able to make it work there) and then input that matrix in stata (as shown in the pdf) and then use sem. Is this viable ?

                    Comment


                    • #11
                      SEM supports weight variable (fweights, iweights, and pweights) so you can use it directly. Anyway, you should be careful about the weight variable and understand exactly the meaning of it. Generally, surveys include specific details about the types of the weight variables (read the documentary files of the survey you are using before). I have a guess that your weight variable is population weight so you should add it to the model as pweight. As long as I remember unless you are using the complex samples package in SPSS the default weight is what Stata call frequency weight and while you can apply it for almost all the statistical analysis in SPSS it will probably affect your results.So please be caustios before you are weighting without understanding the meaning of the weight variables and the weight types.

                      Comment


                      • #12
                        When i input this i get an error, how do i have to write the weight command in sem?
                        "option [ not allowed"


                        Code:
                        sem (A_isei08PADRE -> A_isei08Primer) (A_isei08PADRE -> A_isei08ENC) (A_isei08PADRE -> enac_edy) (A_isei08Primer -> A_isei08ENC) (pad_edye -> enac_edy) (enac_edy -> A_isei08Primer) (enac_edy -> A_isei08ENC), standardized cov( pad_edye*A_isei08PADRE) nocapslatent [iweight=pond18]

                        In case it helps, the weight variable values are NOT AN INTEGER.

                        As far as i know (ill try to get more details from the people that did the survey) the weight variable is to increase the amount of cases of a certain age group and diminish the amount of cases on another age group.

                        Comment


                        • #13
                          Originally posted by Joaquin Carrascosa View Post
                          When i input this i get an error, how do i have to write the weight command in sem?
                          "option [ not allowed"
                          Try putting it before the comma.

                          Comment


                          • #14
                            Thanks! it worked

                            Comment


                            • #15
                              Did the data set documentation tell you to use iweights? That would seem very unusual. Pweights are far more common.
                              -------------------------------------------
                              Richard Williams, Notre Dame Dept of Sociology
                              StataNow Version: 18.5 MP (2 processor)

                              EMAIL: [email protected]
                              WWW: https://www3.nd.edu/~rwilliam

                              Comment

                              Working...
                              X