Standard Deviation
Michael C. Lee
mclsys@home.com
Fri, 18 Sep 1998 17:02:52 -0700
There is a QTP technique in the June 1991 Cognos Support Technical Newsletter
as
follows:
The following technique calculates the mean and standard deviation of an
employee's
billings in one pass using QTP. It uses the formula:S=sqrt((Q-T*M)/(N-1))
Where: Q is the sum of the squares of the billings;
T is the sum of the billings;
N is the count of the billings;
M is T / N (e.g. the average of the billings); and
S is the standard deviation of the billings.
> RUN mean_stdev2
> REQUEST mean_stdev
> ACCESS billings
> SORT ON employee-no OF billings
> TEMPORARY bill-count INT SIZE 4
> ITEM bill-count COUNT RESET AT &
> employee-no OF billings
> TEMPORARY total-employee FLOAT SIZE *
> ITEM total-employee &
> SUBTOTAL billing of billings &
> RESET AT employee-no OF billings
>
> TEMPORARY sq-bill
> ITEM sq-bill = billing^2
>
> TEMPORARY total-sq-employee FLOAT SIZE 8
> ITEM total-sq-employee SUBTOTAL sq-bill &
> RESET AT employee-no OF billings
>
> TEMPORARY mean FLOAT SIZE 8
> ITEM mean = total-employee / bill-count
>
> TEMPORARY std-dev FLOAT SIZE 8
> ITEM std-dev = 0 if bill-count = 0 &
> ELSE ((total-sq-employee - mean * total-employee) / &
> (bill-count - 1)) ^0.5
> SUBFILE results2 AT employee-no OF billings KEEP &
> INCLUDE employee OF billings, std-dev, bill-count
>
> BUILD
I haven't tried this myself but the techniques in the newsletters were pretty
good and were
vetted by Cognos personnel including Mr. Deskin.
Regards,
Michael Lee
MCL Systems Inc.
p.s. I hope you have QTP.
Calvin.Dimsha@gsle.gensig.com wrote:
> We're using Quiz 7.29.C8 on a HP3000.
>
> I need to calculate the standard deviation of 5 arguments and it doesn't
> look like Quiz does this out of the box. Ideally there would be something
> like this:
>
> DEFINE X = STDEV(0,5,0,266,0) which = 118.4196
>
> Has anyone developed a work-around that accomplishes this and that they
> would be willing to share?
>
> Calvin Dimsha
> GS Laboratory Equipment
> Asheville, NC
> calvin.dimsha@gsle.gensig.com
> = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
> Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
> powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
> This list is closed, thus to post to the list, you must be a subscriber.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.