cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
%3CLINGO-SUB%20id%3D%22lingo-sub-418487%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3EWie%20erhalte%20ich%20den%20x-Wert%2C%20der%20mir%2050%20%25%20der%20Fl%C3%A4che%20unter%20einer%20Kurve%20ergibt%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-418487%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3EIch%20habe%20einige%20kontinuierliche%20Daten%20und%20passe%20eine%20Kurve%20mit%20%E2%80%9EModell%20anpassen%E2%80%9C%20an%20und%20verwende%20die%20Attribute%20%E2%80%9EKnotted%20Spline%20Effect%E2%80%9C%20und%2050%20Knoten.%20Dann%20speichere%20ich%20die%20Vorhersageformel%20in%20der%20Tabelle.%20Als%20n%C3%A4chstes%20m%C3%B6chte%20ich%20die%20Fragmentgr%C3%B6%C3%9Fe%20(x-Wert)%20ermitteln%2C%20die%20mir%205%20%25%2C%2010%20%25%2C%2025%20%25%2C%2050%20%25%2C%2075%20%25%2C%2090%20%25%20und%2095%20%25%20der%20Fl%C3%A4che%20ergibt.%20Ich%20habe%2010%20Stichproben%20und%20damit%2010%20sehr%20komplizierte%20Gleichungen.%3C%2FP%3E%3CP%3EWie%20erhalte%20ich%20die%20Fragmentgr%C3%B6%C3%9Fe%20(x-Wert)%20bei%20unterschiedlicher%20Fl%C3%A4che%20unter%20der%20Kurve%3F%20Da%20ich%20mit%20Skripten%20nicht%20vertraut%20bin%2C%20lerne%20ich%2C%20wenn%20m%C3%B6glich%2C%20lieber%20die%20Mausklick-Methode.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202021-09-15%20161811.png%22%20style%3D%22width%3A%20414px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202021-09-15%20161811.png%22%20style%3D%22width%3A%20414px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F35837iAEE33E38FA310F7E%2Fimage-dimensions%2F414x636%3Fv%3Dv2%22%20width%3D%22414%22%20height%3D%22636%22%20role%3D%22button%22%20title%3D%22Screenshot%202021-09-15%20161811.png%22%20alt%3D%22Screenshot%202021-09-15%20161811.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-418487%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CLINGO-LABEL%3EErweiterte%20statistische%20Modellierung%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-418567%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Wie%20bekomme%20ich%20den%20x-Wert%2C%20der%20mir%2050%25%20der%20Fl%C3%A4che%20unter%20einer%20Kurve%20gibt%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-418567%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3Eich%20benutze%20das%3CA%20href%3D%22https%3A%2F%2Fwww.jmp.com%2Fsupport%2Fhelp%2Fen%2F16.1%2Findex.shtml%23page%2Fjmp%2Fknotted-spline-effect-example.shtml%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3E%20Beispiel%3C%2FA%3E%20um%20einen%20Ansatz%20zu%20veranschaulichen.%20Ich%20folge%20den%20Anweisungen%20bis%20Schritt%207.%20Dann%20w%C3%A4hle%20ich%20aus%20dem%20roten%20Dreiecksmen%C3%BC%20des%20Berichts%20%E2%80%9ESpalten%20speichern%E2%80%9C%20%26gt%3B%20%E2%80%9EVorhersageformel%E2%80%9C.%20Jetzt%20bekomme%20ich%20eine%20neue%20Spalte%2C%20und%20die%20Formel%20ist%20die%20Funktion%20der%20Kurve.%20Kopieren%20Sie%20die%20Formel%20aus%20der%20Spalte.%3C%2FP%3E%0A%3CP%3EGehen%20Sie%20nun%20zum%20Scripting%20Index%20und%20suchen%20Sie%20die%20Funktion%20%E2%80%9EIntegrieren%E2%80%9C.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22peng_liu_1-1631762883318.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22peng_liu_1-1631762883318.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22peng_liu_1-1631762883318.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22peng_liu_1-1631762883318.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F35852i2FE6BCA02301B5C4%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22peng_liu_1-1631762883318.png%22%20alt%3D%22peng_liu_1-1631762883318.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EF%C3%BCgen%20Sie%20nun%20die%20Formel%20ein%20und%20ersetzen%20Sie%20den%20hervorgehobenen%20Teil%2C%20erhalten%20Sie%20Folgendes%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22peng_liu_2-1631762981590.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22peng_liu_2-1631762981590.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22peng_liu_2-1631762981590.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22peng_liu_2-1631762981590.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F35853i981E93B8AA9A7454%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22peng_liu_2-1631762981590.png%22%20alt%3D%22peng_liu_2-1631762981590.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EEntfernen%20Sie%20nun%20alle%20Doppelpunktsymbole%2C%20indem%20Sie%20den%20Doppelpunkt%20durch%20eine%20leere%20Zeichenfolge%20ersetzen.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22peng_liu_3-1631763183428.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22peng_liu_3-1631763183428.png%22%20style%3D%22width%3A%20365px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22peng_liu_3-1631763183428.png%22%20style%3D%22width%3A%20365px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22peng_liu_3-1631763183428.png%22%20style%3D%22width%3A%20365px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F35854i8FCD7A8DDEBB9C46%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22peng_liu_3-1631763183428.png%22%20alt%3D%22peng_liu_3-1631763183428.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EErsetzen%20Sie%20auch%20%22x%22%20durch%20%22Alter%22%2C%20meinen%20x-Variablennamen.%3C%2FP%3E%0A%3CP%3EEntscheiden%20Sie%20nun%2C%20wo%20die%20Obergrenze%20der%20Integration%20(100%25)%20liegt%2C%20sagen%20wir%2080.%20Und%20das%20Ergebnis%20ist%2069%2C783%20f%C3%BCr%20100%20%25.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22peng_liu_5-1631763270010.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22peng_liu_5-1631763270010.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22peng_liu_5-1631763270010.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22peng_liu_5-1631763270010.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F35856i9285E4DB7A646E5D%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22peng_liu_5-1631763270010.png%22%20alt%3D%22peng_liu_5-1631763270010.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EJetzt%20ist%20die%20Aufgabe%2C%20eine%20Zahl%20zu%20finden%2C%20die%2080%20ersetzt%2C%20und%20mir%2050%20%25%20zu%20geben%3A%2069%2C783%2F2%3D34%2C8915.%20Ich%20habe%2044.228%20nach%20vielleicht%20einem%20Dutzend%20Versuchen%20und%20Fehlern%20erhalten.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22peng_liu_6-1631763432932.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22peng_liu_6-1631763432932.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22peng_liu_6-1631763432932.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22peng_liu_6-1631763432932.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F35857iED72FE1B7223CAE5%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22peng_liu_6-1631763432932.png%22%20alt%3D%22peng_liu_6-1631763432932.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EEs%20erfordert%20JSL-Programmierung%2C%20aber%20nicht%20viel%2C%20um%20schnell%20ein%20pr%C3%A4ziseres%20Ergebnis%20zu%20erhalten.%20Meistens%20noch%20kopieren%20und%20einf%C3%BCgen.%20Siehe%20folgenden%20Screenshot.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22peng_liu_9-1631764338721.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22peng_liu_9-1631764338721.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22peng_liu_9-1631764338721.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22peng_liu_9-1631764338721.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F35860i35CEB26C3BD53D54%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22peng_liu_9-1631764338721.png%22%20alt%3D%22peng_liu_9-1631764338721.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EDer%20Schl%C3%BCssel%20liegt%20darin%2C%20den%20Wert%20zu%20finden%2C%20der%20die%20quadrierte%20Differenz%20zwischen%20dem%20Integral%20und%20dem%20Zielwert%2034%2C8919%20minimiert.%20Also%20packe%20ich%20die%20Differenz%20zwischen%20dem%20Integral%20und%20dem%20Ziel%20in%20ein%20Quadrat%20und%20rufe%20dann%20die%20Minimierungsfunktion%20auf.%20Sehen%20Sie%20sich%20die%20Funktionsdokumentation%20f%C3%BCr%20die%20Syntax%20an.%20Das%20Ergebnis%20f%C3%BCr%2050%20%25%20ist%2044%2C226900491921.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
dtsang
Level I

how to get the x-value which gives me 50% of area under a curve

I have some continuous data and I fit a curve using "Fit Model" and used attributes "Knotted Spline Effect" and 50 knots. Then I save the prediction formula to the table. What I want to do next is to find the fragment size (x-value) which gives me 5%, 10%, 25%, 50%, 75%, 90% and 95% of area. I have 10 samples and so I have 10 very complicated equations.

How do I get the fragment size (x-value) with different area under the curve? I am not familiar with scripts so I prefer learning the mouse clicking way if possible.

 

Screenshot 2021-09-15 161811.png

1 REPLY 1
peng_liu
Staff

Re: how to get the x-value which gives me 50% of area under a curve

I use this example to illustrate one approach. I follow the instructions up to step 7. Then from the red triangle menu of the report, I choose "Save Columns" > "Prediction Formula". Now I get a new column, and the formula is the function of the curve. Copy the formula from the column.

Now go to Scripting Index, and find "Integrate" function.

peng_liu_1-1631762883318.png

Now paste the formula and replace the highlighted part, get this:

peng_liu_2-1631762981590.png

Now remove all the colon symbols, by replacing colon by empty string.

peng_liu_3-1631763183428.png

Also replace "x" by "age", my x variable name.

Now decide where the upper limit of the integration (100%), say 80. And the result is 69.783 for 100%.

peng_liu_5-1631763270010.png

Now the task is to find a number to replace 80, and give me 50%: 69.783/2=34.8915. I got 44.228 after maybe a dozen try and error.

peng_liu_6-1631763432932.png

It requires JSL programming, but not much, to get more precise result quickly. Mostly still copy and paste. See the following screenshot.

peng_liu_9-1631764338721.png

The key is to find the value that minimize the squared difference between integral and the target value 34.8919. So I wrap the difference between integral and the target inside of a square, then call minimize function. Check out the function documentation for the syntax. The result for 50% is 44.226900491921.