Is there a function in FormCalc for Standard Deviation (Excel StdDev) | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Mayank_Tiwari

You should have it.  Please try again

 


Thanks, I checked that. SD can be calculated for sample and population. I was using the Population's formula. Now, I have used the sample's and it is working as per your expectations. Fixed Form.

 

For this, the following script is being used:

 

var rows = this.resolveNodes("tblTestData.repeatingRow[*]");
var sm=0; 
var cm=0;
for(var i=0;i<rows.length;i++)
{ if(rows.item(i).airVoids1.rawValue)
{
sm+= Math.pow(rows.item(i).airVoids1.rawValue - form1.page1.tblTestData.row2.amountMeanX.rawValue,2);
cm=cm+1;
}
}
form1.page1.tblTestData.row2.amountDeviation.rawValue = Math.sqrt(sm/(cm-1));

 

1 reply

Mayank_Tiwari
Adobe Employee
Adobe Employee
January 26, 2022

Let's assume you have the mean stored in a variable called 'mean' and the values are in an array called 'values' of length n. Then the way to calculate SD in FormCalc is:

 

sum=0;
for i=0 upto n step 2 do
sum=sum + Math.pow(values[i]-mean,2);
endfor
SD = Math.sqrt(sum/(n));

 in Javascript

 

 

sum=0; for (i=0; i<n; i++) {sum+=Math.pow(values[i]-mean,2);} SD = Math.sqrt(sum/(n);

 

 

 

 

ReluctantProgrammer
Level 4
January 26, 2022

I'm missing something.  Here's a copy of my form.  The Standard Deviation field is under 1. Test Data.

Mayank_Tiwari
Adobe Employee
Adobe Employee
January 28, 2022

https://drive.google.com/file/d/12qp4fgjbESjUhqslWo_WYgFfRqQmeCXX/view?usp=sharing

 

 


Do you want to calculate the SD of Air Voids column?

Also, in the Mean (X) field, you are calculating the sum of Air Voids. shouldn't it be the average instead of sum?