Changelog
Source:NEWS.md
conjointmatchups 0.0.0.9000
afcp()no longer drops a study whose outcome has no variation (every task won, or every task lost). Under estimatr 2.0.1 such a fit returns an unnamedNAstandard error, which made the extraction error insidetryCatch(). The row now keeps its estimate with anNAstandard error.Initial scaffold.
as_tasks()/as_profiles(): lossless pivot between profile-long and task-wide representations of a forced-choice conjoint.get_matchups(): extract the subset of tasks realizing a specified contrast between two profiles, with a clean binary outcome.valid_contrast()/contrast_message(): guard against ill-defined (non-mutually-exclusive) contrasts.check_conjoint(): validate the forced-choice data contract.afcp(): thin Average Feature Choice Probability estimator over a matchup.se_typenow defaults toNULL, deferring tolm_robust()’s own default (CR2when clustered,HC2otherwise); the previous hard-coded"stata"silently changed the standard errors. Newmin_clustersargument (default 2) drops groups with too few clusters to estimate, matching the study-level behavior in the meta-analysis pipeline. Validated to reproduce the paper’s Shiny-app estimates bit-for-bit on the full 163-study corpus.afcp()returnsn_clusters(distinct clusters, i.e. respondents) alongsiden(observations, i.e. choice tasks).lm_robust()was already computing the cluster count on the fit being summarised and the tibble discarded it, which left a caller no way to report respondents at all.Bug fix:
afcp()now tests against a null of 0.5 rather than 0. The AFCP is a choice probability, so the coin-flip null is the one of interest; the intercept testlm_robust()reports is against 0, which madep.valueessentially 0 for any well-powered study, including one whose estimate sat exactly at 0.5. Newnull_valueargument (default0.5) sets the null; passnull_value = 0to recover the old intercept test.estimate,std.errorand the confidence interval are unchanged.Bug fix:
get_matchups()with an unconstrained side (an emptyAorBlist) no longer errors with phantom_1/_2columns (apaste0()zero-length recycling gotcha).Bug fix:
afcp()now drops a degenerate study (e.g. a single cluster) whose fit returns unusable components, instead of erroring during coefficient extraction; thetryCatchcovers extraction, not just the model fit.Test coverage raised to ~99% (added tests for weights, unconstrained-side matchups, degenerate-fit handling, and the input-validation error paths).