- Fixed a bug related to variances for clustered designs (e.g., multiple responses per respondent) that was erroneously handling clusters. The bug arose from an unintended difference in calculating variances when designs were weighted versus not. All designs now estimate AMCEs using
svyglm()
for consistency. Weighted designs with weights provided to theweight
argument ofcj()
,amce()
, etc. were unaffected. Analysts using the package for unweighted designs should update results to obtain appropriately conservative standard errors of AMCEs. Tests of this behavior have now been added (#15). - Fixed a bug wherein
mm_diffs()
returned 90% rather than 95% confidence intervals. (#37, h/t @hoellers) - Fixed a bug in
mm()
whereinalpha
was ignored. - Fixed a bug in
mm_diffs()
whereinh0
was ignored. - Added an error when attempting to use
by
variables incj()
that contain empty character string levels. (#32, h/t Farsan Ghassim) amce_by_reference()
now returns aREFERENCE
column rather than aBY
column, for clarity. (#35, h/t Farsan Ghassim)- Documentation clarifies behavior of
mm_diffs()
to allow >= 2 levels forby
factor. (#33, h/t Farsan Ghassim) cj()
now explicitly requires that all variables inby
are factor and ensures factor level ordering is carried forward from input data to output data.- Added more informative error message when trying to plot by a missing grouping variable.
- Added additional examples of plotting behavior, including ggplot2 fill/color scales and theming.
cj_df()
now ignoresdrop
(for behavior consistent with "tibble" rather than base "data.frame" tables)- All functions now handle "survey.design" objects for
data
as documented, with the exception ofmm()
andmm_diffs()
.
- Fixed issue in
mm_diffs()
wherein aby
variable that shared levels with a feature variable led to incorrect estimates being returned. (#22, h/t Michael Jankowski) - A warning is now issued when levels are not unique across feature. (#13, h/t Chris Wratil)
- Updated documentation with various fixes (#19, #20, #21, #23, h/t Matthew Barnfield, Evgeniia Mitrokhina)
- Added error when feature variables are not factors. (#12, #25, Maciej Szymkiewicz)
- Added documentation of how to replace colour scale with shape scale in
plot()
methods. (#18, h/t Mia Costa) - Added documentation of how to print estimates on the
plot()
method output. (#14) - Make
cj_tidy()
work with tibbles. (#11, Umberto Mignozzetti)
- CRAN release.
cj()
now imposes class "cj_df" ondata
to preserve attributes during subsetting.
- Added function
cj_table()
, which can be useful in communicating the set of features and levels used in the design as a data frame (e.g,. usingknitr::kable(cj_table(data, ~ feat1 + feat2))
). - Renamed functions
props()
->cj_props()
andfreqs()
tocj_freqs()
for API consistency.
- Added function
cj_df()
, which provides a modified data frame class ("cj_df") that preserves variable "label" attributes when subsetting. - Built-in datasets
immigration
andtaxes
gain a "cj_df" class. cj_tidy()
now returns objects of classc("cj_df", "data.frame")
.
- Added function
cj_tidy()
to tidy a "wide" respondent-length conjoint dataset into a "long" respondenttaskalternative-length dataset. An example dataset,wide_conjoint
, is provided for examples and testing.
- First stable release.
- Completed functionality of
amce_diffs()
, limiting it to work with unconstrained designs. (#6) - Added tests for accuracy of AMCEs in two-way constrained and fully unconstrained designs.
- Added support for constrained designs (when two-way constraints are present). (#6)
- Removed margins dependency, leaving only linear probability model support.
- Added another example datast,
taxes
, from Ballard-Rosa et al. (2016). - Renamed
hainmueller
dataset toimmigration
.
- Expanded test suite to cover survey-weighted data. Note:
cj_anova()
currently does not work with weighted data due to a bug insurvey::anova.svyglm()
. - Cleaned up internal code for consistency.
- Added 'statistic' column to function outputs.
- Variances returend by
amce_diffs()
now respect clustering. (#9)
- Fixed a factor ordering issue in
mm_diffs()
. - Added tests of numeric accuracy of estimates for all main functions.
- Added new function
mm_diffs()
for calculating differences in marginal means.
mm()
gains anh0
argument to specify a null hypothesis values so that z statistics and p-values are meaningful.- Cleaned up documentation and expanded 'Introduction' vignette, moving README content to there.
- Require survey version 0.33 (for
family
argument). - Added a basic test suite. (#4)
- Added
amce_diffs()
andamce_anova()
functions to assess differences in AMCEs by a grouping variable. - Removed some grouping warnings from
plot()
methods. (#8)
- Fixed a bug in the creation of
svydesign()
objects that was generating incorrect variance estimates. - Fully imported ggplot2 and ggstance.
- Added
props()
function to calculate display proportions for features or combinations of features (e.g., for examining constrained designs). Updated documentation accordingly. (#2) - Expanded Introduction vignette with examples of a number of diagnostics. (#2)
- Added
amce_by_reference()
function to examine sensitivity of results to choice of reference category. (#2)
- Changed the
level
argument toalpha
to avoid ambiguity with "levels" in the "feature level" sense used in the package (as opposed to the intended alpha or significance level). - Added a
level_order
argument tofreqs()
,mm()
, andamce()
that specifies whether feature levels are ordered ascending in the output or descending. This is mostly only useful for plotting to specify whether the levels within each feature should be ordered with lower factor levels at the top ("ascending") or at the bottom ("descending") of the plot. (#1) cj()
gains aby
argument, which enables subgroup analyses, for example to investigate profile spillover effects or analyses by subsets of respondents. (#3)- Added vignettes: "Introduction" and "Reproducing Hainmueller et al. (2014)". The latter is a work in progress. (#7)
- Changed name of
freq()
tofreqs()
and prefixed class names of return values from all functions withcj_*
. - Added
feature_order
argument to all functions to regulate display order. - Fixed a bug in the handling of
header_fmt
inplot()
. - Updated README with example of
freqs()
.
- Initial release.