Skip to main content
Skip table of contents

weightings.xml - SuperCROSS

The weightings.xml file is used to configure client-side weightings for SuperCROSS. There must be one weightings XML file for each weighted database.

File Name

<database_id>_weightings.xml or <sxv4_filename>_sa_weightings.xml (depending on which weighting setting is selected for this database)

If you have opened the database in local mode, then the database ID is set when you add the SXV4 to the Catalogue in SuperCROSS. You can check the location and ID of local databases by looking at the [DBPath] section of the ssii.ini configuration file.

If you have opened the database through SuperSERVER then you can check the ID using the cat command in SuperADMIN.

Location

For databases opened in local mode, the file must be in the same location on disk as the SXV4 database file.

If you opened the SXV4 by connecting to SuperSERVER, then the weightings file must be located in the [DefaultDBPath] directory set in the ssii.ini configuration file.

The default DB path is not set by default, so if you have not already done so you will need to specify a directory, either by adding it to the ssii.ini configuration file directly or by going to Edit > Options > Configuration > SXV4 and Local Access in SuperCROSS and setting the SXV4 Default DBPath. You will need to restart SuperCROSS to apply this change.

Example

XML
<DATABASE_WEIGHTINGS dbid="weightedsurvey" formula_file="formulas.xml">
    <WEIGHT id="Replicate weights" type="Replicate" level="Person">
        <CODE>Main Weight</CODE>
        <CODE>Weight Replicate 1</CODE>
        <CODE>Weight Replicate 2</CODE>
        <CODE>Weight Replicate 3</CODE>
        <CODE>Weight Replicate 4</CODE>
        <CODE>Weight Replicate 5</CODE>
    </WEIGHT>
	<WEIGHT id="Main Weight" type="Single" level="Person"/>
	<COEFF measure="all" weight_id="all">
	    <VAR id="?" value="1.64"/>
	</COEFF>
	<COEFF measure="all" weight_id="Replicate Weights">
		<VAR id="G" value="5"/>
	</COEFF>
	<COEFF measure="all" weight_id="all">
		<VAR id="N" value="15601100.0"/>
		<VAR id="n" value="11950.0"/>
		<VAR id="DEFT" value="1"/>
	</COEFF>
</DATABASE_WEIGHTINGS>

Structure

<DATABASE_WEIGHTINGS>

The root element. It has the following attributes:

  • dbid - The ID of the SXV4 database this weighting file applies to. You can check the location and ID of local databases by looking at the [DBPath] section of the ssii.ini configuration file.
  • formula_file - The filename and location of the XML file containing the formulas for this database. A single formula file can be shared between multiple weighted databases.

    The formula file does not have to be located in the same directory as the weightings file. If it is in a different directory, specify either the relative path to the file (for example: formula_file="..\Weightings\formulas.xml") or an absolute path (for example: formula_file="E:\Datasets\Weightings\formulas.xml").

<WEIGHT>

This element defines a set of weighting factors. The weightings file may contain multiple instances of the <WEIGHT> element.

Each <WEIGHT> element has the following attributes:

  • id - The ID of this set of weighting factors. This will be displayed in the Weight By drop-down list in the Define Recode dialog in SuperCROSS. For a single weight this must be the display name of the weight field; for replicate weights it can be any name. Note: this is case sensitive and must match the display name exactly.
  • type - the weighting type (either Single or Replicate).
  • level - the name of the fact table in the source data that the weighted field comes from.
<CODE>Name</CODE>

This element is required for replicate weights only. There must be one <CODE> element for each replicate weight.

The name must match the name of the column in the fact table that contains the weighting factor.

</WEIGHT>
The end of the weighting factor definition.
<COEFF>

This element defines any constant coefficients that are used in the formulas. These coefficients will be passed to the formulas file and can be used to define settings such as the size of the unweighted and weighted populations, and the number of replicate weights.

<COEFF> has the following attributes:

  • measure - Either the ID of the measure that this coefficient applies to, or all if it applies to all measures.
  • weight_id - The ID of the weighting factor that this applies to (this must match the id attribute of the corresponding <WEIGHT> element), or all if it applies to all weights.
<VAR ... />

The coefficient definition:

  • id - the of the coefficient to be passed to the formula file.
  • value - the value of the coefficient.

Although you can use any id values, we recommend using the following IDs for the following purposes:

G
The number of replicate weights.
N
The total size of the population.
n
The sample size.
DEFT
Used as a default value; its value can be set to 1.
</COEFF>
End of the coefficient definitions.
</DATABASE_WEIGHTINGS>
End of the database weighting definitions.
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.