Desktop User Guides > Professional > Data management scripting > Working with the Weight component > Weight component examples > Factor weighting example
Factor weighting example
Defining factor weighting (see Factor weighting) is similar to defining target weighting, except that you specify the actual weighting factors instead of the target figures. For example, suppose you want to create weighting that is based on an equal balance between male and female respondents and you have already calculated the weighting factors that need to be applied as:
To define this weighting, you need to change only two lines in the example script in Simple target weighting example. First, you would need to change the third parameter of the CreateWeight method to specify that we want factor weighting:
Set Wgt = WgtEng.CreateWeight("weight", "gender", 1)
Second, you need to specify the factors instead of the targets:
Wgt.CellRows.Factors = "0.8879; 1.1445"
An example of factor weighting is in the UNICOM Intelligence Developer Documentation Library as a sample script called Weight4.mrs. For more information, see Sample mrScriptBasic files.
UNICOM Intelligence Professional
Weight component examples