
Need help trying to figure some logic fro a websit
http://www.sfar.org/scores2/mpm_cancer2.html<BR><BR>This is a site which has a scoring system and i had recreate locally because i have to store the values in our database. At the bottom right hand is the total(Logit on website). I can't for the life of me figure out the logic they used. I went into the source code and it confused me more. If anyone could help i'd appreciate it. If you want u can plugin your own numbers if it makes it easier. Any help will do!!! <BR>Thanks in advance.

RE: Need help trying to figure some logic fro a we
It says how they do it:<BR><BR>Logit = Sum ( values * beta) + 0.21935 ln( days+ 0.5) 0.43417<BR>Predicted death rate = e(logit) / ( 1 + e (Logit) )<BR><BR>Seems pretty straightforward to me...<BR><BR>Craig.

RE: Need help trying to figure some logic fro a we
Right but have u tried to do it, it doesn't add up or what does "0.21935 In(days + .05).43417" mean? The "In"? and are they referring to "number of days before ICU" for "(days+.05)" and are they multiplying ".43417" or subtracting? Looks straight forward until you start putting numbers or try to figure the answer out so i can implement it formula in my project.

RE: Need help trying to figure some logic fro a we
You have their actual JS functions. Just do a 'View Source' and you'll see them.<BR><BR><SCRIPT LANGUAGE=javascript>function CalcRCP(form) {<BR>form.zrcp.value = form.rcp[form.rcp.selectedIndex].value<BR>form.zrcp.value = CalcRcp(form)<BR>form.zmort.value = CalcMort(form)<BR><BR>etc..........

Not "IN", "ln".
That's "L" "N". ln. A mathematical term. From memory it's a log with base e (where e is another mathematical term).<BR>http://www.google.com/search?hl=en&lr=&ie=UTF8&c2coff=1&q=define%3Aln&btnG=Search<BR>You want " Natural Log  a logarithm, where a = 2.718 282... (a transcendental number), usually denoted loge x, or ln x.".<BR><BR>Logit = Sum ( values * beta) + 0.21935 ln( days+ 0.5) 0.43417<BR>Predicted death rate = e(logit) / ( 1 + e (Logit) )<BR><BR>The rest is pretty straight maths... If there's no "*" then you have to assume it's minus "0.43417", not multiplied by minus. Except for the implied multiplication between 0.21935 and the ln of (days +0.5). In fact, it can't be multiplied by that negative number  logit seems to be a positive number.<BR><BR>Craig.

RE: Not
OK so:<BR>Logit = Sum ( values * beta) + 0.21935 ln( days+ 0.5) 0.43417<BR><BR>Should look like this? If you leave all drop boxes on website to blank and beta would be '0' until you get to 'SBP'.<BR><BR>Logit = Sum(1.97532) + 0.21935(i assume multiply)ln(2.718282)*(days(0) + .05).43417<BR><BR>Logit = .672831082177<BR><BR>According to the website it should be 2.561531.

Yeah, but the LN function...
...doesn't exist in VBScript. Look in the docs:<BR>http://msdn.microsoft.com/library/enus/script56/html/vbscripttoc.asp<BR><BR>Look at the functions available in VBS.<BR><BR>Read the description of the LOG function.<BR><BR>Enough said?<BR><BR>But there is also no SUM function in VBScript.<BR><BR>So *probably* this is a function they are using in a SQL query???<BR><BR>Or are they looping through some array to get the sum?<BR><BR>BUT WAIT A MINUTE! <BR> LN( 2.718182 )<BR>is *1* !!!<BR><BR> 2.718281828 *is* the value of E, the root of the natural logarithms.<BR><BR>And BY DEFINITION, LN(E) is 1.0 <BR><BR>So something there makes no sense.<BR><BR>

Yeah, but the LN function...
...doesn't exist in VBScript. Look in the docs:<BR>http://msdn.microsoft.com/library/enus/script56/html/vbscripttoc.asp<BR><BR>Look at the functions available in VBS.<BR><BR>Read the description of the LOG function.<BR><BR>Enough said?<BR><BR>But there is also no SUM function in VBScript.<BR><BR>So *probably* this is a function they are using in a SQL query???<BR><BR>Or are they looping through some array to get the sum?<BR><BR>BUT WAIT A MINUTE! <BR> LN( 2.718182 )<BR>is *1* !!!<BR><BR> 2.718281828 *is* the value of E, the root of the natural logarithms.<BR><BR>And BY DEFINITION, LN(E) is 1.0 <BR><BR>So something there makes no sense.<BR><BR>

Man, where did you come up with...
...that 2.71828 stuff???<BR><BR>The web page shows the formula:<BR><BR>Logit = Sum ( values * beta) + 0.21935 ln( days+ 0.5) 0.43417<BR><BR>So the first thing you have to do is go through all the eleven Value/Beta pairs, multiplying them together and geting a sum.<BR><BR>And then:<BR><BR>Logit = TheSum + 0.21935 * LOG( days+ 0.5)  0.43417<BR><BR>

RE: Man, where did you come up with...
He read my definition of "ln" and assumed he had to put the value of e inside the ln function, for some reason.<BR><BR>Not quite sure where he lost the "days" side of things though.<BR><BR>It's late over here, hence the reason I didn't answer him earlier.<BR><BR>Craig.
Posting Permissions
 You may not post new threads
 You may not post replies
 You may not post attachments
 You may not edit your posts

Forum Rules

