Public
Edited
Sep 17, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
results = icare.validateAbsoluteRiskModel(cleanParams(params, icareModelParameters));
Insert cell
Insert cell
Insert cell
Object.keys(results)
Insert cell
Insert cell
`iCARE method used: ${results.method}`
Insert cell
Insert cell
results.info
Insert cell
Insert cell
viewof studyDataResults = Inputs.table(results.study_data)
Insert cell
Insert cell
viewof incidenceRates = Inputs.table(results.incidence_rates)
Insert cell
Insert cell
results.auc
Insert cell
Insert cell
results.expected_by_observed_ratio
Insert cell
Insert cell
results.calibration
Insert cell
Insert cell
viewof categorySpecificCalibration = Inputs.table(results.category_specific_calibration)
Insert cell
Insert cell
Insert cell
`
${results.method} results
==============================================

Dataset name: ${results.info.dataset_name}
Model name: ${results.info.model_name}
Risk prediction interval: ${results.info.risk_prediction_interval}
Number of subjects (cases): ${studyDataResults.length} (${studyDataResults.filter(d => d.observed_outcome === 1).length})
Follow-up time (years) [mean, range]: [${describeStatistics(studyDataResults.map(d => d.followup)).mean.toFixed(3)}, (${describeStatistics(studyDataResults.map(d => d.followup)).min}, ${describeStatistics(studyDataResults.map(d => d.followup)).max})]
Baseline age (years) [mean, range]: [${describeStatistics(studyDataResults.map(d => d.study_entry_age)).mean.toFixed(3)}, (${describeStatistics(studyDataResults.map(d => d.study_entry_age)).min}, ${describeStatistics(studyDataResults.map(d => d.study_entry_age)).max})]
E/O [estimate, 95% CI]: ${results.expected_by_observed_ratio.ratio.toFixed(3)} (${results.expected_by_observed_ratio.lower_ci.toFixed(3)}, ${results.expected_by_observed_ratio.upper_ci.toFixed(3)})
`
Insert cell
Insert cell
`
Absolute risk calibration
--------------------------------
Statistical test: ${results.calibration.absolute_risk.method}
Test statistic: ${results.calibration.absolute_risk.statistic.chi_square.toFixed(3)}
Degrees of freedom: ${results.calibration.absolute_risk.parameter.degrees_of_freedom}
P-value: ${results.calibration.absolute_risk.p_value.toExponential(3)}

Relative risk calibration
--------------------------------
Statistical test: ${results.calibration.relative_risk.method}
Test statistic: ${results.calibration.relative_risk.statistic.chi_square.toFixed(3)}
Degrees of freedom: ${results.calibration.relative_risk.parameter.degrees_of_freedom}
P-value: ${results.calibration.relative_risk.p_value.toExponential(3)}

Model discrimination
--------------------------------
AUC: ${results.auc.auc.toFixed(3)}
95% CI: (${results.auc.lower_ci.toFixed(3)}, ${results.auc.upper_ci.toFixed(3)})
`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
icare = (
await import(
"https://cdn.jsdelivr.net/gh/jeyabbalas/wasm-icare@1.0.0/dist/wasm-icare.js"
)
).loadWasmICARE()
Insert cell
Insert cell
Insert cell
Insert cell
riskViz = import(
"https://cdn.jsdelivr.net/gh/jeyabbalas/risk-viz@0.0.1/dist/risk-viz.js"
)
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more