Announcement

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

  • Solve an equation using a dataset of parameters

    Hello,

    I am trying to solve X from the following nonlinear equation using a dataset of parameters--a, b, c.

    a+ (b-x)/(1+x)^2 + (c-x)/x*(1+x)^11=0

    I also want to save the solution(s) which is a positive real number to a dataset.


    *Example parameter dataset: ABC

    clear

    input a b c

    1.1 1.2 1.4

    2.1 2.3 2.7

    1.5 2.1 2.5

    1.6 2.2 1.9

    end


    I wonder how to do it in STATA. Thanks in advance.





  • #2
    HTML Code:
    https://www.stata.com/support/faqs/programming/system-of-nonlinear-equations/

    Comment


    • #3
      Thank you, George. The codes you suggested are used to solve a system of equations. My question is to solve a single nonlinear equation. There is only one unknown variable, X, and I have a dataset of parameter a, b, c for the equation.

      For example, I have 10 sets of (a, b, c) and want to solve out the X from the following equation for each set of (a, b, c).

      a+ (b-x)/(1+x)^2 + (c-x)/x*(1+x)^11=0



      Comment


      • #4
        Alter the code for one equation.

        Comment

        Working...
        X