RE: Mean/Median - Another method
median; adjective: (statistics) relating to or constituting the middle value of an ordered set of values (or the average of the middle two in an even-numbered set) This is the definition of median. It's not a "calculated" value, it's more of a "derived" value. >>> [EMAIL PROTECTED] 05/15/01 07:38PM >>> Another way to compute median is here: 1. You should know that there is a linear relationship between Mean, Median and Mode. Find that relationship. 2. Find the mean of the data. Its nothing but the average. 3. Next you have find the mode. Mode is nothing but the most frequent data. suppose, sal is the column for which you want to find the median, then proceed like this - select sal, count(*) Number_of_people from emp group by sal order by 2 Desc; Now the first record returned by the above query represents the mode. Caputure the sal from this first record and call it as mode. 4. Now, Using the relationship u determined in step 1, calculate the median values by substituting the mode and mean values. PS: I know this is going to work is salary is an interger field. But I doubt it if its a real number. Listers,letme know if I am wrong. Also, I did not watch earlier mails on this topic,. so, pardon me if its a repeat. Rajaram. -Original Message- From: Eric D. Pierce [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, May 15, 2001 3:36 PM To: Multiple recipients of list ORACLE-L Subject:RE: Mean/Median HELP > Are you stupid? -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Eric D. Pierce INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). NetZero Platinum No Banner Ads and Unlimited Access Sign Up Today - Only $9.95 per month! http://www.netzero.net -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rajaram INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Tim Sawmiller INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
OT RE: Mean/Median
better than being a pile of pig fundament... >>> [EMAIL PROTECTED] 05/15/01 03:22PM >>> ROFL! "I am an idiot" || -Original Message- || From: [EMAIL PROTECTED] || [mailto:[EMAIL PROTECTED]] || Sent: Tuesday, May 15, 2001 2:11 PM || To: Multiple recipients of list ORACLE-L || Subject: RE: Mean/Median || || || Are you stupid? || || || || Scott Shafer || San Antonio, TX || 210-581-6217 || || > -Original Message- || > From: Mohan, Ross [SMTP:[EMAIL PROTECTED]] || > Sent: Tuesday, May 15, 2001 12:27 PM || > To:Multiple recipients of list ORACLE-L || > Subject: RE: Mean/Median || > || > geez louise, || > || > Median := avg(Max,Min) || > || > || -Original Message- || > || From: Pat Hildebrand [mailto:[EMAIL PROTECTED]] || > || Sent: Monday, May 14, 2001 10:56 PM || > || To: Multiple recipients of list ORACLE-L || > || Subject: Re: Mean/Median || > || || > || || > || || > || > || > || > Any scripts (sql or pl/sql) out there to compute various || > || statistical things || > || > in Oracle? || > || > || > || || > || Would depend on just what you are looking for. A quick look at || > || Oracle's SQL functions showed avg, st. deviation, and variance || > || although no median but that should be easier to write than || > || some of the || > || others. || > || || > ||Pat || > || -- || Please see the official ORACLE-L FAQ: http://www.orafaq.com || -- || Author: || INET: [EMAIL PROTECTED] || || Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 || San Diego, California-- Public Internet access / || Mailing Lists || || To REMOVE yourself from this mailing list, send an E-Mail message || to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in || the message BODY, include a line containing: UNSUB ORACLE-L || (or the name of mailing list you want to be removed from). You may || also send the HELP command for other information (like subscribing). || -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mohan, Ross INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Tim Sawmiller INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: Mean/Median
On Tuesday 15 May 2001 12:00, Eric D. Pierce wrote: > I'm not familiar with that syntax, is it one of the 9i > self-tuning, self-managing feathures? > Hmm.. It appeared properly on the list, must have been munged somewhere along the line. Here 'tis again. Jared -- middle value is chosen as median when there is an -- odd number of values -- average of 2 middle values is chosen median -- when there is an even number of values drop table median; create table median ( value number ); insert into median values ( 111 ); insert into median values ( 543 ); insert into median values ( 566 ); insert into median values ( 643 ); insert into median values ( 456 ); insert into median values ( 98 ); insert into median values ( 877 ); insert into median values ( 867 ); insert into median values ( 687 ); insert into median values ( 6886 ); -- uncomment this row for an odd number of values --insert into median values ( 982 ); commit; break on report compute avg label 'Median' of value on report column value heading 'values|averaged|in median' select rownum, value from ( select value from median where value is not null union select 1 from dual where 1=2 ) group by value, rownum having rownum >= ( select decode( mod(total_freq,2), 1,trunc(total_freq/2 + 1), 0,trunc(total_freq/2) ) from ( select count(*) total_freq from median where value is not null ) ) and rownum <= ( select decode( mod(total_freq,2), 1,trunc(total_freq/2 + 1), 0,trunc(total_freq/2 + 1) ) from ( select count(*) total_freq from median where value is not null ) ) / -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Jared Still INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Mean/Median - Another method
Another way to compute median is here: 1. You should know that there is a linear relationship between Mean, Median and Mode. Find that relationship. 2. Find the mean of the data. Its nothing but the average. 3. Next you have find the mode. Mode is nothing but the most frequent data. suppose, sal is the column for which you want to find the median, then proceed like this - select sal, count(*) Number_of_people from emp group by sal order by 2 Desc; Now the first record returned by the above query represents the mode. Caputure the sal from this first record and call it as mode. 4. Now, Using the relationship u determined in step 1, calculate the median values by substituting the mode and mean values. PS: I know this is going to work is salary is an interger field. But I doubt it if its a real number. Listers,letme know if I am wrong. Also, I did not watch earlier mails on this topic,. so, pardon me if its a repeat. Rajaram. -Original Message- From: Eric D. Pierce [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, May 15, 2001 3:36 PM To: Multiple recipients of list ORACLE-L Subject:RE: Mean/Median HELP > Are you stupid? -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Eric D. Pierce INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). NetZero Platinum No Banner Ads and Unlimited Access Sign Up Today - Only $9.95 per month! http://www.netzero.net -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rajaram INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Mean/Median
HELP " Aˤ " On 15 May 2001, at 12:55, Mohan, Ross wrote: > Are you an idiot? ... > || I'm not familiar with that syntax, is it one of the 9i > || self-tuning, self-managing feathures? ... > || > Here's the script I have for median. > || > || ... > || > || > > || > Aˤ -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Eric D. Pierce INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Mean/Median
HELP > Are you stupid? -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Eric D. Pierce INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: Mean/Median
No, Median := avg(Max,Min) does not work (not for 'even', nor for 'odd' numbers of samples). Igor Neyman, OCP DBA Perceptron, Inc. (734)414-4627 [EMAIL PROTECTED] - Original Message - To: "Multiple recipients of list ORACLE-L" <[EMAIL PROTECTED]> Sent: Tuesday, May 15, 2001 1:35 PM > Oops, this only works for *even* numbers of samplesgeez > > || -Original Message- > || From: Mohan, Ross > || Sent: Tuesday, May 15, 2001 12:28 PM > || To: '[EMAIL PROTECTED]' > || Subject: RE: Mean/Median > || > || > || geez louise, > || > || Median := avg(Max,Min) > || > || || -Original Message- > || || From: Pat Hildebrand [mailto:[EMAIL PROTECTED]] > || || Sent: Monday, May 14, 2001 10:56 PM > || || To: Multiple recipients of list ORACLE-L > || || Subject: Re: Mean/Median > || || > || || > || || > || || > > || || > Any scripts (sql or pl/sql) out there to compute various > || || statistical things > || || > in Oracle? > || || > > || || > || || Would depend on just what you are looking for. A quick look at > || || Oracle's SQL functions showed avg, st. deviation, and variance > || || although no median but that should be easier to write than > || || some of the > || || others. > || || > || ||Pat > || || -- > || || Please see the official ORACLE-L FAQ: http://www.orafaq.com > || || -- > || || Author: Pat Hildebrand > || || INET: [EMAIL PROTECTED] > || || > || || Fat City Network Services-- (858) 538-5051 FAX: > || (858) 538-5051 > || || San Diego, California-- Public Internet access / > || || Mailing Lists > || || > || > || || To REMOVE yourself from this mailing list, send an E-Mail message > || || to: [EMAIL PROTECTED] (note EXACT spelling of > || 'ListGuru') and in > || || the message BODY, include a line containing: UNSUB ORACLE-L > || || (or the name of mailing list you want to be removed > || from). You may > || || also send the HELP command for other information (like > || subscribing). > || || > || > -- > Please see the official ORACLE-L FAQ: http://www.orafaq.com > -- > Author: Mohan, Ross > INET: [EMAIL PROTECTED] > > Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 > San Diego, California-- Public Internet access / Mailing Lists > > To REMOVE yourself from this mailing list, send an E-Mail message > to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in > the message BODY, include a line containing: UNSUB ORACLE-L > (or the name of mailing list you want to be removed from). You may > also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Igor Neyman INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
OT RE: Mean/Median
ROFL! "I am an idiot" || -Original Message- || From: [EMAIL PROTECTED] || [mailto:[EMAIL PROTECTED]] || Sent: Tuesday, May 15, 2001 2:11 PM || To: Multiple recipients of list ORACLE-L || Subject: RE: Mean/Median || || || Are you stupid? || || || || Scott Shafer || San Antonio, TX || 210-581-6217 || || > -Original Message- || > From: Mohan, Ross [SMTP:[EMAIL PROTECTED]] || > Sent: Tuesday, May 15, 2001 12:27 PM || > To:Multiple recipients of list ORACLE-L || > Subject: RE: Mean/Median || > || > geez louise, || > || > Median := avg(Max,Min) || > || > || -Original Message- || > || From: Pat Hildebrand [mailto:[EMAIL PROTECTED]] || > || Sent: Monday, May 14, 2001 10:56 PM || > || To: Multiple recipients of list ORACLE-L || > || Subject: Re: Mean/Median || > || || > || || > || || > || > || > || > Any scripts (sql or pl/sql) out there to compute various || > || statistical things || > || > in Oracle? || > || > || > || || > || Would depend on just what you are looking for. A quick look at || > || Oracle's SQL functions showed avg, st. deviation, and variance || > || although no median but that should be easier to write than || > || some of the || > || others. || > || || > ||Pat || > || -- || Please see the official ORACLE-L FAQ: http://www.orafaq.com || -- || Author: || INET: [EMAIL PROTECTED] || || Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 || San Diego, California-- Public Internet access / || Mailing Lists || || To REMOVE yourself from this mailing list, send an E-Mail message || to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in || the message BODY, include a line containing: UNSUB ORACLE-L || (or the name of mailing list you want to be removed from). You may || also send the HELP command for other information (like subscribing). || -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mohan, Ross INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Mean/Median
Are you an idiot? ;-> || -Original Message- || From: Eric D. Pierce [mailto:[EMAIL PROTECTED]] || Sent: Tuesday, May 15, 2001 4:01 PM || To: Multiple recipients of list ORACLE-L || Subject: Re: Mean/Median || || || I'm not familiar with that syntax, is it one of the 9i || self-tuning, self-managing feathures? || || || On 14 May 2001, at 22:15, Jared Still wrote: || || > Here's the script I have for median. || || ... || || > || > Aˤ || || || -- || Please see the official ORACLE-L FAQ: http://www.orafaq.com || -- || Author: Eric D. Pierce || INET: [EMAIL PROTECTED] || || Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 || San Diego, California-- Public Internet access / || Mailing Lists || || To REMOVE yourself from this mailing list, send an E-Mail message || to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in || the message BODY, include a line containing: UNSUB ORACLE-L || (or the name of mailing list you want to be removed from). You may || also send the HELP command for other information (like subscribing). || -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mohan, Ross INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Mean/Median
"doesn't work AT ALL"? Ha! Gotcha! It works when N=2! I call it my "highly-specialized e-commerce predictor solution" || -Original Message- || From: Tim Sawmiller [mailto:[EMAIL PROTECTED]] || Sent: Tuesday, May 15, 2001 3:27 PM || To: Multiple recipients of list ORACLE-L || Subject: RE: Mean/Median || || || Well, no, it doesn't work at all. The definition of Median || is a value where half your list of values is above, and half || is below. If the values all tend toward the mininum or the || maximum, this "equation" would be way out of line. || || >>> [EMAIL PROTECTED] 05/15/01 01:35PM >>> || Oops, this only works for *even* numbers of samplesgeez || || || -Original Message- || || From: Mohan, Ross || || Sent: Tuesday, May 15, 2001 12:28 PM || || To: '[EMAIL PROTECTED]' || || Subject: RE: Mean/Median || || || || || || geez louise, || || || || Median := avg(Max,Min) || || || || || -Original Message- || || || From: Pat Hildebrand [mailto:[EMAIL PROTECTED]] || || || Sent: Monday, May 14, 2001 10:56 PM || || || To: Multiple recipients of list ORACLE-L || || || Subject: Re: Mean/Median || || || || || || || || || || || || > || || || > Any scripts (sql or pl/sql) out there to compute various || || || statistical things || || || > in Oracle? || || || > || || || || || || Would depend on just what you are looking for. A quick look at || || || Oracle's SQL functions showed avg, st. deviation, and variance || || || although no median but that should be easier to write than || || || some of the || || || others. || || || || || ||Pat || || || -- || || || Please see the official ORACLE-L FAQ: http://www.orafaq.com || || || -- || || || Author: Pat Hildebrand || || || INET: [EMAIL PROTECTED] || || || || || || Fat City Network Services-- (858) 538-5051 FAX: || || (858) 538-5051 || || || San Diego, California-- Public Internet access / || || || Mailing Lists || || || || || || || || || To REMOVE yourself from this mailing list, send an || E-Mail message || || || to: [EMAIL PROTECTED] (note EXACT spelling of || || 'ListGuru') and in || || || the message BODY, include a line containing: UNSUB ORACLE-L || || || (or the name of mailing list you want to be removed || || from). You may || || || also send the HELP command for other information (like || || subscribing). || || || || || || -- || Please see the official ORACLE-L FAQ: http://www.orafaq.com || -- || Author: Mohan, Ross || INET: [EMAIL PROTECTED] || || Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 || San Diego, California-- Public Internet access / || Mailing Lists || || To REMOVE yourself from this mailing list, send an E-Mail message || to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in || the message BODY, include a line containing: UNSUB ORACLE-L || (or the name of mailing list you want to be removed from). You may || also send the HELP command for other information (like subscribing). || || -- || Please see the official ORACLE-L FAQ: http://www.orafaq.com || -- || Author: Tim Sawmiller || INET: [EMAIL PROTECTED] || || Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 || San Diego, California-- Public Internet access / || Mailing Lists || || To REMOVE yourself from this mailing list, send an E-Mail message || to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in || the message BODY, include a line containing: UNSUB ORACLE-L || (or the name of mailing list you want to be removed from). You may || also send the HELP command for other information (like subscribing). || -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mohan, Ross INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Mean/Median
try this float salary[100]; /* populate the host array */ EXEC SQL EXECUTE DECLARE TYPE NumTabTyp IS TABLE OF REAL INDEX BY BINARY_INTEGER; median_salary REAL; n BINARY_INTEGER; ... FUNCTION median (num_tab NumTabTyp, n INTEGER) RETURN REAL IS BEGIN -- compute median END; BEGIN n := 100; median_salary := median(:salary, n); ... END; END-EXEC; ... -Original Message- Sent: Tuesday, May 15, 2001 3:36 PM To: Multiple recipients of list ORACLE-L No, Median := avg(Max,Min) does not work (not for 'even', nor for 'odd' numbers of samples). Igor Neyman, OCP DBA Perceptron, Inc. (734)414-4627 [EMAIL PROTECTED] - Original Message - To: "Multiple recipients of list ORACLE-L" <[EMAIL PROTECTED]> Sent: Tuesday, May 15, 2001 1:35 PM > Oops, this only works for *even* numbers of samplesgeez > > || -Original Message- > || From: Mohan, Ross > || Sent: Tuesday, May 15, 2001 12:28 PM > || To: '[EMAIL PROTECTED]' > || Subject: RE: Mean/Median > || > || > || geez louise, > || > || Median := avg(Max,Min) > || > || || -Original Message- > || || From: Pat Hildebrand [mailto:[EMAIL PROTECTED]] > || || Sent: Monday, May 14, 2001 10:56 PM > || || To: Multiple recipients of list ORACLE-L > || || Subject: Re: Mean/Median > || || > || || > || || > || || > > || || > Any scripts (sql or pl/sql) out there to compute various > || || statistical things > || || > in Oracle? > || || > > || || > || || Would depend on just what you are looking for. A quick look at > || || Oracle's SQL functions showed avg, st. deviation, and variance > || || although no median but that should be easier to write than > || || some of the > || || others. > || || > || ||Pat > || || -- > || || Please see the official ORACLE-L FAQ: http://www.orafaq.com > || || -- > || || Author: Pat Hildebrand > || || INET: [EMAIL PROTECTED] > || || > || || Fat City Network Services-- (858) 538-5051 FAX: > || (858) 538-5051 > || || San Diego, California-- Public Internet access / > || || Mailing Lists > || || > || > || || To REMOVE yourself from this mailing list, send an E-Mail message > || || to: [EMAIL PROTECTED] (note EXACT spelling of > || 'ListGuru') and in > || || the message BODY, include a line containing: UNSUB ORACLE-L > || || (or the name of mailing list you want to be removed > || from). You may > || || also send the HELP command for other information (like > || subscribing). > || || > || > -- > Please see the official ORACLE-L FAQ: http://www.orafaq.com > -- > Author: Mohan, Ross > INET: [EMAIL PROTECTED] > > Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 > San Diego, California-- Public Internet access / Mailing Lists > > To REMOVE yourself from this mailing list, send an E-Mail message > to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in > the message BODY, include a line containing: UNSUB ORACLE-L > (or the name of mailing list you want to be removed from). You may > also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Igor Neyman INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Dawn White INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Mean/Median
Well, no, it doesn't work at all. The definition of Median is a value where half your list of values is above, and half is below. If the values all tend toward the mininum or the maximum, this "equation" would be way out of line. >>> [EMAIL PROTECTED] 05/15/01 01:35PM >>> Oops, this only works for *even* numbers of samplesgeez || -Original Message- || From: Mohan, Ross || Sent: Tuesday, May 15, 2001 12:28 PM || To: '[EMAIL PROTECTED]' || Subject: RE: Mean/Median || || || geez louise, || || Median := avg(Max,Min) || || || -Original Message- || || From: Pat Hildebrand [mailto:[EMAIL PROTECTED]] || || Sent: Monday, May 14, 2001 10:56 PM || || To: Multiple recipients of list ORACLE-L || || Subject: Re: Mean/Median || || || || || || || || > || || > Any scripts (sql or pl/sql) out there to compute various || || statistical things || || > in Oracle? || || > || || || || Would depend on just what you are looking for. A quick look at || || Oracle's SQL functions showed avg, st. deviation, and variance || || although no median but that should be easier to write than || || some of the || || others. || || || ||Pat || || -- || || Please see the official ORACLE-L FAQ: http://www.orafaq.com || || -- || || Author: Pat Hildebrand || || INET: [EMAIL PROTECTED] || || || || Fat City Network Services-- (858) 538-5051 FAX: || (858) 538-5051 || || San Diego, California-- Public Internet access / || || Mailing Lists || || || || || To REMOVE yourself from this mailing list, send an E-Mail message || || to: [EMAIL PROTECTED] (note EXACT spelling of || 'ListGuru') and in || || the message BODY, include a line containing: UNSUB ORACLE-L || || (or the name of mailing list you want to be removed || from). You may || || also send the HELP command for other information (like || subscribing). || || || -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mohan, Ross INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Tim Sawmiller INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Mean/Median - how to be wrong multiple times
If you don't like the last one I sent try this one 1: #include 2: exec sql include sqlca; /* communication area */ 4: main() 5: { 6: exec sql begin declare section; 7: VARCHAR cid[5], user_name[20], user_pwd[10]; 8: double dollars; 9: int cnt; 10: exec sql end declare section; 11: exec sql declare dollars_cursor cursor for /* to calculate media */ 12: select dollars from orders 13: where cid=:cid order by dollars desc;/* ... order important */ 14: exec sql whenever sqlerror stop; 15: strcpy(user_name.arr,"poneilsql"); 16: user_name.len=strlen(user_name.arr); 17: strcpy(user_pwd.arr,""); 18: user_pwd.len=strlen(user_pwd.arr); 19: exec sql connect :user_name 20: identified by :user_pwd; /* ORACLE: connect */ 22: while (prompt("Please enter a cutomer ID: ", cid.arr) >0 ) 23: /* main loop: get cid */ 24: { 25: cid.len=strlen(cid.arr) /* set cid length */ 26: exec sql select cound(cid) into :cnt /* count orders by cid */ 27: from order where cid=:cid; 28: if (cnt==0) 29: { 30: printf("No orders retrieved for cid value %s\n",cid); 31: continue;/* go loop again */ 32: } 33: exec sql open dollars_cursor; 35: /* open cursor and loop until midpoint of ordered list */ 36: do /* loop at least once */ 37: exec sql fetch dollars_cursor into :dollars; 38: while ((cnt-=2)>0); /* fetch thru midpoint */ 39: exec sql close dollars_cursor; /* loop completed */ 40: exec sql commit work;/* release locks */ 41: printf("Median dollar amount = %f\n",dollars); 42: }/* end main loop */ 43: 44: exec sql disconnect; 45: } -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Dawn White INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: Mean/Median
I'm not familiar with that syntax, is it one of the 9i self-tuning, self-managing feathures? On 14 May 2001, at 22:15, Jared Still wrote: > Here's the script I have for median. ... > > Aˤ -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Eric D. Pierce INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Mean/Median
I did a procedure for median some time back. Here is the algorithm that I used. 1. Define a Cursor - Dont forget to use the Order by Column while defining. Ofcourse, U should order by the column on which you need median. 2. Get a count of records that cursor would return ( Regarding How to get a count - U have to define a similar cursor with the same where clause but one that returns count ). Or, simply do a select count into variable. 3. Supposing N is the number of records that the cursor would return, 4. If N is Odd, Then (N/2)+1 th record is the the median record 5. If N is even, then the average of the (N/2) th record and (N/2)+1 the record is the median value of the set. 6. Now Loop thru the cursor until you encounter (N/2)+1 th record and then calculate the median as determined in the steps 4 and 5. May be I goofed up somewhere - But I am sure my code worked - I checked it against a statistical package ( Cornerstone) generated median. Correct me if I am wrong. Rajaram. -Original Message- From: Tim Sawmiller [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, May 15, 2001 3:27 PM To: Multiple recipients of list ORACLE-L Subject:RE: Mean/Median Well, no, it doesn't work at all. The definition of Median is a value where half your list of values is above, and half is below. If the values all tend toward the mininum or the maximum, this "equation" would be way out of line. >>> [EMAIL PROTECTED] 05/15/01 01:35PM >>> Oops, this only works for *even* numbers of samplesgeez || -Original Message- || From: Mohan, Ross || Sent: Tuesday, May 15, 2001 12:28 PM || To: '[EMAIL PROTECTED]' || Subject: RE: Mean/Median || || || geez louise, || || Median := avg(Max,Min) || || || -Original Message- || || From: Pat Hildebrand [mailto:[EMAIL PROTECTED]] || || Sent: Monday, May 14, 2001 10:56 PM || || To: Multiple recipients of list ORACLE-L || || Subject: Re: Mean/Median || || || || || || || || > || || > Any scripts (sql or pl/sql) out there to compute various || || statistical things || || > in Oracle? || || > || || || || Would depend on just what you are looking for. A quick look at || || Oracle's SQL functions showed avg, st. deviation, and variance || || although no median but that should be easier to write than || || some of the || || others. || || || ||Pat || || -- || || Please see the official ORACLE-L FAQ: http://www.orafaq.com || || -- || || Author: Pat Hildebrand || || INET: [EMAIL PROTECTED] || || || || Fat City Network Services-- (858) 538-5051 FAX: || (858) 538-5051 || || San Diego, California-- Public Internet access / || || Mailing Lists || || || || || To REMOVE yourself from this mailing list, send an E-Mail message || || to: [EMAIL PROTECTED] (note EXACT spelling of || 'ListGuru') and in || || the message BODY, include a line containing: UNSUB ORACLE-L || || (or the name of mailing list you want to be removed || from). You may || || also send the HELP command for other information (like || subscribing). || || || -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mohan, Ross INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Tim Sawmiller INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). NetZero Platinum No Banner Ads and Unlimited Access Sign Up Today - Only $9.95 per month! http://www.netzero.net -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rajaram INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing lis
RE: Mean/Median - how to be wrong multiple times
Cripes, it doesn't work at all! LoL...i pulled the trigger way too fast on this one. || -Original Message- || From: Mohan, Ross || Sent: Tuesday, May 15, 2001 12:36 PM || To: '[EMAIL PROTECTED]' || Subject: RE: Mean/Median || || || Oops, this only works for *even* numbers of samplesgeez || || || -Original Message- || || From: Mohan, Ross || || Sent: Tuesday, May 15, 2001 12:28 PM || || To: '[EMAIL PROTECTED]' || || Subject: RE: Mean/Median || || || || || || geez louise, || || || || Median := avg(Max,Min) || || || || || -Original Message- || || || From: Pat Hildebrand [mailto:[EMAIL PROTECTED]] || || || Sent: Monday, May 14, 2001 10:56 PM || || || To: Multiple recipients of list ORACLE-L || || || Subject: Re: Mean/Median || || || || || || || || || || || || > || || || > Any scripts (sql or pl/sql) out there to compute various || || || statistical things || || || > in Oracle? || || || > || || || || || || Would depend on just what you are looking for. A quick look at || || || Oracle's SQL functions showed avg, st. deviation, and variance || || || although no median but that should be easier to write than || || || some of the || || || others. || || || || || ||Pat || || || -- || || || Please see the official ORACLE-L FAQ: http://www.orafaq.com || || || -- || || || Author: Pat Hildebrand || || || INET: [EMAIL PROTECTED] || || || || || || Fat City Network Services-- (858) 538-5051 FAX: || || (858) 538-5051 || || || San Diego, California-- Public Internet access / || || || Mailing Lists || || || || || || || || || To REMOVE yourself from this mailing list, send an || E-Mail message || || || to: [EMAIL PROTECTED] (note EXACT spelling of || || 'ListGuru') and in || || || the message BODY, include a line containing: UNSUB ORACLE-L || || || (or the name of mailing list you want to be removed || || from). You may || || || also send the HELP command for other information (like || || subscribing). || || || || || || -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mohan, Ross INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Mean/Median
I differ If your dataset was: 1, 1, 2, 3, 4, 10, 11 Min = 1 Max = 11 Avg = 4.5+ Avg(Min,Max) = Avg(1,11) = 6 Median = 3 (central value in the dataset) -Original Message- Sent: Tuesday, May 15, 2001 7:27 PM To: Multiple recipients of list ORACLE-L geez louise, Median := avg(Max,Min) || -Original Message- || From: Pat Hildebrand [mailto:[EMAIL PROTECTED]] || Sent: Monday, May 14, 2001 10:56 PM || To: Multiple recipients of list ORACLE-L || Subject: Re: Mean/Median || || || || > || > Any scripts (sql or pl/sql) out there to compute various || statistical things || > in Oracle? || > || || Would depend on just what you are looking for. A quick look at || Oracle's SQL functions showed avg, st. deviation, and variance || although no median but that should be easier to write than || some of the || others. || ||Pat || -- || Please see the official ORACLE-L FAQ: http://www.orafaq.com || -- || Author: Pat Hildebrand || INET: [EMAIL PROTECTED] || || Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 || San Diego, California-- Public Internet access / || Mailing Lists || || To REMOVE yourself from this mailing list, send an E-Mail message || to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in || the message BODY, include a line containing: UNSUB ORACLE-L || (or the name of mailing list you want to be removed from). You may || also send the HELP command for other information (like subscribing). || -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mohan, Ross INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Johan Locke@i-Commerce INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Mean/Median
Oops, this only works for *even* numbers of samplesgeez || -Original Message- || From: Mohan, Ross || Sent: Tuesday, May 15, 2001 12:28 PM || To: '[EMAIL PROTECTED]' || Subject: RE: Mean/Median || || || geez louise, || || Median := avg(Max,Min) || || || -Original Message- || || From: Pat Hildebrand [mailto:[EMAIL PROTECTED]] || || Sent: Monday, May 14, 2001 10:56 PM || || To: Multiple recipients of list ORACLE-L || || Subject: Re: Mean/Median || || || || || || || || > || || > Any scripts (sql or pl/sql) out there to compute various || || statistical things || || > in Oracle? || || > || || || || Would depend on just what you are looking for. A quick look at || || Oracle's SQL functions showed avg, st. deviation, and variance || || although no median but that should be easier to write than || || some of the || || others. || || || ||Pat || || -- || || Please see the official ORACLE-L FAQ: http://www.orafaq.com || || -- || || Author: Pat Hildebrand || || INET: [EMAIL PROTECTED] || || || || Fat City Network Services-- (858) 538-5051 FAX: || (858) 538-5051 || || San Diego, California-- Public Internet access / || || Mailing Lists || || || || || To REMOVE yourself from this mailing list, send an E-Mail message || || to: [EMAIL PROTECTED] (note EXACT spelling of || 'ListGuru') and in || || the message BODY, include a line containing: UNSUB ORACLE-L || || (or the name of mailing list you want to be removed || from). You may || || also send the HELP command for other information (like || subscribing). || || || -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mohan, Ross INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Mean/Median
Thanks to all... -Original Message- Sent: Tuesday, May 15, 2001 10:27 AM To: Multiple recipients of list ORACLE-L geez louise, Median := avg(Max,Min) || -Original Message- || From: Pat Hildebrand [mailto:[EMAIL PROTECTED]] || Sent: Monday, May 14, 2001 10:56 PM || To: Multiple recipients of list ORACLE-L || Subject: Re: Mean/Median || || || || > || > Any scripts (sql or pl/sql) out there to compute various || statistical things || > in Oracle? || > || || Would depend on just what you are looking for. A quick look at || Oracle's SQL functions showed avg, st. deviation, and variance || although no median but that should be easier to write than || some of the || others. || ||Pat || -- || Please see the official ORACLE-L FAQ: http://www.orafaq.com || -- || Author: Pat Hildebrand || INET: [EMAIL PROTECTED] || || Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 || San Diego, California-- Public Internet access / || Mailing Lists || || To REMOVE yourself from this mailing list, send an E-Mail message || to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in || the message BODY, include a line containing: UNSUB ORACLE-L || (or the name of mailing list you want to be removed from). You may || also send the HELP command for other information (like subscribing). || -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mohan, Ross INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: John Lewis INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Mean/Median
Are you stupid? Scott Shafer San Antonio, TX 210-581-6217 > -Original Message- > From: Mohan, Ross [SMTP:[EMAIL PROTECTED]] > Sent: Tuesday, May 15, 2001 12:27 PM > To: Multiple recipients of list ORACLE-L > Subject: RE: Mean/Median > > geez louise, > > Median := avg(Max,Min) > > || -Original Message- > || From: Pat Hildebrand [mailto:[EMAIL PROTECTED]] > || Sent: Monday, May 14, 2001 10:56 PM > || To: Multiple recipients of list ORACLE-L > || Subject: Re: Mean/Median > || > || > || > || > > || > Any scripts (sql or pl/sql) out there to compute various > || statistical things > || > in Oracle? > || > > || > || Would depend on just what you are looking for. A quick look at > || Oracle's SQL functions showed avg, st. deviation, and variance > || although no median but that should be easier to write than > || some of the > || others. > || > ||Pat > -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Mean/Median
geez louise, Median := avg(Max,Min) || -Original Message- || From: Pat Hildebrand [mailto:[EMAIL PROTECTED]] || Sent: Monday, May 14, 2001 10:56 PM || To: Multiple recipients of list ORACLE-L || Subject: Re: Mean/Median || || || || > || > Any scripts (sql or pl/sql) out there to compute various || statistical things || > in Oracle? || > || || Would depend on just what you are looking for. A quick look at || Oracle's SQL functions showed avg, st. deviation, and variance || although no median but that should be easier to write than || some of the || others. || ||Pat || -- || Please see the official ORACLE-L FAQ: http://www.orafaq.com || -- || Author: Pat Hildebrand || INET: [EMAIL PROTECTED] || || Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 || San Diego, California-- Public Internet access / || Mailing Lists || || To REMOVE yourself from this mailing list, send an E-Mail message || to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in || the message BODY, include a line containing: UNSUB ORACLE-L || (or the name of mailing list you want to be removed from). You may || also send the HELP command for other information (like subscribing). || -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mohan, Ross INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: Mean/Median
On Monday 14 May 2001 19:55, Pat Hildebrand wrote: > Would depend on just what you are looking for. A quick look at > Oracle's SQL functions showed avg, st. deviation, and variance > although no median but that should be easier to write than some of the > others. > >Pat Ha! Here's the script I have for median. Feel free to simplify it. :) And if you do, I want a copy. I can't claim authorship of this, I borrowed it from somewhere. Jared -- middle value is chosen as median when there is an -- odd number of values -- average of 2 middle values is chosen median -- when there is an even number of values drop table median; create table median ( value number ); insert into median values ( 111 ); insert into median values ( 543 ); insert into median values ( 566 ); insert into median values ( 643 ); insert into median values ( 456 ); insert into median values ( 98 ); insert into median values ( 877 ); insert into median values ( 867 ); insert into median values ( 687 ); insert into median values ( 6886 ); -- uncomment this row for an odd number of values --insert into median values ( 982 ); commit; break on report compute avg label 'Median' of value on report column value heading 'values|averaged|in median' select rownum, value from ( select value from median where value is not null union select 1 from dual where 1=2 ) group by value, rownum having rownum >= ( select decode( mod(total_freq,2), 1,trunc(total_freq/2 + 1), 0,trunc(total_freq/2) ) from ( select count(*) total_freq from median where value is not null ) ) and rownum <= ( select decode( mod(total_freq,2), 1,trunc(total_freq/2 + 1), 0,trunc(total_freq/2 + 1) ) from ( select count(*) total_freq from median where value is not null ) ) / Aˤ -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Jared Still INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: Mean/Median
> > Any scripts (sql or pl/sql) out there to compute various statistical things > in Oracle? > Would depend on just what you are looking for. A quick look at Oracle's SQL functions showed avg, st. deviation, and variance although no median but that should be easier to write than some of the others. Pat -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Pat Hildebrand INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).