DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

standard deviation

I have 4 force channels that i have to find standard deviation for at each point. So basically, i find average at each point, substract it with the value at that point in force, sum it, divide it by 3 and then squareroot it. I have to do this for every point. I dont think Diadem has an in built function to do this so i did the following but i get errors:

L1 = GLOBUSEDCHN+1
CALL CHNAVERAGE("FCHNS(1), FCHNS(2), FCHNS(3), FCHNS(4)", L1) '------> error says it cant average it because only one Y channel is present.
CN(L1) = "FAVG"
CC(L1) = "FORCE AVERAGE"
 
L1 = GLOBUSEDCHN+1
FOR I = 1 TO FLENGTH
L2 = I
AVF = CHDX(L2, CNO("FAVG"))
CHDX(L2, L1) = SQR(((CHDX(L2, L3) - AVF)^2 + (CHDX(L2, L4) - AVF)^2 + (CHDX(L2, L5) - AVF)^2 + (CHDX(L2, L6) - AVF)^2)/3)
NEXT
CC(L1) = "STANDARD DEV - FORCE"
CN(L1) = "STDFORCE"
 
when i do the last part it makes a channel with the values in it but i cannot access it. It says the channel length for it is 0 but ti should be flength. Anyone knows how to fix this or even better find a better way to do this?
 
Lemme know. Thanks Shefalika
0 Kudos
Message 1 of 7
(4,739 Views)
oh i dont know if it matters - i am using diadem 8.1. Thanks.
0 Kudos
Message 2 of 7
(4,732 Views)

Hi Shefalika,

I developed and checked the below VBScript in DIAdem 8.1-- yes, it does matter.  Your resultant calculation will run much faster and more efficiently by programmatically using the Formula Calculator.  You also needed to pass the channels to the ChnAverage() function as a channel string.

Dim FChns(4), ChnStr
FChns(1) = 1
FChns(2) = 2
FChns(3) = 3
FChns(4) = 4

ChnStr = FChns(1) & "," & FChns(2) & "," & FChns(3) & "," & FChns(4)
CALL ChnAverage(ChnStr, L1)
L1 = CNo("Mean_values")
CN(L1) = "FAvg"
CC(L1) = "FORCE AVERAGE"

L3 = FChns(1)
L4 = FChns(2)
L5 = FChns(3)
L6 = FChns(4)
FormulaTxt = "Ch('StdForce'):= Sqrt("
FormulaTxt = FormulaTxt & " (Ch(L3)-Ch(L1))^2 + "
FormulaTxt = FormulaTxt & " (Ch(L4)-Ch(L1))^2 + "
FormulaTxt = FormulaTxt & " (Ch(L5)-Ch(L1))^2 + "
FormulaTxt = FormulaTxt & " (Ch(L6)-Ch(L1))^2)"
Call FormulaCalc(FormulaTxt)
L2 = CNo("StdForce")
CC(L2) = "STANDARD DEV - FORCE"

Ask if you have additional questions,
Brad Turpin
DIAdem Product Support Engineer
National Instruments

Message 3 of 7
(4,704 Views)

Brad I hate to thread resurrect but with newer versions of DIAdem is there a function that does this?

 

I am looking to calculate STD DEV is the same format as the OP but I also need a +/-3 sigma

Tim
0 Kudos
Message 4 of 7
(3,410 Views)

Hi Tim,

 

For many versions now, DIAdem has had a "Standard Deviation" checkbox in the "Descriptive Statistics" ANALYSIS dialog in the "Statistics" palette.  Recent DIAdem versions also have "Three Sigma" and "Six Sigma" checkboxes.

 

Have you looked at the Statistics options lately?

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 5 of 7
(3,380 Views)

Brad

 

My version of DIAdem 2017 sp1 only has "Standard Deviation" checkbox.

 

Do the newer versions have Three and Six Sigma?

 

 

Tim
0 Kudos
Message 6 of 7
(3,373 Views)

Hi Tim,

 

That's actually sufficient, you can multiply the "standard deviation" result by 3 to get "Three Sigma" and by 6 to get "Six Sigma".

 

Statistics.gif

 

Here's what it looks like in DIAdem 2018,

Brad

0 Kudos
Message 7 of 7
(3,370 Views)