BlyxDocumentation
Browse chapters
Documentation / Workflow recipes

Jacana · Compare a crude rate with a standardized rate

Compare a crude event rate with a directly standardized rate.

Compare a crude rate with a standardized rate

A change in the mix of observed groups can move the pooled rate. Recalculate rates against fixed reference weights before comparing populations. The crude event rate is 0.75. Equal reference weights give each stratum the same influence and reduce the standardized rate to 0.5.

Run the framework with your own input

Install Blyx 0.2.1 and a Rust toolchain with a host linker, then run the versioned project. Each positional argument is a number or a comma-separated numerical vector. The CLI accepts up to 16 entries per vector. The imported module accepts longer inputs.

git clone --depth 1 --branch v0.1.1 https://github.com/Rahulchaube1/blyx-jacana.git
cd blyx-jacana
blyxc native-run project.blyx -- "0,6" "2,6" "1,1"

API and return values

Returns [crude rate, standardized rate, standardized minus crude, total observations]. Each reported stratum needs observations for the crude comparison. Causal interpretation depends on study design. Invalid input returns an empty vector.

ArgumentAccepted input
eventsVector of: nonnegative exact integer
trialsVector of: nonnegative exact integer
weightsVector of: nonnegative finite number

Use the libraries independently

The framework vendors the same library source published in these two repositories. Each module has its own package page, input contract and regression suite.

Try the program

Output Ready
Expected output
0.75
0.5
-0.25
8
Open in the full playground →

Practice

Change events = [1, 1], trials = [2, 2], weights = [2, 1]. Predict the result, then run the program.

Hint

Returns [crude rate, standardized rate, standardized minus crude, total observations]. Each reported stratum needs observations for the crude comparison. Causal interpretation depends on study design.

Worked solution

The result vector is [0.5, 0.5, 0, 4]. Compare its fields with the return layout in the API section.

Find

    let events = [0, 6];

Replace with

    let events = [1, 1];

Find

    let trials = [2, 6];

Replace with

    let trials = [2, 2];

Find

    let weights = [1, 1];

Replace with

    let weights = [2, 1];

Output after the change

0.5
0.5
0
4