Toggle navigation
Home
▼ Details
Products and pricing
Chart gallery
User stories
Text analytics
CDC NAMCS Library
Blog
Tutorials
Contact
Sign in
Post Editor
← All help posts
View post
Save
## Weight to multiple target characteristics The weighting examples above are applicable when you only want to apply one weight scheme to the project at a time. However, you might want to weight to multiple target characteristics. We can do this using Random Iterative Method, also known as RIM weighting or raking. For example, a survey sample may have set quotas to equally sample physicians and nurses , but in the target market nurses may be 70% of customers. <table style="width: 100%;"><tbody><tr><td style="width: 33.3333%; text-align: justify;"><strong>Gender</strong></td><td style="width: 33.3333%;"><strong>Survey </strong></td><td style="width: 33.3333%;"><strong>Population</strong></td></tr><tr><td style="width: 33.3333%;">Physician</td><td style="width: 33.3333%;">50%</td><td style="width: 33.3333%;">30%</td></tr><tr><td style="width: 33.3333%;">Nurse</td><td style="width: 33.3333%;">50%</td><td style="width: 33.3333%;">70%</td></tr></tbody></table> Similarly, the distribution of region in the survey may differ from the target population. <table style="width: 100%;"><tbody><tr><td style="width: 33.3333%;"><strong>Region</strong></td><td style="width: 33.3333%;"><strong>Survey sample</strong></td><td style="width: 33.3333%;"><strong>Population</strong></td></tr><tr><td style="width: 33.3333%;">East</td><td style="width: 33.3333%;">40%</td><td style="width: 33.3333%;">30%</td></tr><tr><td style="width: 33.3333%;">West</td><td style="width: 33.3333%;">60%</td><td style="width: 33.3333%;">70%</td></tr></tbody></table> It is possible to calculate one weight scheme that adjusts the distribution for more than one variable. This is a little more complex, as setting weights for one variable may affect the distribution of other correlated variables. For this you can use an iterative algorithm called "Rim weighting", described [here](https://gist.github.com/pietersv/2855695b0c4f79a8ce242f14655a8adc) and also in the accordion below. This gist shows a function that calculates weights for selected variables, and runs in a [data process](/admin-access/project-data) . ## Example RIM weighting algorithm ``` Protobi.get_tables(["main", "OE"], function(err, data) { if (err) return callback(err); Protobi.get_elements(function(err, protobi) { if (err) return callback(err); var rows= data["main"] //primary data file protobi.setData(rows); Protobi.calculate_rim_weights( protobi, 'weight', { "s3":{ "1":0.49, "2":0.51 }, "s2":{ "0":0.84, "1":0.16 }, "region":{ "Northeast":0.17, "Midwest":0.21, "West":0.24, "South":0.38, } }) return callback (null, rows) }) }) ``` [Delete](#) # Support Weighting can get complex and each firm has its own approaches. Our support team is ready to help you with your specific goals. We can help you setup code that does what you need and show you how to modify it from there. Please contact us at [support@protobi.com.](mailto:support@protobi.com)
Publishing
Date
Status
Published
Draft
Slug
edit
Content
Thumbnail
Categories
Manage
New to Protobi?
Charts
Making Changes
Intermediate topics for editors
Frequently Asked Questions
SERMO Topics
Tutorial Pages
Internal Docs
Data Processing
Videos
Obsolete
GSG Admin
SERMO Admin
GSG Topics
How to...
Basics for viewers
Basics for editors
For project admins
Advanced topics
Assessments
Articles (in-progress)
New and updated articles
Process data in Protobi
superseded
Text open-end questions
Troubleshooting
Tracking studies
Organizing the view
API References
Tools
AI Database
Checking AI...
Convert to MD
Danger zone
Delete