posc 0.2.0
CRAN release: 2026-10-21
New features
-
posc_emp()estimates a POSC directly from raw data, with no normality assumption: a spline logistic regression on all pairwise differences (or a random subset ofmax_pairsof them for large samples), set up so that P(0) = 0.5 and P(-delta) = 1 - P(delta), with a person-level bootstrap confidence band. -
posc_emp()also computes observed proportions in bins of the difference (bins= number of equal-count bins or a vector of breakpoints).plot()draws them as points with simultaneous (family-wise) confidence intervals, computed by a max-t bootstrap on the empirical-logit scale so they are asymmetric and stay within [0, 1].posc_bins()returns them as a table. -
plot(x, mark = ...)highlights chosen differences: a guide line runs from the x-axis up to the curve, with the probability labelled (addmark_ci = TRUEfor its confidence interval). Works for single curves and comparisons. -
posc_uni(),posc_multi(),posc_lm()andposc_emp()return a"posc"object withprint(),summary(),plot(),autoplot(),predict()andas.data.frame()methods.predict()gives probabilities and confidence intervals at any difference. -
plot(x, full = TRUE)draws the full sigmoid over negative and positive differences. -
posc_comp()accepts any number of curves (named or withlabels) and uses a homogeneity test of the correlations when there are more than two. -
posc_multi()andposc_lm()gainadjust, which uses the adjusted multiple correlation by default to correct the optimism of in-sample R. - Redesigned plots: by default just the curve and its confidence band, with axis lines, very light gridlines and a probability axis in steps of 0.1. Options add percentages (
percent = TRUE), remove gridlines (grid = FALSE), an automatic title and subtitle (title = TRUE,subtitle = TRUE), and for empirical curves the binned proportions (bins = TRUE) and normal-theory curve (reference = TRUE). Comparisons use a colour-blind-safe palette.
Development
- The core of the package was written by the author; Claude (Anthropic) assisted with extending, documenting and testing the code in this version, under the author’s direction and review.
Bug fixes
- The x-axis of
posc_uni(),posc_multi()andposc_lm()plots was stretched by a factor of sqrt(2) relative to the plotted probabilities. Differences are now on the predictor’s own scale. -
posc_lm()referred to an objectmdlthat did not exist and assumed the response was namedy; it now works with anylm()model. - Functions no longer change the global
warnoption.
Breaking changes
- Curves are computed for signed differences, and always as the probability of a higher outcome. With a negative relationship the curve falls below 0.5, rather than being relabelled as the probability of a lower outcome.
-
ci.lvlis nowlevel; colours are set inplot()rather than when the curve is created;posc_multi(outcome_idx =)is nowoutcome =(the old name still works, with a warning). - The returned object is a
"posc"list with acurvedata frame (delta,p,lower,upper), replacingpredict_matrixandposc_plot_object. - Plots are no longer drawn automatically; call
plot()on the result. - The unused ggExtra dependency was removed.
