formulas.xml - SuperCROSS
The formulas XML file is used to define the formulas used for weighting. A single formulas file can be shared by multiple weighted databases.
SuperCROSS uses the settings in this file to automatically create temporary recodes containing derivations and User Defined Fields (UDFs). These are used to calculate the weightings.
File Name | Defined in the weightings file. |
---|---|
Location | Defined in the weightings file (typically located in the same directory as the weightings file). |
Example
<WEIGHTFORMULAS id="type1">
<TAGS measure="measure" weight="weight" level="level" all="all"/>
<LABELTEMPLATE expression="%FUNCTION of %MEASURE, by %WEIGHT"/>
<!-- Sum -->
<FORMULA id="WSUM" name="Weighted Sum" type="SMSWND">
<!-- Single Measure Single Weight No Derivation -->
<UDF id="wx_udf"/>
</FORMULA>
<FORMULA id="WRSEDC" name="Standard Error of Sum" type="SMSW" level="true">
<!-- Single Measure Single Weight -->
<UDF id="wx_udf"/>
<UDF id="wxx_udf"/>
<COEFF>n</COEFF>
<COEFF>N</COEFF>
<DER_EXPRESSION>(Sqrt(("wxx_udf" - ("wx_udf"*"wx_udf"/"weight"))/(("weight" - 1) * "level")*"weight"*"weight" + ("N"-"weight")*(1-"n"/"N")*"weight"/"n")) </DER_EXPRESSION>
</FORMULA>
<FORMULA id="RSEJK1" name="Standard Error of Sum (JK) of Sum" type="SMRW">
<!-- Single Measure Replicate Weight -->
<UDF id="wx_udf"/>
<COEFF>G</COEFF>
<WEIGHT/>
<SIGMA id="Sigma">
<UDF id="wx_udf"/>
<SIGMA_EXPR>(("wx_udf_i"-"wx_udf")*("wx_udf_i"-"wx_udf"))</SIGMA_EXPR>
</SIGMA>
<DER_EXPRESSION>(Sqrt((("G"-1)/"G") * "Sigma"))</DER_EXPRESSION>
</FORMULA>
<!-- /Sum -->
<!-- percentages -->
<FORMULA id="WMEAN" name="%" type="SMSW" dp="1">
<!-- Single Measure Single Weight -->
<UDF id="wx_udf"/>
<DER_EXPRESSION>("wx_udf"%refF("wx_udf")) </DER_EXPRESSION>
</FORMULA>
<FORMULA id="WMEAN" name="Standard Error of %" type="SMSW" dp="1">
<!-- Single Measure Single Weight -->
<UDF id="wx_udf"/>
<UDF id="wxx_udf"/>
<COEFF>n</COEFF>
<COEFF>N</COEFF>
<DER_EXPRESSION>("wx_udf"%refF("wx_udf")) * (Sqrt(("N"/("N"-1)) * (1 - "n"/"N") * ("N"/"n") * ("wx_udf"/"wx_udf" - "wx_udf"/refF("wx_udf"))/"wx_udf")) </DER_EXPRESSION>
</FORMULA>
<!-- /percentages -->
<!-- means -->
<!-- Statistical Function "Mean"-->
<FORMULA id="MEAN" name="Mean" type="SMSF">
<UDF id="x_udf"/>
<UDF id="w_udf"/>
<MEASURE_FIELD>x_udf</MEASURE_FIELD>
<WEIGHT_FIELD>w_udf</WEIGHT_FIELD>
</FORMULA>
<!-- Statistical Function "Standard Error of Mean"-->
<FORMULA id="STANDSEM" name="Standard Error of Mean" type="SMSF">
<UDF id="x_udf"/>
<UDF id="w_udf"/>
<MEASURE_FIELD>x_udf</MEASURE_FIELD>
<WEIGHT_FIELD>w_udf</WEIGHT_FIELD>
</FORMULA>
<!-- Statistical Function "Standard Deviation"-->
<FORMULA id="STANDDEV" name="Standard Deviation" type="SMSF">
<UDF id="x_udf"/>
<UDF id="w_udf"/>
<MEASURE_FIELD>x_udf</MEASURE_FIELD>
<WEIGHT_FIELD>w_udf</WEIGHT_FIELD>
</FORMULA>
<!-- Statistical Function "Variance"-->
<FORMULA id="VARIANCE" name="Variance" type="SMSF">
<UDF id="x_udf"/>
<UDF id="w_udf"/>
<MEASURE_FIELD>x_udf</MEASURE_FIELD>
<WEIGHT_FIELD>w_udf</WEIGHT_FIELD>
</FORMULA>
<!-- \means -->
<!-- GINI -->
<!-- Statistical Function "Gini"-->
<FORMULA id="GINI" name="Gini" type="SMSF">
<UDF id="x_udf"/>
<UDF id="w_udf"/>
<MEASURE_FIELD>x_udf</MEASURE_FIELD>
<WEIGHT_FIELD>w_udf</WEIGHT_FIELD>
</FORMULA>
<!-- /GINI -->
<!-- Unweighted Sum -->
<FORMULA id="UWSUM" name="Unweighted Sum" type="UNW">
<!-- Single Measure Single Weight -->
</FORMULA>
<!-- /Unweighted Sum -->
<UDF_DEFINITION id="x_udf">
<UDF_FORMULA>("measure")</UDF_FORMULA>
</UDF_DEFINITION>
<UDF_DEFINITION id="w_udf">
<UDF_FORMULA>("weight")</UDF_FORMULA>
</UDF_DEFINITION>
<UDF_DEFINITION id="wx_udf">
<UDF_FORMULA>("measure"*"weight")</UDF_FORMULA>
</UDF_DEFINITION>
<UDF_DEFINITION id="wxx_udf">
<UDF_FORMULA>("measure"*"measure"*"weight")</UDF_FORMULA>
</UDF_DEFINITION>
<UDF_DEFINITION id="ww_udf">
<UDF_FORMULA>("weight"*"weight")</UDF_FORMULA>
</UDF_DEFINITION>
</WEIGHTFORMULAS>
Structure
<WEIGHTFORMULAS> | The root node. |
---|---|
<TAGS> | Tags that are used in the temporary derivations and UDFs. |
<LABELTEMPLATE> | Defines a template text string (in the
|
<FORMULA> | A statistical formula defining the weighting. Each formula has the following attributes:
|
<UDF> | Identifies a UDF that will be used in the calculation. |
<COEFF> | Identifies a coefficient (defined in the weightings file) that is being used in the calculation. |
<WEIGHT> | Identifies a weight that will be used in the calculation. |
<SIGMA> | For formulae with replicate weights only. Defines an expression that will be repetitively generated for each replicate weight. All of these generated expressions will be added together into one expression and substituted into the derivation expression. Use the |
<DER_EXPRESSION> | An expression used to calculate a derivation. Derivations are calculated based on the aggregated results of the fields in the table. |
<UDF_DEFINITION> | An expression used to calculate a user defined field. User defined fields are calculated based off the unit records. |
Supported Formula Types
The type element of the <FORMULA>
tag indicates the type of formula:
SMSW | Single Measure Single Weight | These formulas can be expressed as:
|
---|---|---|
SMRW | Single Measure Replicate Weight | These types of formulae are expressed as a derivation that is dependent upon any of the following:
|
UNW | Unweighted | This is a dummy formula that will take no effect on the measure (the original result will be displayed). This is required in the XML file. |
If you are have configured Perturbation for confidentiality, then tabulation results will not be available when using SuperCROSS client weighting and any of the weighted summation options defined in the formulas.xml file. This is because these custom weighted functions do not have R Keys to allow the perturbed results to be calculated.