Announcement

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

  • SEM and nonlinear regression

    Hello everyone.

    Earlier, I used 'Stata' to build non-linear regressions.
    Recently, I started using 'SEM' to solve new problems. I understood a bit the features that I need in 'SEM'. But I do not understand how to do what I did earlier in 'SEM'.

    For example
    To build a non-linear regression, I enter:
    nl( Y = {c}+{x1}*x1+{x2}*x2+{x3}*x3+{x4}*x4)

    In SEM :
    sem (Y <- x1 x2 x3 x4)

    In another case:
    nl( Y = {c}+{x1}*ln(x1)+{x2}*sqrt(x2)+{x3}*x3+{x3}*x3*{x4} *x4)

    But i don't know how to use 'sqrt', 'ln', and multiplication x3*x4 in SEM.

    I read many different articles and topics, tried a lot of command options, but without success. Maybe I missed something or misunderstood, I apologize. But I hope for your help.
    Thank you.

  • #2
    -sem- is a linear system estimator, and -nl- is single equation non-linear estimator. (-nlsur- is a non-linear system estimator.)

    -sem- is not able to estimate nonlinear relationships, it is a linear estimator.

    Comment


    • #3
      Joro Kolev Thank you! I assumed this, but some examples using # and others misled me. My misstake.

      I need 'SEM' to build models like:
      Y= c1 + b11 * x1 + b12 * x2 + b13 * x3 + ...b1N * xN + e1
      x1 = c2 + b22 * x2 + b23 * x3 + b2N * xN + e2 (or without const)

      Can you tell me which functions I can use for this?

      Comment


      • #4
        Originally posted by Artyom Mikhaylin View Post
        Joro Kolev Thank you! I assumed this, but some examples using # and others misled me. My misstake.

        I need 'SEM' to build models like:
        Y= c1 + b11 * x1 + b12 * x2 + b13 * x3 + ...b1N * xN + e1
        x1 = c2 + b22 * x2 + b23 * x3 + b2N * xN + e2 (or without const)

        Can you tell me which functions I can use for this?
        Seems like a standard linear system, so -sem- and -reg3- would both do the job.

        And in the equation of x1 you need at least one explanatory variable which is not included in the equation of Y.

        Comment


        • #5
          Or if you were asking for the syntax of -sem-, just look at their diagrams and examples.

          sem (Y <- x1 x2 etc) (x1 <- x2 x3 etc. )

          Comment


          • #6
            Joro Kolev Yes, it's standard linear system. And i can build such systems.
            Sorry, I forgot to clarify that in doing so I need to use 'ln' or 'sqrt' or multiplication, that is, the system will be nonlinear.
            I specify the system

            Y= c1 + b11 * ln(x1) + b12 * sqrt(x2) + b13 * x3 +b14* x3 *x4+ ...b1N * xN + e1
            x1 = c2 + b22 * x2 + b23 * x3 + b2N * xN + e2

            I apologize for not writing right away.

            Comment


            • #7
              In econometrics, systems are (mostly) called linear when they are linear in the parameters.

              So you just pre-generate your variables, e.g.,

              gen sqX = sqrt(X)

              gen lnX = log(X)

              and then you use in your linear (in the parameters) system the generated variables.

              Comment


              • #8
                Joro Kolev Thank you very much! Everything worked out. Similarly, I implemented multiplication, e.g.,

                gen mp12=x1*x2

                Do I understand correctly that it is impossible to realize the multiplication of this type as in regression: {x1}*x1*{x2}*x2 ?

                Thank you for your help and patience!

                Comment


                • #9
                  Could I get some clarification here?
                  If there is a non-linear transformation is required, such as x^2 or x^3, in the SEM model then would you not need to use the nlcom postestimation to get the one coefficient?

                  Code:
                  sem (y <- x x2)
                  nlcom _b[x]*_b[x2]
                  On a similar string, I am also curious how one would deal with a non-linear mediator (z) on our outcome (y), but this same mediator is linear with the other covariate (x)? I am guessing that there is an assumption here from my readingsthat I have missed.
                  e.g.

                  Code:
                  sem (y <- z z2) (x -> z z2) *there may be no direct link between y and x.
                  nlcom _b[z]*_b[z2]

                  Comment


                  • #10
                    My question doesn't relate to SEM and nonlinear regression but towards nlcom I am trying to estimate the Intergenerational Correlation (IGC) in education using nlcom but cannot figure out how to

                    \[ IGC : \rho_{IG}= \beta1 * \frac{\sigma_{parent}}{\sigma_{child}} \]

                    Where PIG = Intergenerational Correlation (IGC),

                    Beta1 = intergenerational regression coefficient (IGRC) coming from estimating

                    \[ Edu_{i,g} = \beta_{0}+ \beta_{1}Edu_{i,parent}+\beta_{2}Edu_{i,grandparen t} + \epsilon_{ig} \]

                    and Sigma= standard deviation of the parent/child


                    Comment

                    Working...
                    X