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%3Ecomment%20obtenir%20la%20valeur%20x%20qui%20me%20donne%2050%26nbsp%3B%25%20de%20l'aire%20sous%20une%20courbe%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-418487%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3EJ'ai%20des%20donn%C3%A9es%20continues%20et%20j'ajuste%20une%20courbe%20en%20utilisant%20%22Ajuster%20le%20mod%C3%A8le%22%20et%20j'utilise%20les%20attributs%20%22Effet%20Spline%20nou%C3%A9e%22%20et%2050%20n%C5%93uds.%20Ensuite%2C%20j'enregistre%20la%20formule%20de%20pr%C3%A9diction%20dans%20le%20tableau.%20Ce%20que%20je%20veux%20faire%20ensuite%2C%20c'est%20trouver%20la%20taille%20du%20fragment%20(valeur%20x)%20qui%20me%20donne%205%26nbsp%3B%25%2C%2010%26nbsp%3B%25%2C%2025%26nbsp%3B%25%2C%2050%26nbsp%3B%25%2C%2075%26nbsp%3B%25%2C%2090%26nbsp%3B%25%20et%2095%26nbsp%3B%25%20de%20la%20surface.%20J'ai%2010%20%C3%A9chantillons%20et%20j'ai%20donc%2010%20%C3%A9quations%20tr%C3%A8s%20compliqu%C3%A9es.%3C%2FP%3E%3CP%3EComment%20puis-je%20obtenir%20la%20taille%20du%20fragment%20(valeur%20X)%20avec%20diff%C3%A9rentes%20zones%20sous%20la%20courbe%26nbsp%3B%3F%20Je%20ne%20suis%20pas%20familier%20avec%20les%20scripts%2C%20je%20pr%C3%A9f%C3%A8re%20donc%20apprendre%20le%20clic%20de%20souris%20si%20possible.%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%3EMod%C3%A9lisation%20statistique%20avanc%C3%A9e%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%3ERe%3A%20comment%20obtenir%20la%20valeur%20x%20qui%20me%20donne%2050%25%20d'aire%20sous%20une%20courbe%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-418567%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3Ej'utilise%20%C3%A7a%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%20exemple%3C%2FA%3E%20pour%20illustrer%20une%20approche.%20Je%20suis%20les%20instructions%20jusqu'%C3%A0%20l'%C3%A9tape%207.%20Ensuite%2C%20dans%20le%20menu%20triangle%20rouge%20du%20rapport%2C%20je%20choisis%20%22Enregistrer%20les%20colonnes%22%20%26gt%3B%20%22Formule%20de%20pr%C3%A9diction%22.%20Maintenant%2C%20j'obtiens%20une%20nouvelle%20colonne%20et%20la%20formule%20est%20la%20fonction%20de%20la%20courbe.%20Copiez%20la%20formule%20de%20la%20colonne.%3C%2FP%3E%0A%3CP%3EMaintenant%2C%20allez%20dans%20Scripting%20Index%20et%20recherchez%20la%20fonction%20%22Integrate%22.%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%3ECollez%20maintenant%20la%20formule%20et%20remplacez%20la%20partie%20en%20surbrillance%2C%20obtenez%20ceci%26nbsp%3B%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%3ESupprimez%20maintenant%20tous%20les%20symboles%20deux-points%2C%20en%20rempla%C3%A7ant%20deux-points%20par%20une%20cha%C3%AEne%20vide.%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%3ERemplacez%20%C3%A9galement%20%22x%22%20par%20%22age%22%2C%20mon%20nom%20de%20variable%20x.%3C%2FP%3E%0A%3CP%3ED%C3%A9cidez%20maintenant%20o%C3%B9%20se%20situe%20la%20limite%20sup%C3%A9rieure%20de%20l'int%C3%A9gration%20(100%25)%2C%20disons%2080.%20Et%20le%20r%C3%A9sultat%20est%2069%2C783%20pour%20100%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%3EMaintenant%2C%20la%20t%C3%A2che%20consiste%20%C3%A0%20trouver%20un%20nombre%20pour%20remplacer%2080%20et%20%C3%A0%20me%20donner%2050%26nbsp%3B%25%26nbsp%3B%3A%2069%2C783%2F2%20%3D%2034%2C8915.%20J'ai%20obtenu%2044%2C228%20apr%C3%A8s%20peut-%C3%AAtre%20une%20douzaine%20d'essais%20et%20d'erreurs.%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%3EIl%20n%C3%A9cessite%20une%20programmation%20JSL%2C%20mais%20pas%20beaucoup%2C%20pour%20obtenir%20rapidement%20un%20r%C3%A9sultat%20plus%20pr%C3%A9cis.%20Surtout%20toujours%20copier%20et%20coller.%20Voir%20la%20capture%20d'%C3%A9cran%20suivante.%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%3ELa%20cl%C3%A9%20est%20de%20trouver%20la%20valeur%20qui%20minimise%20la%20diff%C3%A9rence%20au%20carr%C3%A9%20entre%20l'int%C3%A9grale%20et%20la%20valeur%20cible%2034%2C8919.%20J'enveloppe%20donc%20la%20diff%C3%A9rence%20entre%20l'int%C3%A9grale%20et%20la%20cible%20%C3%A0%20l'int%C3%A9rieur%20d'un%20carr%C3%A9%2C%20puis%20j'appelle%20la%20fonction%20de%20r%C3%A9duction.%20Consultez%20la%20documentation%20de%20la%20fonction%20pour%20la%20syntaxe.%20Le%20r%C3%A9sultat%20pour%2050%20%25%20est%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.