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%3Ecome%20ottenere%20il%20valore%20x%20che%20mi%20d%C3%A0%20il%2050%25%20dell'area%20sotto%20una%20curva%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-418487%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3EHo%20alcuni%20dati%20continui%20e%20ho%20adattato%20una%20curva%20utilizzando%20%22Adatta%20modello%22%20e%20ho%20utilizzato%20gli%20attributi%20%22Effetto%20spline%20annodato%22%20e%2050%20nodi.%20Quindi%20salvo%20la%20formula%20di%20previsione%20nella%20tabella.%20Quello%20che%20voglio%20fare%20dopo%20%C3%A8%20trovare%20la%20dimensione%20del%20frammento%20(valore%20x)%20che%20mi%20d%C3%A0%20il%205%25%2C%2010%25%2C%2025%25%2C%2050%25%2C%2075%25%2C%2090%25%20e%2095%25%20dell'area.%20Ho%2010%20campioni%20e%20quindi%20ho%2010%20equazioni%20molto%20complicate.%3C%2FP%3E%3CP%3ECome%20posso%20ottenere%20la%20dimensione%20del%20frammento%20(valore%20x)%20con%20un'area%20diversa%20sotto%20la%20curva%3F%20Non%20ho%20familiarit%C3%A0%20con%20gli%20script%2C%20quindi%20preferisco%20imparare%20a%20fare%20clic%20con%20il%20mouse%2C%20se%20possibile.%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%3EModellazione%20statistica%20avanzata%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%3ERi%3A%20come%20ottenere%20il%20valore%20x%20che%20mi%20d%C3%A0%20il%2050%25%20dell'area%20sotto%20una%20curva%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-418567%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3Eio%20uso%20questo%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%20esempio%3C%2FA%3E%20per%20illustrare%20un%20approccio.%20Seguo%20le%20istruzioni%20fino%20al%20punto%207.%20Quindi%2C%20dal%20menu%20del%20triangolo%20rosso%20del%20report%2C%20scelgo%20%22Salva%20colonne%22%20%26gt%3B%20%22Formula%20di%20previsione%22.%20Ora%20ottengo%20una%20nuova%20colonna%20e%20la%20formula%20%C3%A8%20la%20funzione%20della%20curva.%20Copia%20la%20formula%20dalla%20colonna.%3C%2FP%3E%0A%3CP%3EOra%20vai%20su%20Scripting%20Index%20e%20trova%20la%20funzione%20%22Integra%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%3EOra%20incolla%20la%20formula%20e%20sostituisci%20la%20parte%20evidenziata%2C%20ottieni%20questo%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%3EOra%20rimuovi%20tutti%20i%20simboli%20dei%20due%20punti%2C%20sostituendo%20i%20due%20punti%20con%20una%20stringa%20vuota.%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%3ESostituisci%20anche%20%22x%22%20con%20%22et%C3%A0%22%2C%20il%20nome%20della%20mia%20variabile%20x.%3C%2FP%3E%0A%3CP%3EOra%20decidi%20dove%20si%20trova%20il%20limite%20superiore%20dell'integrazione%20(100%25)%2C%20diciamo%2080.%20E%20il%20risultato%20%C3%A8%2069%2C783%20per%20il%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%3EOra%20il%20compito%20%C3%A8%20trovare%20un%20numero%20che%20sostituisca%2080%20e%20darmi%20il%2050%25%3A%2069.783%2F2%3D34.8915.%20Ho%20ottenuto%2044.228%20dopo%20forse%20una%20dozzina%20di%20tentativi%20ed%20errori.%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%3ERichiede%20la%20programmazione%20JSL%2C%20ma%20non%20molto%2C%20per%20ottenere%20rapidamente%20risultati%20pi%C3%B9%20precisi.%20Per%20lo%20pi%C3%B9%20ancora%20copia%20e%20incolla.%20Vedere%20la%20seguente%20schermata.%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%20chiave%20%C3%A8%20trovare%20il%20valore%20che%20minimizzi%20la%20differenza%20al%20quadrato%20tra%20l'integrale%20e%20il%20valore%20target%2034%2C8919.%20Quindi%20racchiudo%20la%20differenza%20tra%20l'integrale%20e%20l'obiettivo%20all'interno%20di%20un%20quadrato%2C%20quindi%20chiamo%20la%20funzione%20minimizza.%20Controlla%20la%20documentazione%20della%20funzione%20per%20la%20sintassi.%20Il%20risultato%20per%20il%2050%25%20%C3%A8%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.