Announcement

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

  • How to adjust for a covariate in a path analysis using the sem builder

    Hi,

    I am using the sembuilder to for a path analysis and I can't quite figure out how one would adjust "the whole model" for a covariate such as sex.
    I know how to do this using the sem command, but from what I can see I have to specify all assocaitions with sex in the sembuilder - isnt there a way to adjust for it overall?

    See the image attached for an example where I have just added an association of sex with my mediators, but there could potentially be more - do I have to add paths for every single one of them?
    Thank you very much in advance.

    Click image for larger version

Name:	sem.JPG
Views:	1
Size:	71.5 KB
ID:	1393553



  • #2
    I'm not quite sure what you mean by "there could potentially be more." Given the model you have drawn,. you are treating klokkestaet and eatdrink_2hrs as exogenous (they are not on the left side of any equation so that you are treating them as "pre-determined") and you are further asserting that they are independent of the various other exogenous variables, including sex. Is that what you want? Also, you are asserting that all of the effects of sex on the outcome are indirect via the set of intervening variables. That hypothesis is easily tested by just estimating the relevant path. So, I don't quite see what the issue is. Finally, your model asserts that e2 - e5 are independent. Do you intend that?
    Richard T. Campbell
    Emeritus Professor of Biostatistics and Sociology
    University of Illinois at Chicago

    Comment


    • #3
      Originally posted by Dick Campbell View Post
      I'm not quite sure what you mean by "there could potentially be more." Given the model you have drawn,. you are treating klokkestaet and eatdrink_2hrs as exogenous (they are not on the left side of any equation so that you are treating them as "pre-determined") and you are further asserting that they are independent of the various other exogenous variables, including sex. Is that what you want? Also, you are asserting that all of the effects of sex on the outcome are indirect via the set of intervening variables. That hypothesis is easily tested by just estimating the relevant path. So, I don't quite see what the issue is. Finally, your model asserts that e2 - e5 are independent. Do you intend that?
      Thank you for your reply.

      "Given the model you have drawn,. you are treating klokkestaet and eatdrink_2hrs as exogenous (they are not on the left side of any equation so that you are treating them as "pre-determined") and you are further asserting that they are independent of the various other exogenous variables, including sex. Is that what you want?" Yes, they are there to adjust for natural variation in my outcome and I have no reason to believe they depend on any of my other variables

      "Also, you are asserting that all of the effects of sex on the outcome are indirect via the set of intervening variables. That hypothesis is easily tested by just estimating the relevant path."
      Thats the issue, I don't necessarily want to test a hypothesis, but just to be able to generalize across sex - I am not necessarily interested in the specific path from sex, and would like to create the simplest possible model, omitting associations that I have no hypotheses about.

      Regarding the error terms - I suppose I could let some of them correlate but I wouldn't necessarily expect them to be - maybe this is just because of my lack of experience using sem

      Comment


      • #4
        OK, but if you estimate this model (I assume you have) the value of the multi df chi-square for the goodness of fit test has three sources: (a) the fixed zeros in the associations among the exogenous variables, (b) the fixed zeros among the error terms and (c) the fixed zero for the effect of sex on the outcome. Of these, I would think that (c) is the most interesting while (a) and (b) are incidental. So, if your model fails to fit, you will not be sure exactly why without further exploration, e.g, by looking at the modification indices. With regard to (b) the model is still identified if you allow the errors to correlate and you may actually gain some efficiency in the form or reduced standard errors Of course all this p-grubbing is frowned upon these days
        Richard T. Campbell
        Emeritus Professor of Biostatistics and Sociology
        University of Illinois at Chicago

        Comment


        • #5
          Thank you for taking time for this.
          As I am sure you can tell, I am relatively new to Stata and statistics. If you have time, I would be very interested to hear your opinion on the below - if not, I understand of course.

          So the chi sq tests whether or not the model reflects the data. I have to say, I almost wouldn't expect this model to fit the data very well - at least not to the point of passing a test. My outcome is a cumulative biological index measure and my predictors are either psychological or socioeconomic - while they do explain something of course, I would expect by far most of the data to be unexplained by the model I have constructed based on previous findings and hypotheses. As I see it, that doesn't make it irrelevant to test or report - and (as I guess you are referring to with the "p-grubbing") I don't necessarily consider achieving highly significant results the aim for fitting such a model, depending on the context.

          Thus, I have to admit that I don't pay much attention to the chi sq test for fit, because I have a relatively large sample and recently participated in a course where they suggested looking at RMSEA and CFI & TLI. These are okay for the above model. I realize (as is also clear here in the forum, e.g. http://www.stata.com/statalist/archi.../msg00519.html) that there are different opinions on this, which I expect depend upon field of research, for one.

          All this being said - my initial question was based on the fact that I originally used sem command rather than the builder, and adjusted for the covariates like this:
          sem (MV <- IV CV1 CV2)(DV <- MV IV CV1 CV2) as is suggested here https://stats.idre.ucla.edu/stata/fa...e-sem-command/

          When doing this in the sembuilder, it occured to me that this was equivalent to adding paths from sex to every variable except the initial expousre (ses_dk). I don't necessarily want to do that - but I am asking if this is what you would have to do (in the builder) if you want to adjust for covariates in the same way as in the above command.

          Comment


          • #6
            It's a bit difficult to respond to this in a useful way because the variable names in your path diagram are not the same as the names in the SEM command. Let me just add a few comments to my previous posts.
            1. You are right about chi-square not being the best way to evaluate fit; it is sensitive to sample size and doesn't tell you all that you want to know. Still, you do want to pay attention to the p value.
            2. It's (too) easy to get that p value to non-significance by adding paths that are trivially small and that you are not interested in. On other hand, there is no reason not to estimate the coefficients I have mentioned -- the correlations among the errors for the four intervening variables in your model and the correlations involving exogenous variables. If for no other reason, you should do it so you can learn from what happens when you do so. You have probably looked at these associations and found them to be null, but I would still estimate them. From an SEM perspective, there is little cost to doing so.
            3. I don't know of your diagram shows raw or standardized coefficients and there are no sig. tests shown, but it looks to me like SES affects the outcome to a great extent that any of the scale scores.
            Richard T. Campbell
            Emeritus Professor of Biostatistics and Sociology
            University of Illinois at Chicago

            Comment


            • #7
              Hi everyone,
              I am running for the first time a SEM model with 4 observed variables. My aim is to test the bidirectional effects of eating behaviors in two different time-points (7 and 10 years - CEBQ-EF at 7 and 10 years) and fat free mass at these ages as well (FFM at 7 and 10 years). I was able to build a model (see below) and the command is the following:

              sem (EF_m -> EF_m_120m, ) (EF_m -> Claseyffm, ) (FFM_84m_calc -> EF_m_120m, ) (FFM_84m_calc -> Claseyffm, ), standardized cov( EF_m*FFM_84m_calc e.EF_m_120m*e.Claseyffm) nocapslatent

              Click image for larger version

Name:	SEM_EF.png
Views:	1
Size:	57.0 KB
ID:	1567241
              Now, in order to adjust for covariates, such as child sex, maternal age, education and BMI, I would have to build separate paths and include these variables? For example:
              sem (EF_m -> sex, ) (EF_m -> age, ) (EF_m -> educ, ) (EF_m -> bmi, ) (EF_m sex age educ bmi -> EF_m_120m, ), nocapslatent
              Would that we correct?

              Thank you very much in advance!! Would appreciate some thoughts on this

              Best,

              Sarah
              Last edited by Sarah Warkentin; 06 Aug 2020, 03:22.

              Comment

              Working...
              X