Scoring_Conti: Score Continuous Pairwise Comparisons

View source: R/Scoring_Conti.R

Scoring_ContiR Documentation

Score Continuous Pairwise Comparisons

Description

Assigns win, loss, tie, or unresolved scores to subject pairs based on a continuous endpoint. This function is typically used after higher-priority layers have left a pair unresolved.

Usage

Scoring_Conti(dataset, higher_better, var1, var2)

Arguments

dataset

A data frame containing pairwise subject comparisons. The data frame must contain columns named score, WR_cat, usubjid1, and usubjid2.

higher_better

Character. Use "Yes" when higher values are better and "No" when lower values are better.

var1

Character. Name of the continuous endpoint column for subject 1.

var2

Character. Name of the continuous endpoint column for subject 2.

Value

A data frame matching dataset, with updated score and WR_cat columns. Scores are 1 when subject 1 wins, -1 when subject 2 wins, 0 for exact or near-exact ties, and NA when either value is missing.

Examples

pairs <- data.frame(
  usubjid1 = c(1, 1, 2),
  usubjid2 = c(3, 4, 4),
  kccq1 = c(15, 10, NA),
  kccq2 = c(10, 10, 12),
  score = NA_real_,
  WR_cat = ""
)

Scoring_Conti(pairs, higher_better = "Yes", var1 = "kccq1", var2 = "kccq2")

winratiosim documentation built on July 7, 2026, 1:07 a.m.