diff --git a/docs/CONTRIBUTING.html b/docs/CONTRIBUTING.html index b68e73a..db80fc1 100644 --- a/docs/CONTRIBUTING.html +++ b/docs/CONTRIBUTING.html @@ -58,7 +58,7 @@ cregg - 0.2.1 + 0.2.3 diff --git a/docs/ISSUE_TEMPLATE.html b/docs/ISSUE_TEMPLATE.html index 397f40b..e44b5ce 100644 --- a/docs/ISSUE_TEMPLATE.html +++ b/docs/ISSUE_TEMPLATE.html @@ -58,7 +58,7 @@ cregg - 0.2.1 + 0.2.3 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 35700d1..5ce55cd 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -58,7 +58,7 @@ cregg - 0.2.1 + 0.2.3 diff --git a/docs/PULL_REQUEST_TEMPLATE.html b/docs/PULL_REQUEST_TEMPLATE.html index 6968c76..65d49fd 100644 --- a/docs/PULL_REQUEST_TEMPLATE.html +++ b/docs/PULL_REQUEST_TEMPLATE.html @@ -58,7 +58,7 @@ cregg - 0.2.1 + 0.2.3 diff --git a/docs/articles/Introduction.html b/docs/articles/Introduction.html index 8d1b594..5ecf72e 100644 --- a/docs/articles/Introduction.html +++ b/docs/articles/Introduction.html @@ -29,7 +29,7 @@ cregg - 0.2.1 + 0.2.3 @@ -81,7 +81,7 @@

-

As can be clear in the above, constraints were imposed in the original study on the allowed combinations of Job and Education and also on combinations of CountryOfOrigin and ReasonForApplication. The props() function provides tidy proportions tables to quickly

-
subset(props(immigration, ~Job + Education, id = ~CaseID), Proportion == 0)
+

As can be clear in the above, constraints were imposed in the original study on the allowed combinations of Job and Education and also on combinations of CountryOfOrigin and ReasonForApplication. The cj_props() function provides tidy proportions tables to quickly

+
subset(cj_props(immigration, ~Job + Education, id = ~CaseID), Proportion == 0)
                   Job   Education Proportion
 5    Financial Analyst   No Formal          0
 8  Computer Programmer   No Formal          0
@@ -286,7 +286,7 @@ 

41 Computer Programmer High School 0 43 Research Scientist High School 0 44 Doctor High School 0

-
subset(props(immigration, ~CountryOfOrigin + ReasonForApplication, id = ~CaseID), Proportion == 0)
+
subset(cj_props(immigration, ~CountryOfOrigin + ReasonForApplication, id = ~CaseID), Proportion == 0)
   CountryOfOrigin ReasonForApplication Proportion
 21           India   Escape Persecution          0
 22         Germany   Escape Persecution          0
diff --git a/docs/articles/Introduction_files/figure-html/amce_diagnostic-1.png b/docs/articles/Introduction_files/figure-html/amce_diagnostic-1.png
index 24023c1..088c30d 100644
Binary files a/docs/articles/Introduction_files/figure-html/amce_diagnostic-1.png and b/docs/articles/Introduction_files/figure-html/amce_diagnostic-1.png differ
diff --git a/docs/articles/Introduction_files/figure-html/amce_vs_mm-1.png b/docs/articles/Introduction_files/figure-html/amce_vs_mm-1.png
index 15b8eee..0924dcf 100644
Binary files a/docs/articles/Introduction_files/figure-html/amce_vs_mm-1.png and b/docs/articles/Introduction_files/figure-html/amce_vs_mm-1.png differ
diff --git a/docs/articles/Introduction_files/figure-html/balance_testing-1.png b/docs/articles/Introduction_files/figure-html/balance_testing-1.png
index 7344059..2b26b3c 100644
Binary files a/docs/articles/Introduction_files/figure-html/balance_testing-1.png and b/docs/articles/Introduction_files/figure-html/balance_testing-1.png differ
diff --git a/docs/articles/Introduction_files/figure-html/conditional_amces-1.png b/docs/articles/Introduction_files/figure-html/conditional_amces-1.png
index cba990f..68af422 100644
Binary files a/docs/articles/Introduction_files/figure-html/conditional_amces-1.png and b/docs/articles/Introduction_files/figure-html/conditional_amces-1.png differ
diff --git a/docs/articles/Introduction_files/figure-html/conditional_differences-1.png b/docs/articles/Introduction_files/figure-html/conditional_differences-1.png
index a675517..2818153 100644
Binary files a/docs/articles/Introduction_files/figure-html/conditional_differences-1.png and b/docs/articles/Introduction_files/figure-html/conditional_differences-1.png differ
diff --git a/docs/articles/Introduction_files/figure-html/conditional_mms-1.png b/docs/articles/Introduction_files/figure-html/conditional_mms-1.png
index 3e8798c..0b36a0f 100644
Binary files a/docs/articles/Introduction_files/figure-html/conditional_mms-1.png and b/docs/articles/Introduction_files/figure-html/conditional_mms-1.png differ
diff --git a/docs/articles/Introduction_files/figure-html/leftright-1.png b/docs/articles/Introduction_files/figure-html/leftright-1.png
index 3245277..127a99c 100644
Binary files a/docs/articles/Introduction_files/figure-html/leftright-1.png and b/docs/articles/Introduction_files/figure-html/leftright-1.png differ
diff --git a/docs/articles/Introduction_files/figure-html/mm_by-1.png b/docs/articles/Introduction_files/figure-html/mm_by-1.png
index 6c22cd1..fd9b14a 100644
Binary files a/docs/articles/Introduction_files/figure-html/mm_by-1.png and b/docs/articles/Introduction_files/figure-html/mm_by-1.png differ
diff --git a/docs/articles/Introduction_files/figure-html/mmplot-1.png b/docs/articles/Introduction_files/figure-html/mmplot-1.png
index 41793f0..f5a4aae 100644
Binary files a/docs/articles/Introduction_files/figure-html/mmplot-1.png and b/docs/articles/Introduction_files/figure-html/mmplot-1.png differ
diff --git a/docs/articles/Introduction_files/figure-html/plot_amce-1.png b/docs/articles/Introduction_files/figure-html/plot_amce-1.png
index fdb39f3..6998c41 100644
Binary files a/docs/articles/Introduction_files/figure-html/plot_amce-1.png and b/docs/articles/Introduction_files/figure-html/plot_amce-1.png differ
diff --git a/docs/articles/Introduction_files/figure-html/plot_freqs-1.png b/docs/articles/Introduction_files/figure-html/plot_freqs-1.png
index b7bf237..0a120ac 100644
Binary files a/docs/articles/Introduction_files/figure-html/plot_freqs-1.png and b/docs/articles/Introduction_files/figure-html/plot_freqs-1.png differ
diff --git a/docs/articles/index.html b/docs/articles/index.html
index 88394ca..6e2b853 100644
--- a/docs/articles/index.html
+++ b/docs/articles/index.html
@@ -58,7 +58,7 @@
       
       
         cregg
-        0.2.1
+        0.2.3
       
     
 
diff --git a/docs/authors.html b/docs/authors.html
index 28f34f0..cc1c3ec 100644
--- a/docs/authors.html
+++ b/docs/authors.html
@@ -58,7 +58,7 @@
       
       
         cregg
-        0.2.1
+        0.2.3
       
     
 
@@ -114,13 +114,13 @@ 

Citation

Leeper TJ (2018). cregg: Simple Conjoint Analyses and Visualization. -R package version 0.2.1. +R package version 0.2.3.

@Manual{,
   title = {cregg: Simple Conjoint Analyses and Visualization},
   author = {Thomas J. Leeper},
   year = {2018},
-  note = {R package version 0.2.1},
+  note = {R package version 0.2.3},
 }
@@ -149,6 +149,7 @@

Arg

Value

A data frame with rows equal to the number of respondents times the number of tasks times the number of profiles (fixed at 2), to be fed into any other function in the package. The columns will include the names of elements in profile_variables and task_variables, and id, along with an indicator task (from 1 to the number of tasks), pair (an indicator for each task pair from 1 to the number of pairs), profile (a fator indicator for profile, either “A” or “B”), and any other respondent-varying covariates not specified. As such, respondent-varying variables do not need to be specified to cj_tidy at all.

+

The returned data frame carries an additional S3 class (“cj_df”) with methods that preserve column attributes. See cj_df.

Details

@@ -160,7 +161,7 @@

Details

See also

-

cj

+

cj, cj_df

Examples

diff --git a/docs/reference/cregg-1.png b/docs/reference/cregg-1.png index 9cbe6fb..29d6401 100644 Binary files a/docs/reference/cregg-1.png and b/docs/reference/cregg-1.png differ diff --git a/docs/reference/cregg-2.png b/docs/reference/cregg-2.png index d1ced31..e63041e 100644 Binary files a/docs/reference/cregg-2.png and b/docs/reference/cregg-2.png differ diff --git a/docs/reference/cregg-3.png b/docs/reference/cregg-3.png index 60b3fa2..6dd7dd3 100644 Binary files a/docs/reference/cregg-3.png and b/docs/reference/cregg-3.png differ diff --git a/docs/reference/cregg-4.png b/docs/reference/cregg-4.png index 4d6f8ba..28c1fa7 100644 Binary files a/docs/reference/cregg-4.png and b/docs/reference/cregg-4.png differ diff --git a/docs/reference/cregg-5.png b/docs/reference/cregg-5.png index 7c7d6ba..38de98a 100644 Binary files a/docs/reference/cregg-5.png and b/docs/reference/cregg-5.png differ diff --git a/docs/reference/cregg-6.png b/docs/reference/cregg-6.png index 41c73db..afc3681 100644 Binary files a/docs/reference/cregg-6.png and b/docs/reference/cregg-6.png differ diff --git a/docs/reference/cregg.html b/docs/reference/cregg.html index dfe31bb..8f24795 100644 --- a/docs/reference/cregg.html +++ b/docs/reference/cregg.html @@ -61,7 +61,7 @@ cregg - 0.2.1 + 0.2.3 @@ -149,7 +149,7 @@

Arg estimate -

A character string specifying an estimate type. Current options are average marginal component effects (or AMCEs, “amce”, estimated via amce), display frequencies (“frequncies”, estimated via freqs), marginal means (or AMMs, “mm”, estimated via mm), differences in MMs (“mm_differences”, via mm_diffs), or differences in AMCEs (“amce_differences”, via amce_diffs). Additional options may be made available in the future. Non-ambiguous abbreviations are allowed.

+

A character string specifying an estimate type. Current options are average marginal component effects (or AMCEs, “amce”, estimated via amce), display frequencies (“frequncies”, estimated via cj_freqs), marginal means (or AMMs, “mm”, estimated via mm), differences in MMs (“mm_differences”, via mm_diffs), or differences in AMCEs (“amce_differences”, via amce_diffs). Additional options may be made available in the future. Non-ambiguous abbreviations are allowed.

feature_order @@ -169,19 +169,19 @@

Arg … -

Additional arguments to amce, freqs, mm, mm_diffs, or amce_diffs.

+

Additional arguments to amce, cj_freqs, mm, mm_diffs, or amce_diffs.

Details

-

The main function cj is a convenience function wrapper around the underlying estimation functions that provide for average marginal component effects (AMCEs), by default, via the amce function, marginal means (MMs) via the mm function, and display frequencies via freqs and props. Additional estimands may be supported in the future through their own functions and through the cj interface. Plotting is provided via ggplot2 for all types of estimates.

+

The main function cj is a convenience function wrapper around the underlying estimation functions that provide for average marginal component effects (AMCEs), by default, via the amce function, marginal means (MMs) via the mm function, and display frequencies via cj_freqs and cj_props. Additional estimands may be supported in the future through their own functions and through the cj interface. Plotting is provided via ggplot2 for all types of estimates.

The only additional functionality provided by cj over the underlying functions is the by argument, which will perform operations on subsets of data, returning a single data frame. This can be useful, for example, for evaluating profile spillover effects and subgroup results, or in any situation where one might be inclined to use a for loop or lapply, calling cj repeatedly on subgroups.

Note: Some features of cregg (namely, the amce_diffs) function, or estimate = "amce_diff" here) only work with full factorial conjoint experiments. Designs involving two-way constraints between features are supported simply by expressing interactions between constrained terms in formula (again, except for amce_diffs). Higher-order constraints may be supported in the future.

See also

-

Functions: amce, mm, freqs, mm_diffs, plot.cj_amce, cj_tidy +

diff --git a/docs/reference/diffs.html b/docs/reference/diffs.html index c5110a3..a2ffc33 100644 --- a/docs/reference/diffs.html +++ b/docs/reference/diffs.html @@ -61,7 +61,7 @@ cregg - 0.2.1 + 0.2.3
@@ -174,7 +174,7 @@

Arg … -

Additional arguments to amce, freqs, or mm.

+

Additional arguments to amce, cj_freqs, or mm.

@@ -192,7 +192,7 @@

Details

See also

- +

Examples

diff --git a/docs/reference/immigration.html b/docs/reference/immigration.html index c750fe9..3c3bfc7 100644 --- a/docs/reference/immigration.html +++ b/docs/reference/immigration.html @@ -61,7 +61,7 @@ cregg - 0.2.1 + 0.2.3 @@ -127,7 +127,7 @@

Immigration Conjoint Experiment Dataset from Hainmueller et. al. (2014)

Format

-

A data frame with 13960 observations on the following 16 variables.

+

A data frame (with additional “cj_df” class) with 13960 observations on the following 16 variables.

CaseID

a numeric vector indicating the respondent to which the particular profile corresponds

contest_no

a numeric vector indicating the number of the task to which the profile corresponds

Education

a factor with levels “No formal”, “4th grade”, “8th grade”, “High school”, “Two-year college”, “college Degree”, “Graduate degree”

@@ -156,14 +156,14 @@

Note

See also

- +

Examples

data("immigration") # view constraints between features -subset(props(immigration, ~ Job + Education, id = ~ CaseID), Proportion == 0)
#> Job Education Proportion +subset(cj_props(immigration, ~ Job + Education, id = ~ CaseID), Proportion == 0)
#> Job Education Proportion #> 5 Financial Analyst No Formal 0 #> 8 Computer Programmer No Formal 0 #> 10 Research Scientist No Formal 0 @@ -179,8 +179,8 @@

Examp #> 38 Financial Analyst High School 0 #> 41 Computer Programmer High School 0 #> 43 Research Scientist High School 0 -#> 44 Doctor High School 0

subset(props(immigration, ~ ReasonForApplication + CountryOfOrigin, - id = ~ CaseID), Proportion == 0)
#> ReasonForApplication CountryOfOrigin Proportion +#> 44 Doctor High School 0
subset(cj_props(immigration, ~ ReasonForApplication + CountryOfOrigin, + id = ~ CaseID), Proportion == 0)
#> ReasonForApplication CountryOfOrigin Proportion #> 3 Escape Persecution India 0 #> 6 Escape Persecution Germany 0 #> 9 Escape Persecution France 0 diff --git a/docs/reference/index.html b/docs/reference/index.html index e3175ab..c65ad2d 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -58,7 +58,7 @@ cregg - 0.2.1 + 0.2.3
@@ -135,6 +135,18 @@

cj_df() `[`(<cj_df>)

+ +

Create a “cj_df” data frame

+ + + +

cj_freqs() cj_props() cj_table()

+ +

Conjoint feature frequencies

+ +

cj_tidy()

@@ -153,12 +165,6 @@

freqs() props()

- -

Conjoint feature frequencies

- -

immigration

diff --git a/docs/reference/mm.html b/docs/reference/mm.html index bf6e3a3..77fc4c7 100644 --- a/docs/reference/mm.html +++ b/docs/reference/mm.html @@ -61,7 +61,7 @@ cregg - 0.2.1 + 0.2.3 diff --git a/docs/reference/plot-1.png b/docs/reference/plot-1.png index 864a9a0..62930c2 100644 Binary files a/docs/reference/plot-1.png and b/docs/reference/plot-1.png differ diff --git a/docs/reference/plot-2.png b/docs/reference/plot-2.png index 5ce0528..588bb8e 100644 Binary files a/docs/reference/plot-2.png and b/docs/reference/plot-2.png differ diff --git a/docs/reference/plot-3.png b/docs/reference/plot-3.png index 9a99c4a..0b4bfde 100644 Binary files a/docs/reference/plot-3.png and b/docs/reference/plot-3.png differ diff --git a/docs/reference/plot-4.png b/docs/reference/plot-4.png index 4d6f8ba..28c1fa7 100644 Binary files a/docs/reference/plot-4.png and b/docs/reference/plot-4.png differ diff --git a/docs/reference/plot-5.png b/docs/reference/plot-5.png index 449ef63..06d280b 100644 Binary files a/docs/reference/plot-5.png and b/docs/reference/plot-5.png differ diff --git a/docs/reference/plot.html b/docs/reference/plot.html index 31d69b0..e9f20dc 100644 --- a/docs/reference/plot.html +++ b/docs/reference/plot.html @@ -61,7 +61,7 @@ cregg - 0.2.1 + 0.2.3 diff --git a/docs/reference/taxes.html b/docs/reference/taxes.html index dba8e10..88e282d 100644 --- a/docs/reference/taxes.html +++ b/docs/reference/taxes.html @@ -61,7 +61,7 @@ cregg - 0.2.1 + 0.2.3 @@ -127,7 +127,7 @@

Tax Preference Conjoint Experiment Dataset from Ballard-Rosa et al. (2016)Format

-

A data frame with 32000 observations on the following 13 variables. Each row corresponds to a single profile presented to a respondent.

+

A data frame (with additional “cj_df” class) with 32000 observations on the following 13 variables. Each row corresponds to a single profile presented to a respondent.

chose_plan

A numeric vector denoting whether the immigrant profile was selected (=1) or not (=0).

taxrate1

An experimental factor with levels “<10k: 0%”, dQuote<10k: 5%, dQuote<10k: 15%, dQuote<10k: 25%.

taxrate2

An experimental factor with levels “10-35k: 5%”, dQuote10-35k: 15%, dQuote10-35k: 25%, dQuote10-35k: 35%.

@@ -149,7 +149,7 @@

SourceSee also

- +

Examples

diff --git a/docs/reference/wide_conjoint.html b/docs/reference/wide_conjoint.html index 9a7eb3f..9fb5a32 100644 --- a/docs/reference/wide_conjoint.html +++ b/docs/reference/wide_conjoint.html @@ -61,7 +61,7 @@ cregg - 0.2.1 + 0.2.3