+ Reply to Thread
Results 1 to 8 of 8

Thread: Graphing nonlinear results

  1. #1
    Points: 5,049, Level: 45
    Level completed: 50%, Points required for next Level: 101

    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Graphing nonlinear results




    Not sure as newbie where to best post this question. A graph in a psychology article has a graph for survey scores. Would like to figure out formula of nonlinear (curving) line based on X,Y values displayed so that I could create a graph, place new scores on that line based on only having X, not Y. So formula would need to be Y = ? Plug in new X values and get new Y values. Have researched quadratic regression formulas since they look most like graph in article, but so far no joy. My statistical analysis skills are limited.
    Here's the article PDF which includes the graph (Figure 1):https://www.google.com/url?url=http:...ruTHvQ&cad=rja

    Would appreciate any suggestions on how to derive a formula from the data points given in the graph that can be used to get Y when a new X (score) is known.

    Thank you.

    Best Wishes,

  2. #2
    TS Contributor
    Points: 12,501, Level: 73
    Level completed: 13%, Points required for next Level: 349
    rogojel's Avatar
    Location
    I work in Europe, live in Hungary
    Posts
    1,491
    Thanks
    162
    Thanked 334 Times in 314 Posts

    Re: Graphing nonlinear results

    hi,
    there are several ways to solve this: most statistics SW have curve fitting possibilities, or you could generate a curve by using line segments or splines etc., or you could guess the marhematical form if the curve (looks like an exponential or power curve to me) and try the regression directly.

    regards

  3. #3
    Points: 5,049, Level: 45
    Level completed: 50%, Points required for next Level: 101

    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Graphing nonlinear results

    Hi Rogojel,

    Thank you for these suggestions. When I plot the data in Excel, and use trend line, the closest fit is exponential. The equation is:

    y= 73.128e^-0.831x
    R^2= 0.9997

    My Excel and my math skills are limited. All I have are X values to enter into any equation, so I am not sure how to use this curve equation? Not sure what value to enter for e or how to use R^2 equation (maybe no need to use R^2 equation; maybe it is only how close the curve fits?). But still would need e.

    (I am trying to get an equation that I can use in an eLearning lesson. The eLearning lesson cannot use Excel. So the equation would need any equation components like e to be specified in non-Excel terms. Cannot use Excel functions in the lesson. Only can use standard math equations.)

    Again, thank you for your help.

    Best Wishes,
    Last edited by saratogacoach; 07-21-2017 at 11:53 AM.

  4. #4
    Omega Contributor
    Points: 39,242, Level: 100
    Level completed: 0%, Points required for next Level: 0
    hlsmith's Avatar
    Location
    Not Ames, IA
    Posts
    7,094
    Thanks
    405
    Thanked 1,202 Times in 1,163 Posts

    Re: Graphing nonlinear results

    I am confused in that the article did something very different.


    One thing to look out for if you want to be able to interpolate is using a regression approach that isn't too fitted like splines or general additive models. Issues can be related to interpreting what a sigmoidal line means when then increase sporadically. Though using transformations and polynomials can help in making sure you get interpretable coefficients.


    It is all about trying to understand the underlying data generating process that you are try to fit a function to. So, why is it the shape it is.
    Stop cowardice, ban guns!

  5. #5
    Points: 5,049, Level: 45
    Level completed: 50%, Points required for next Level: 101

    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Graphing nonlinear results

    Hi,

    Thank you for writing back. I was confused by the graph's Axis Y values, which are 1-3, 3-4, 4-5, 5-6, yet the illustration (Figure 1) shows equidistant marks. The only data available is in the article (was not able to find any online supplemental data, haven't yet heard back from author for my inquiry asking for additional data/information.)

    My goal for the eLearning lesson is to display new results if a survey is done by the lesson taker. Using JavaScript and hopefully the curve's equation, I would try to automate placing a indicator over the new score's X,Y coordinates. The score only produces an X coordinate, so I need a way (equation?) to approximate the score's Y value in order to have the JavaScript move the indicator to that X,Y location.

    So far, no joy. I haven't been able to extrapolate an equation from the article's graph or data to get this working. I can place the indicator using an X on one axis but need the associated Y to place it on the other axis.

    Maybe not possible without more data (or better math skills )?

    Best Wishes,

  6. #6
    Points: 5,049, Level: 45
    Level completed: 50%, Points required for next Level: 101

    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Graphing nonlinear results

    One item that I would like to try but don't know how is to try the above equation:

    y= 73.128e^-0.831x

    The equation would need to be put into a plain math language so I could use it in JavaScript.

    I don't know how to write out y= 73.128e^-0.831x, especially the exponent part to use in a formula? Is the exponent -0.831x mean -0.831*-0.831/x or something else with square roots?

    Any help re-writing this equation so I can try it would be appreciated.

    Thank you.

  7. #7
    TS Contributor
    Points: 12,501, Level: 73
    Level completed: 13%, Points required for next Level: 349
    rogojel's Avatar
    Location
    I work in Europe, live in Hungary
    Posts
    1,491
    Thanks
    162
    Thanked 334 Times in 314 Posts

    Re: Graphing nonlinear results

    hi,
    y= 73.128e^-0.831x means 73.228*exp(-0.841*x) - that should be easy program. This will predict the mean value of the y for the given x. To generate individual values you would need to add a small normal random variable to this mean, such that the mean of the random variable is 0 and the std dev a small number. You could work out the real stddev based on the R squared, but for just showing it in a teaching session I would try a few small numbers and take what looks reasonably similar to the original.

  8. #8
    Points: 5,049, Level: 45
    Level completed: 50%, Points required for next Level: 101

    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Graphing nonlinear results


    Thank you, rogojel.

    I have been trying this formula and several other variations, but so far I am not able to get new Y values to position at their correct location on the line. Not even close. The X location works OK but the Y is off by a lot.

    I think that I will need to find another way to display score results in the lesson. Maybe at some point I will hear back from the article author and receive some additional data which could help me create the graph?

    Thank you again for your kind help.

    Best Wishes,

+ Reply to Thread

           




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts






Advertise on Talk Stats