I'm working on creating a Cognito form and need to know how to do a calculation with two calculated fields. I've pasted a preview below to help explain it. I want to do a calculation in the RRI column comparing the two percentages of total arrests. I'd appreciate help on how to do this.
Cognito-forms – How to calculate the Relative Rate Index based on data collected in tables in Cognito Forms
cognito-forms
Related Topic
- Cognito-forms – Can Cognito Forms calculate rental inventory availability by date and other variables across multiple form submissions
- Cognito-forms – How to insert page breaks after each repeating section item in custom document merge templates with Cognito Forms
- Cognito-forms – Allowing field entry only once in Cognito Forms (discount codes)
- Cognito-forms – Preview function no longer seems to work
- Cognito-forms – Import Cognito Forms data from another page
- Cognito-forms – Select case conditional logic
Best Answer
Since I am not an expert on RRI calculations, let me state a few assumptions about what you are asking:
The
Arrest Rate
for each ethnic group is defined as the number of arrests for that group divided by the total population of that group.The
Relative Rate Index
is the ratio of arrest rates for two different ethnic groups.In this case, let's also assume that the RRI is the ratio of arrest rates of ethnic groups specifically compared with
White/Not Hispanic
.Also, let's assume that we cannot calculate the arrest rate itself since we do not have the total population, only the RRI (tricky problem).
Assuming these assumptions are correct, let's start with the algebra necessary to perform the calculation:
White Arrest Rate
=# White Arrests
/ (Total Population
*White Population %
)Ethnic Group Arrest Rate
=# Ethnic Group Arrests
/ (Total Population
*Ethnic Group Population %
)Relative Rate Index
=Ethnic Group Arrest Rate
/White Arrest Rate
Now, performing a bit of substitution, we have:
Relative Rate Index
= (# Ethnic Group Arrests
/ (Total Population
*Ethnic Group Population %
) ) / (# White Arrests
/ (Total Population
*White Population %
) )Total Population
cancels out, and we are left with:Relative Rate Index
= (# Ethnic Group Arrests
/Ethnic Group Population %
) / (# White Arrests
/White Population %
)Now, switching over to Cognito Forms calculations from algebra, we can calculate both the
Percent of Total Arrests
and theRRI
solely using information entered into the table.First, select the option to summarize the
Percent of Total City Population
andNumber of Arrests for Calendar Year
columns, which will show the totals and make it easier to write the calculations. This also eliminates the need to capture the total number of arrests, since the table will now calculate this for us.Enter the following calculation for the
Percent of Total Arrests
:Enter the following calculation for the
RRI
:When the table is then filled out with information, the results are as follows:
Obviously, the RRI for White/Non-Hispanic will always be 1.00 since the numerator and denominator are the same. Please update your post the clarify the question if my assumptions are incorrect!
Finally, here is a shared template showing the form in question, with all the necessary calculations: https://www.cognitoforms.com/templates/shared/ThomasFamily/RelativeRateIndex