diff --git a/pkgdown.yml b/pkgdown.yml index e7c4e97..80faeb2 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -12,7 +12,7 @@ articles: correction: correction.html projoint: projoint.html structure: structure.html -last_built: 2023-08-16T19:01Z +last_built: 2023-08-16T19:43Z urls: reference: https://yhoriuchi.github.io/projoint/reference article: https://yhoriuchi.github.io/projoint/articles diff --git a/reference/out1_arranged.html b/reference/out1_arranged.html index cf48b5d..e5678f5 100644 --- a/reference/out1_arranged.html +++ b/reference/out1_arranged.html @@ -59,7 +59,7 @@

Usage

Format

-

## `exampleData1` +

## `out1_arranged` A data frame with 201 rows and 186 columns:

ResponseId

Unique respondent ID

diff --git a/search.json b/search.json index a7f92ec..bc27198 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":[]},{"path":"https://yhoriuchi.github.io/projoint/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://yhoriuchi.github.io/projoint/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://yhoriuchi.github.io/projoint/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://yhoriuchi.github.io/projoint/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://yhoriuchi.github.io/projoint/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement yusaku.horiuchi@dartmouth.edu. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://yhoriuchi.github.io/projoint/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://yhoriuchi.github.io/projoint/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://yhoriuchi.github.io/projoint/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://yhoriuchi.github.io/projoint/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://yhoriuchi.github.io/projoint/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://yhoriuchi.github.io/projoint/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired [Mozilla’s code conduct enforcement ladder][https://github.com/mozilla/inclusion]. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://yhoriuchi.github.io/projoint/articles/01-setup.html","id":"generate-a-javascript-or-php-randomizer","dir":"Articles","previous_headings":"","what":"1.1 Generate a JavaScript or PHP randomizer","title":"1. Setting up your Qualtrics survey","text":"Strezhnev’s guide designing implementing conjoint surveys Qualtrics excellent reiterate . summarize: researchers first use ConjointSDT produce JavaScript PHP randomizer.","code":""},{"path":"https://yhoriuchi.github.io/projoint/articles/01-setup.html","id":"javascript","dir":"Articles","previous_headings":"1.1 Generate a JavaScript or PHP randomizer","what":"JavaScript","title":"1. Setting up your Qualtrics survey","text":"JavaScript randomizer can inputted first screen Qualtrics survey, using Edit Question Javascript functionality. See following screenshot example: Javascript available . JavaScript produced ConjointSDT run internally within Qualtrics automatically creates values embedded fields. attributes levels constitute profile pairs conjoint task. example, embedded field “K-1-1-7” contains value (level) seventh attribute first profile (two) first task, “K-5-2-5” contains level fifth attribute second profile (two) fifth task.","code":""},{"path":"https://yhoriuchi.github.io/projoint/articles/01-setup.html","id":"php","dir":"Articles","previous_headings":"1.1 Generate a JavaScript or PHP randomizer","what":"PHP","title":"1. Setting up your Qualtrics survey","text":"PHP randomizer must hosted server. following example hosted server: https://www.horiuchi.org/php/ACHR_Modified_2.php. (PHP file available .) PHP randomizer used Agadjanian, Carey, Horiuchi, Ryan (2023).","code":""},{"path":"https://yhoriuchi.github.io/projoint/articles/01-setup.html","id":"modify-your-javascript-or-php-randomizer","dir":"Articles","previous_headings":"","what":"1.2 Modify your Javascript or PHP randomizer","title":"1. Setting up your Qualtrics survey","text":"add additional constraints, removing ties two profiles, need revise PHP scripts Javascript manually. future release package, add additional feature make step easier. now, recommend use resources, including Open AI’s GPT-4), learn modify code. PHP example following manually added component end race one profile (candidate) always “White” another always “Black,” “Asian,” “Hispanic.” examples adding additional constraints, please send email package maintainer, Yusaku Horiuchi Thank !","code":"$treat_profile_one = \"B-\" . (string)$p . \"-1-\" . (string)$treat_number; $treat_profile_two = \"B-\" . (string)$p . \"-2-\" . (string)$treat_number; $cond1 = $returnarray[$treat_profile_one] == \"White\" && $returnarray[$treat_profile_two] == $type; $cond2 = $returnarray[$treat_profile_two] == \"White\" && $returnarray[$treat_profile_one] == $type; if ($cond1 or $cond2){$complete = True;}"},{"path":"https://yhoriuchi.github.io/projoint/articles/01-setup.html","id":"add-conjoint-tables-with-embedded-fields-in-qualtrics","dir":"Articles","previous_headings":"","what":"1.3 Add conjoint tables with embedded fields in Qualtrics","title":"1. Setting up your Qualtrics survey","text":"set JavaScript PHP randomizer, next step design, task, table using HTML insert embedded fiels. following screenshot first task example. complete HTML first conjoint task survey available . typical conjoint study include 5-10 tasks. number questions HTML pages correspond number tasks. embedded fields task different: first digit “K” increment 1 10 tasks progress.","code":""},{"path":"https://yhoriuchi.github.io/projoint/articles/01-setup.html","id":"adding-a-repeated-task-recommended","dir":"Articles","previous_headings":"1.3 Add conjoint tables with embedded fields in Qualtrics","what":"Adding a repeated task (recommended!)","title":"1. Setting up your Qualtrics survey","text":"wish implement repeated task, , need copy task repeated (say, first task) later point survey (say, fifth task). recommend researchers flip order two profiles well. Therefore, Profile 1 original task becomes Profile 2 new task. , simply swap middle digit embedded fields . repeated task look like following: complete HTML repeated conjoint task survey available . Importantly,repeated task, researchers can use measure intra-respondent reliability (IRR).","code":""},{"path":"https://yhoriuchi.github.io/projoint/articles/01-setup.html","id":"a-sample-qualtrics-survey","dir":"Articles","previous_headings":"","what":"1.4 A sample Qualtrics survey","title":"1. Setting up your Qualtrics survey","text":"want copy Qualtric survey designed exmaple, download QSF file import Qualtrics account. can use template design conjoint survey experiment!","code":""},{"path":"https://yhoriuchi.github.io/projoint/articles/02-wrangle.html","id":"load-the-projoint-package","dir":"Articles","previous_headings":"","what":"2.1 Load the projoint package","title":"2. Read and wrangle your data for conjoint analysis","text":"","code":"library(projoint)"},{"path":[]},{"path":"https://yhoriuchi.github.io/projoint/articles/02-wrangle.html","id":"with-the-flipped-repeated-tasks","dir":"Articles","previous_headings":"2.2 Read and wrangle data","what":"With the flipped repeated tasks","title":"2. Read and wrangle your data for conjoint analysis","text":"Let’s look simple example. expand arguments clarity: Let’s walk arguments specified. .dataframe data frame, ideally read Qualtrics using read_Qualtrics() necessarily. .idvar argument, character, indicates exampleData1, column ResponseId indicates unique survey respondents. .outcomes variable lists columns outcomes; last element vector repeated task (conducted). .outcomes_ids indicates possible options outcome; specifically, vector characters two elements, last characters names first second profiles. example, c(“”, “B”) profile names “Candidate ” “Candidate B”. character vector can anything, c(“1”, “2”), c(“”, “b”), etc. multiple tasks design, use profile names across tasks. .alphabet defaults “K” conjoint survey conducted using either tool Strezhnev’s Conjoint Survey Design Tool. final two arguments, .repeated .flipped, relate repeated task. .repeated set TRUE, last element .outcomes vector taken repetition first task; .flipped indicates whether profiles reversed order. See Section 2.3 .fill.","code":"outcomes1 <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes1 <- c(outcomes1, \"choice1_repeated_flipped\") out1 <- reshape_projoint(.dataframe = exampleData1, .idvar = \"ResponseId\", .outcomes = outcomes1, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE, .fill = FALSE)"},{"path":"https://yhoriuchi.github.io/projoint/articles/02-wrangle.html","id":"with-the-not-flipped-repeated-tasks","dir":"Articles","previous_headings":"2.2 Read and wrangle data","what":"With the not-flipped repeated tasks","title":"2. Read and wrangle your data for conjoint analysis","text":"slight variation, cases repeated task flipped – , repeated task, original Profile 1 still Profile 1, rather flipping positions Profile 2. specify changing .flipped FALSE.","code":"outcomes2 <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes2 <- c(outcomes2, \"choice1_repeated_notflipped\") out2 <- reshape_projoint(.dataframe = exampleData2, .idvar = \"ResponseId\", .outcomes = outcomes2, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = FALSE, .fill = FALSE)"},{"path":"https://yhoriuchi.github.io/projoint/articles/02-wrangle.html","id":"without-the-repeated-tasks","dir":"Articles","previous_headings":"2.2 Read and wrangle data","what":"Without the repeated tasks","title":"2. Read and wrangle your data for conjoint analysis","text":"cases repeated task , set .repeated FALSE .flipped NULL. Don’t worry, can still correct measurement error using extrapolation method; see third vignette details.","code":"outcomes3 <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) out3 <- reshape_projoint(.dataframe = exampleData3, .idvar = \"ResponseId\", .outcomes = outcomes3, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = FALSE, .flipped = NULL, .fill = FALSE)"},{"path":"https://yhoriuchi.github.io/projoint/articles/02-wrangle.html","id":"the--fill-argument","dir":"Articles","previous_headings":"","what":"2.3 The .fill argument","title":"2. Read and wrangle your data for conjoint analysis","text":".fill argument logical: TRUE want use information whether respondent chose profile repeated task “fill” (using ‘tidyr’ package) missing values non-repeated tasks, FALSE (otherwise). can see difference comparing results reshape_projoint .fill either TRUE FALSE. Looking subset variables, can see first data frame includes values agree variable (whether profile chosen ) repeated task. second data frame fills missing values non-repeated tasks. number respondents small, number specific profile pairs interest small, /number specific respondent subgroups want study small, worth changing option TRUE. please note .fill = TRUE based assumption IRR independent information contained conjoint tables. Although empirical tests suggest validity assumption, unsure , better use default value (FALSE).","code":"fill_FALSE <- reshape_projoint(.dataframe = exampleData1, .idvar = \"ResponseId\", .outcomes = outcomes1, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE, .fill = FALSE) fill_TRUE <- reshape_projoint(.dataframe = exampleData1, .idvar = \"ResponseId\", .outcomes = outcomes1, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE, .fill = TRUE) selected_vars <- c(\"id\", \"task\", \"profile\", \"selected\", \"selected_repeated\", \"agree\") fill_FALSE@data[selected_vars] ## # A tibble: 6,400 × 6 ## id task profile selected selected_repeated agree ## ## 1 R_00zYHdY1te1Qlrz 1 1 1 1 1 ## 2 R_00zYHdY1te1Qlrz 1 2 0 0 1 ## 3 R_00zYHdY1te1Qlrz 2 1 1 NA NA ## 4 R_00zYHdY1te1Qlrz 2 2 0 NA NA ## 5 R_00zYHdY1te1Qlrz 3 1 1 NA NA ## 6 R_00zYHdY1te1Qlrz 3 2 0 NA NA ## 7 R_00zYHdY1te1Qlrz 4 1 0 NA NA ## 8 R_00zYHdY1te1Qlrz 4 2 1 NA NA ## 9 R_00zYHdY1te1Qlrz 5 1 1 NA NA ## 10 R_00zYHdY1te1Qlrz 5 2 0 NA NA ## # ℹ 6,390 more rows fill_TRUE@data[selected_vars] ## # A tibble: 6,400 × 6 ## id task profile selected selected_repeated agree ## ## 1 R_00zYHdY1te1Qlrz 1 1 1 1 1 ## 2 R_00zYHdY1te1Qlrz 1 2 0 0 1 ## 3 R_00zYHdY1te1Qlrz 2 1 1 NA 1 ## 4 R_00zYHdY1te1Qlrz 2 2 0 NA 1 ## 5 R_00zYHdY1te1Qlrz 3 1 1 NA 1 ## 6 R_00zYHdY1te1Qlrz 3 2 0 NA 1 ## 7 R_00zYHdY1te1Qlrz 4 1 0 NA 1 ## 8 R_00zYHdY1te1Qlrz 4 2 1 NA 1 ## 9 R_00zYHdY1te1Qlrz 5 1 1 NA 1 ## 10 R_00zYHdY1te1Qlrz 5 2 0 NA 1 ## # ℹ 6,390 more rows"},{"path":"https://yhoriuchi.github.io/projoint/articles/02-wrangle.html","id":"what-if-your-data-is-already-clean","dir":"Articles","previous_headings":"","what":"2.4 What if your data is already clean?","title":"2. Read and wrangle your data for conjoint analysis","text":"already downloaded data set Qualtrics, loaded R, cleaned , can use make_projoint_data() save data frame tibble projoint_data object use projoint(). example. First, load data frame. look like tibble . row correspond one profile one task one respondent. data frame columns indicating (1) respondent ID, (2) task number, (3) profile number, (4) attributes, (5) column recording response (0, 1) task. design includes repeated task, also include column recording response repeated task. case, column select_repeated. Next, make character vector attributes. data frame attributes vector, can use make_projoint_data() produce projoint_data object. can see column indicating respondent ID called id, pass .id_var argument make_projoint_data. id also default argument. output function look output fill_FALSE previous section.","code":"data <- exampleData1_labelled_tibble options(tibble.width = Inf) data ## # A tibble: 6,400 × 14 ## id task profile selected selected_repeated `School Quality` ## ## 1 R_00zYHdY1te1Qlrz 1 1 1 1 9 out of 10 ## 2 R_00zYHdY1te1Qlrz 1 2 0 0 5 out of 10 ## 3 R_00zYHdY1te1Qlrz 2 1 1 NA 9 out of 10 ## 4 R_00zYHdY1te1Qlrz 2 2 0 NA 9 out of 10 ## 5 R_00zYHdY1te1Qlrz 3 1 1 NA 5 out of 10 ## 6 R_00zYHdY1te1Qlrz 3 2 0 NA 9 out of 10 ## 7 R_00zYHdY1te1Qlrz 4 1 0 NA 5 out of 10 ## 8 R_00zYHdY1te1Qlrz 4 2 1 NA 9 out of 10 ## 9 R_00zYHdY1te1Qlrz 5 1 1 NA 5 out of 10 ## 10 R_00zYHdY1te1Qlrz 5 2 0 NA 5 out of 10 ## `Violent Crime Rate (Vs National Rate)` `Racial Composition` ## ## 1 20% Less Crime Than National Average 50% White, 50% Nonwhite ## 2 20% More Crime Than National Average 50% White, 50% Nonwhite ## 3 20% More Crime Than National Average 90% White, 10% Nonwhite ## 4 20% More Crime Than National Average 96% White, 4% Nonwhite ## 5 20% More Crime Than National Average 96% White, 4% Nonwhite ## 6 20% More Crime Than National Average 90% White, 10% Nonwhite ## 7 20% Less Crime Than National Average 50% White, 50% Nonwhite ## 8 20% Less Crime Than National Average 50% White, 50% Nonwhite ## 9 20% Less Crime Than National Average 75% White, 25% Nonwhite ## 10 20% Less Crime Than National Average 96% White, 4% Nonwhite ## `Housing Cost` `Presidential Vote (2020)` ## ## 1 30% of pre-tax income 50% Democrat, 50% Republican ## 2 30% of pre-tax income 70% Democrat, 30% Republican ## 3 30% of pre-tax income 50% Democrat, 50% Republican ## 4 40% of pre-tax income 30% Democrat, 70% Republican ## 5 40% of pre-tax income 70% Democrat, 30% Republican ## 6 30% of pre-tax income 30% Democrat, 70% Republican ## 7 15% of pre-tax income 70% Democrat, 30% Republican ## 8 15% of pre-tax income 50% Democrat, 50% Republican ## 9 15% of pre-tax income 50% Democrat, 50% Republican ## 10 30% of pre-tax income 50% Democrat, 50% Republican ## `Total Daily Driving Time for Commuting and Errands` ## ## 1 75 min ## 2 10 min ## 3 75 min ## 4 10 min ## 5 10 min ## 6 45 min ## 7 25 min ## 8 10 min ## 9 75 min ## 10 25 min ## `Type of Place` race ## ## 1 Suburban neighborhood with houses only White ## 2 City – downtown, with a mix of offices, apartments, and shops White ## 3 Suburban neighborhood with mix of shops, houses, businesses White ## 4 Suburban neighborhood with mix of shops, houses, businesses White ## 5 Rural area White ## 6 Rural area White ## 7 Suburban neighborhood with houses only White ## 8 Suburban neighborhood with mix of shops, houses, businesses White ## 9 City, more residential area White ## 10 City, more residential area White ## ideology ## ## 1 Moderate; middle of the road ## 2 Moderate; middle of the road ## 3 Moderate; middle of the road ## 4 Moderate; middle of the road ## 5 Moderate; middle of the road ## 6 Moderate; middle of the road ## 7 Moderate; middle of the road ## 8 Moderate; middle of the road ## 9 Moderate; middle of the road ## 10 Moderate; middle of the road ## # ℹ 6,390 more rows attributes <- c(\"School Quality\", \"Violent Crime Rate (Vs National Rate)\", \"Racial Composition\", \"Housing Cost\", \"Presidential Vote (2020)\", \"Total Daily Driving Time for Commuting and Errands\", \"Type of Place\") out4 <- make_projoint_data(.dataframe = data, .attribute_vars = attributes, .id_var = \"id\", # the default name .task_var = \"task\", # the default name .profile_var = \"profile\", # the default name .selected_var = \"selected\", # the default name .selected_repeated_var = \"selected_repeated\", # the default is NULL .fill = TRUE) out4 ## An object of class \"projoint_data\" ## Slot \"labels\": ## # A tibble: 24 × 4 ## attribute_id level level_id attribute ## ## 1 att1 15% of pre-tax income att1:lev1 Housing Cost ## 2 att1 30% of pre-tax income att1:lev2 Housing Cost ## 3 att1 40% of pre-tax income att1:lev3 Housing Cost ## 4 att2 30% Democrat, 70% Republican att2:lev1 Presidential Vote (2020) ## 5 att2 50% Democrat, 50% Republican att2:lev2 Presidential Vote (2020) ## 6 att2 70% Democrat, 30% Republican att2:lev3 Presidential Vote (2020) ## 7 att3 50% White, 50% Nonwhite att3:lev1 Racial Composition ## 8 att3 75% White, 25% Nonwhite att3:lev2 Racial Composition ## 9 att3 90% White, 10% Nonwhite att3:lev3 Racial Composition ## 10 att3 96% White, 4% Nonwhite att3:lev4 Racial Composition ## # ℹ 14 more rows ## ## Slot \"data\": ## # A tibble: 6,400 × 13 ## id task profile selected selected_repeated agree att4 ## ## 1 R_00zYHdY1te1Qlrz 1 1 1 1 1 att4:lev2 ## 2 R_00zYHdY1te1Qlrz 1 2 0 0 1 att4:lev1 ## 3 R_00zYHdY1te1Qlrz 2 1 1 NA 1 att4:lev2 ## 4 R_00zYHdY1te1Qlrz 2 2 0 NA 1 att4:lev2 ## 5 R_00zYHdY1te1Qlrz 3 1 1 NA 1 att4:lev1 ## 6 R_00zYHdY1te1Qlrz 3 2 0 NA 1 att4:lev2 ## 7 R_00zYHdY1te1Qlrz 4 1 0 NA 1 att4:lev1 ## 8 R_00zYHdY1te1Qlrz 4 2 1 NA 1 att4:lev2 ## 9 R_00zYHdY1te1Qlrz 5 1 1 NA 1 att4:lev1 ## 10 R_00zYHdY1te1Qlrz 5 2 0 NA 1 att4:lev1 ## att7 att3 att1 att2 att5 att6 ## ## 1 att7:lev1 att3:lev1 att1:lev2 att2:lev2 att5:lev4 att6:lev5 ## 2 att7:lev2 att3:lev1 att1:lev2 att2:lev3 att5:lev1 att6:lev1 ## 3 att7:lev2 att3:lev3 att1:lev2 att2:lev2 att5:lev4 att6:lev6 ## 4 att7:lev2 att3:lev4 att1:lev3 att2:lev1 att5:lev1 att6:lev6 ## 5 att7:lev2 att3:lev4 att1:lev3 att2:lev3 att5:lev1 att6:lev3 ## 6 att7:lev2 att3:lev3 att1:lev2 att2:lev1 att5:lev3 att6:lev3 ## 7 att7:lev1 att3:lev1 att1:lev1 att2:lev3 att5:lev2 att6:lev5 ## 8 att7:lev1 att3:lev1 att1:lev1 att2:lev2 att5:lev1 att6:lev6 ## 9 att7:lev1 att3:lev2 att1:lev1 att2:lev2 att5:lev4 att6:lev2 ## 10 att7:lev1 att3:lev4 att1:lev2 att2:lev2 att5:lev2 att6:lev2 ## # ℹ 6,390 more rows"},{"path":"https://yhoriuchi.github.io/projoint/articles/02-wrangle.html","id":"arrange-the-order-and-labels-of-attributes-and-levels","dir":"Articles","previous_headings":"","what":"2.5 Arrange the order and labels of attributes and levels","title":"2. Read and wrangle your data for conjoint analysis","text":"default, reshaped data attributes levels ordered alphabetically. like reorder relable attributes levels, make process easy. first save labels using save_labels(), produces CSV file. CSV file saved local computer, revise column named order specify order attributes levels want display figure. can also revise labels attributes levels way like. make change first column named level_id. saving updated CSV file, can use read_labels() read modified CSV. use object later projoint function. can find data set GitHub: labels_original.csv labels_arranged.csv. figure based original order labels alphabetical order: labels order attribute-levels second figure Figure 2 Mummolo Nall (2017).","code":"save_labels(out1, \"temp/labels_original.csv\") out1_arranged <- read_labels(out1, \"temp/labels_arranged.csv\") mm <- projoint(out1, .estimand = \"mm\") plot(mm) mm <- projoint(out1_arranged, .estimand = \"mm\") plot(mm)"},{"path":"https://yhoriuchi.github.io/projoint/articles/03-predict.html","id":"load-the-projoint-package","dir":"Articles","previous_headings":"","what":"3.1 Load the projoint package","title":"3. Predict the intra-respondent reliability (IRR)","text":"","code":"library(projoint)"},{"path":"https://yhoriuchi.github.io/projoint/articles/03-predict.html","id":"predict-irr-based-on-the-extrapolation-method","dir":"Articles","previous_headings":"","what":"3.2 Predict IRR based on the extrapolation method","title":"3. Predict the intra-respondent reliability (IRR)","text":", start reading Qualtrics file reshaping using reshape_projoint(). See 2.2 Read wrangle data, flipped repeated tasks. Since already , ’ll skip right ahead load “out1_arranged” object . (See 2.5 Arrange order labels attributes levels. pass data set predict_tau function, calculates IRR produces figure showing extrapolation method visually (see 2.3 Arrange order labels attributes levels). projoint_tau object, created predict_tau, can explored using usual tools. print method explains estimate tau produced via extrapolation rather assumed calculated using repeated task presents estimate: summary method returns tibble IRR profiles become dissimilar. x=7, example, attributes different two profiles see IRR 0.503. extrapolate x=0, IRR profiles identical: plot method renders plot showing extrapolated value tau:","code":"data(out1_arranged) predicted_irr <- predict_tau(out1_arranged) print(predicted_irr) ## [1] \"Tau estimated using the extrapolation method: 0.743\" summary(predicted_irr) ## # A tibble: 8 × 2 ## x predicted ## ## 1 0 0.743 ## 2 1 0.709 ## 3 2 0.675 ## 4 3 0.640 ## 5 4 0.606 ## 6 5 0.572 ## 7 6 0.537 ## 8 7 0.503 plot(predicted_irr)"},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"load-the-projoint-package-and-set-up-the-data","dir":"Articles","previous_headings":"","what":"4.1 Load the projoint package and set up the data","title":"4. Estimate corrected MMs or AMCEs","text":"","code":"library(projoint) outcomes <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes <- c(outcomes, \"choice1_repeated_flipped\") out1 <- reshape_projoint(.dataframe = exampleData1, .idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE)"},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"why-do-we-recommend-you-use-ids","dir":"Articles","previous_headings":"","what":"4.2 Why do we recommend you use IDs?","title":"4. Estimate corrected MMs or AMCEs","text":"estimate visualize quantities interest using package (least current version), need set attributes levels using IDs, att1 level2, rather actual labels, “Housing Cost” (att1) “15% pre-tax income” (level1 att1). think approach prone error applications may include foreign characters (e.g., 2-byte Japanese characters) special characters. Sometimes, design may include levels one attribute; example, “Teaching quality” = {“High”, “Low”} “Research quality” = {“High”, “Low”)). avoid possible strange result, use unique identiers attribute-level. check IDs correspond attributes levels, can type following line script: can also save_labels() save CSV file reference.","code":"out1@labels ## # A tibble: 24 × 4 ## attribute level attribute_id level_id ## ## 1 Housing Cost 15% of pre-tax income att1 att1:leve… ## 2 Housing Cost 30% of pre-tax income att1 att1:leve… ## 3 Housing Cost 40% of pre-tax income att1 att1:leve… ## 4 Presidential Vote (2020) 30% Democrat, 70% Republican att2 att2:leve… ## 5 Presidential Vote (2020) 50% Democrat, 50% Republican att2 att2:leve… ## 6 Presidential Vote (2020) 70% Democrat, 30% Republican att2 att2:leve… ## 7 Racial Composition 50% White, 50% Nonwhite att3 att3:leve… ## 8 Racial Composition 75% White, 25% Nonwhite att3 att3:leve… ## 9 Racial Composition 90% White, 10% Nonwhite att3 att3:leve… ## 10 Racial Composition 96% White, 4% Nonwhite att3 att3:leve… ## # ℹ 14 more rows"},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"estimate-mms","dir":"Articles","previous_headings":"","what":"4.3 Estimate MMs","title":"4. Estimate corrected MMs or AMCEs","text":"two main setups projoint can produce estimates. profile-level common approach literature, choice-level flexible powerful.","code":""},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"mm-profile-level-all-levels","dir":"Articles","previous_headings":"4.3 Estimate MMs","what":"MM (profile-level) – all levels","title":"4. Estimate corrected MMs or AMCEs","text":"default method projoint estimate marginal means (MMs) profile-level. run projoint(out1), conduct analysis. expand arguments clarity:","code":"mm0 <- projoint(.data = out1, .qoi = NULL, .by_var = NULL, .structure = \"profile_level\", .estimand = \"mm\", .se_method = \"analytical\", .irr = NULL, .remove_ties = TRUE, .ignore_position = NULL, .n_sims = NULL, .n_boot = NULL, .weights_1 = NULL, .clusters_1 = NULL, .se_type_1 = \"classical\", .weights_2 = NULL, .clusters_2 = NULL, .se_type_2 = \"classical\") print(mm0) ## [A projoint output] ## Estimand: mm ## Structure: profile_level ## IRR: Estimated ## Tau: 0.1721281 ## Remove ties: TRUE ## SE methods: analytical summary(mm0) ## # A tibble: 48 × 6 ## estimand estimate se conf.low conf.high att_level_choose ## ## 1 mm_uncorrected 0.574 0.0134 0.548 0.601 att1:level1 ## 2 mm_corrected 0.614 0.0207 0.573 0.654 att1:level1 ## 3 mm_uncorrected 0.485 0.0134 0.458 0.511 att1:level2 ## 4 mm_corrected 0.477 0.0204 0.437 0.517 att1:level2 ## 5 mm_uncorrected 0.445 0.0131 0.419 0.470 att1:level3 ## 6 mm_corrected 0.416 0.0203 0.376 0.455 att1:level3 ## 7 mm_uncorrected 0.489 0.0133 0.463 0.515 att2:level1 ## 8 mm_corrected 0.483 0.0202 0.443 0.522 att2:level1 ## 9 mm_uncorrected 0.524 0.0130 0.498 0.549 att2:level2 ## 10 mm_corrected 0.536 0.0200 0.497 0.575 att2:level2 ## # ℹ 38 more rows"},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"mm-profile-level-specific-level","dir":"Articles","previous_headings":"4.3 Estimate MMs","what":"MM (profile-level) – specific level","title":"4. Estimate corrected MMs or AMCEs","text":"However, also possible specify precise attributes, attribute levels, interest using set_qoi function . set_qoi function main way users specify complex estimands conjoint analysis. Al arguments qoi() expanded clarity, default arguments projoint() dropped simplicity:","code":"qoi_1 <- set_qoi( .structure = \"profile_level\", .estimand = \"mm\", .att_choose = \"att1\", .lev_choose = \"level1\") mm1 <- projoint(.data = out1, .qoi = qoi_1) ## Warning in projoint(.data = out1, .qoi = qoi_1): Both .qoi and .structure are ## specified; using the value from .qoi. ## Warning in projoint(.data = out1, .qoi = qoi_1): Both .qoi and .estimand are ## specified; using the value from .qoi. print(mm1) ## [A projoint output] ## Estimand: mm ## Structure: profile_level ## IRR: Estimated ## Tau: 0.1721281 ## Remove ties: TRUE ## SE methods: analytical summary(mm1) ## # A tibble: 2 × 7 ## estimand estimate se conf.low conf.high att_level_choose ## ## 1 mm_uncorrected 0.574 0.0134 0.548 0.601 att1:level1 ## 2 mm_corrected 0.614 0.0207 0.573 0.654 att1:level1 ## # ℹ 1 more variable: att_level_notchoose "},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"mm-profile-level-specific-level-using-the-predicted-irr","dir":"Articles","previous_headings":"4.3 Estimate MMs","what":"MM (profile-level) – specific level, using the predicted IRR","title":"4. Estimate corrected MMs or AMCEs","text":"conjoint survey design include recommended repeated task, can use specific value .irr, can estimate using predict_tau() function specify value based prior knowledge. following, use 0.75, likely IRR find test data sets. default arguments set_qoi() projoint() dropped hereafter.","code":"mm1b <- projoint(.data = out1, .qoi = qoi_1, .irr = 0.75) ## Warning in projoint(.data = out1, .qoi = qoi_1, .irr = 0.75): Both .qoi and ## .structure are specified; using the value from .qoi. ## Warning in projoint(.data = out1, .qoi = qoi_1, .irr = 0.75): Both .qoi and ## .estimand are specified; using the value from .qoi. print(mm1b) ## [A projoint output] ## Estimand: mm ## Structure: profile_level ## IRR: Assumed (0.75) ## Tau: 0.1464466 ## Remove ties: TRUE ## SE methods: analytical summary(mm1b) ## # A tibble: 2 × 7 ## estimand estimate se conf.low conf.high att_level_choose ## ## 1 mm_uncorrected 0.574 0.0134 0.548 0.601 att1:level1 ## 2 mm_corrected 0.605 0.0190 0.568 0.643 att1:level1 ## # ℹ 1 more variable: att_level_notchoose "},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"mm-choice-level-specific-level","dir":"Articles","previous_headings":"4.3 Estimate MMs","what":"MM (choice-level) – specific level","title":"4. Estimate corrected MMs or AMCEs","text":"soon users wish switch profile-level choice-level analysis, set_qoi function required. exponentially choice-level estimands profile-level estimands, impractical view . specify want return marginal mean attribute 1, levels 1 3 choice-level.","code":"qoi_2 <- set_qoi( .structure = \"choice_level\", .att_choose = \"att1\", .lev_choose = \"level3\", .att_notchoose = \"att1\", .lev_notchoose = \"level1\" ) mm2 <- projoint(.data = out1, .qoi = qoi_2, .structure = \"choice_level\", .ignore_position = FALSE) ## Warning in projoint(.data = out1, .qoi = qoi_2, .structure = \"choice_level\", : ## Both .qoi and .structure are specified; using the value from .qoi. ## Warning in projoint(.data = out1, .qoi = qoi_2, .structure = \"choice_level\", : ## Both .qoi and .estimand are specified; using the value from .qoi. print(mm2) ## [A projoint output] ## Estimand: mm ## Structure: choice_level ## IRR: Estimated ## Tau: 0.1721281 ## Remove ties: TRUE ## SE methods: analytical summary(mm2) ## # A tibble: 2 × 7 ## estimand estimate se conf.low conf.high att_level_choose ## ## 1 mm_uncorrected 0.402 0.0258 0.352 0.453 att1:level3 ## 2 mm_corrected 0.351 0.0408 0.271 0.431 att1:level3 ## # ℹ 1 more variable: att_level_notchoose "},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"estimate-amces","dir":"Articles","previous_headings":"","what":"4.4 Estimate AMCEs","title":"4. Estimate corrected MMs or AMCEs","text":"Note can replicate analyses using AMCE instead MM just specifying .estimand = \"amce\" rather default \"mm\".","code":""},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"amce-profile-level-all-levels","dir":"Articles","previous_headings":"4.4 Estimate AMCEs","what":"AMCE (profile-level) – all levels","title":"4. Estimate corrected MMs or AMCEs","text":"","code":"amce0 <- projoint(.data = out1, .estimand = \"amce\") print(amce0) ## [A projoint output] ## Estimand: amce ## Structure: profile_level ## IRR: Estimated ## Tau: 0.1721281 ## Remove ties: TRUE ## SE methods: analytical summary(amce0) ## # A tibble: 34 × 7 ## estimand estimate se conf.low conf.high att_level_choose ## ## 1 amce_uncorrected -0.0899 0.0190 -0.127 -0.0527 att1:level2 ## 2 amce_corrected -0.137 0.0290 -0.194 -0.0801 att1:level2 ## 3 amce_uncorrected -0.130 0.0188 -0.167 -0.0931 att1:level3 ## 4 amce_corrected -0.198 0.0294 -0.256 -0.140 att1:level3 ## 5 amce_uncorrected 0.0348 0.0186 -0.00170 0.0713 att2:level2 ## 6 amce_corrected 0.0530 0.0284 -0.00258 0.109 att2:level2 ## 7 amce_uncorrected -0.00177 0.0188 -0.0386 0.0350 att2:level3 ## 8 amce_corrected -0.00270 0.0286 -0.0589 0.0535 att2:level3 ## 9 amce_uncorrected 0.0240 0.0204 -0.0159 0.0640 att3:level2 ## 10 amce_corrected 0.0366 0.0312 -0.0246 0.0979 att3:level2 ## # ℹ 24 more rows ## # ℹ 1 more variable: att_level_choose_baseline "},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"amce-profile-level-specific-level","dir":"Articles","previous_headings":"4.4 Estimate AMCEs","what":"AMCE (profile-level) – specific level","title":"4. Estimate corrected MMs or AMCEs","text":"","code":"qoi_3 <- set_qoi( .structure = \"profile_level\", .estimand = \"amce\", .att_choose = \"att1\", .lev_choose = \"level3\", .att_choose_b = \"att1\", .lev_choose_b = \"level1\" ) amce1 <- projoint(.data = out1, .qoi = qoi_3, .estimand = \"amce\") ## Warning in projoint(.data = out1, .qoi = qoi_3, .estimand = \"amce\"): Both .qoi ## and .structure are specified; using the value from .qoi. ## Warning in projoint(.data = out1, .qoi = qoi_3, .estimand = \"amce\"): Both .qoi ## and .estimand are specified; using the value from .qoi. print(amce1) ## [A projoint output] ## Estimand: amce ## Structure: profile_level ## IRR: Estimated ## Tau: 0.1721281 ## Remove ties: TRUE ## SE methods: analytical summary(amce1) ## # A tibble: 2 × 9 ## estimand estimate se conf.low conf.high att_level_choose ## ## 1 amce_uncorrected -0.130 0.0188 -0.167 -0.0931 att1:level3 ## 2 amce_corrected -0.198 0.0294 -0.256 -0.140 att1:level3 ## # ℹ 3 more variables: att_level_notchoose , ## # att_level_choose_baseline , att_level_notchoose_baseline "},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"amce-profile-level-specific-level-using-the-predicted-irr","dir":"Articles","previous_headings":"4.4 Estimate AMCEs","what":"AMCE (profile-level) – specific level, using the predicted IRR","title":"4. Estimate corrected MMs or AMCEs","text":"","code":"amce1b <- projoint(.data = out1, .qoi = qoi_3, .estimand = \"amce\", .irr = 0.75) ## Warning in projoint(.data = out1, .qoi = qoi_3, .estimand = \"amce\", .irr = ## 0.75): Both .qoi and .structure are specified; using the value from .qoi. ## Warning in projoint(.data = out1, .qoi = qoi_3, .estimand = \"amce\", .irr = ## 0.75): Both .qoi and .estimand are specified; using the value from .qoi. print(amce1b) ## [A projoint output] ## Estimand: amce ## Structure: profile_level ## IRR: Assumed (0.75) ## Tau: 0.1464466 ## Remove ties: TRUE ## SE methods: analytical summary(amce1b) ## # A tibble: 2 × 9 ## estimand estimate se conf.low conf.high att_level_choose ## ## 1 amce_uncorrected -0.130 0.0188 -0.167 -0.0931 att1:level3 ## 2 amce_corrected -0.184 0.0266 -0.236 -0.132 att1:level3 ## # ℹ 3 more variables: att_level_notchoose , ## # att_level_choose_baseline , att_level_notchoose_baseline "},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"amce-choice-level-specific-level","dir":"Articles","previous_headings":"4.4 Estimate AMCEs","what":"AMCE (choice-level) – specific level","title":"4. Estimate corrected MMs or AMCEs","text":"","code":"qoi_4 <- set_qoi( .structure = \"choice_level\", .estimand = \"amce\", .att_choose = \"att1\", .lev_choose = \"level3\", .att_notchoose = \"att1\", .lev_notchoose = \"level1\", .att_choose_b = \"att1\", .lev_choose_b = \"level2\", .att_notchoose_b = \"att1\", .lev_notchoose_b = \"level1\" ) amce2 <- projoint(.data = out1, .qoi = qoi_4, .structure = \"choice_level\", .estimand = \"amce\", .ignore_position = TRUE) ## Warning in projoint(.data = out1, .qoi = qoi_4, .structure = \"choice_level\", : ## Both .qoi and .structure are specified; using the value from .qoi. ## Warning in projoint(.data = out1, .qoi = qoi_4, .structure = \"choice_level\", : ## Both .qoi and .estimand are specified; using the value from .qoi. print(amce2) ## [A projoint output] ## Estimand: amce ## Structure: choice_level ## IRR: Estimated ## Tau: 0.1721281 ## Remove ties: TRUE ## SE methods: analytical summary(amce2) ## # A tibble: 2 × 9 ## estimand estimate se conf.low conf.high att_level_choose ## ## 1 amce_uncorrected -0.0484 0.0270 -0.101 0.00448 att1:level3 ## 2 amce_corrected -0.0739 0.0414 -0.155 0.00727 att1:level3 ## # ℹ 3 more variables: att_level_notchoose , ## # att_level_choose_baseline , att_level_notchoose_baseline "},{"path":"https://yhoriuchi.github.io/projoint/articles/05-visualize.html","id":"load-the-projoint-package-and-the-other-necessary-package","dir":"Articles","previous_headings":"","what":"5.1 Load the projoint package and the other necessary package","title":"5. Visualize MMs or AMCEs","text":"","code":"library(projoint) library(ggplot2)"},{"path":[]},{"path":"https://yhoriuchi.github.io/projoint/articles/05-visualize.html","id":"estimate-mms-and-amces-","dir":"Articles","previous_headings":"5.2 Profile-level analysis","what":"Estimate MMs and AMCEs.","title":"5. Visualize MMs or AMCEs","text":"","code":"mm <- projoint(out1_arranged) amce <- projoint(out1_arranged, .estimand = \"amce\")"},{"path":"https://yhoriuchi.github.io/projoint/articles/05-visualize.html","id":"visualize-mms-and-amces","dir":"Articles","previous_headings":"5.2 Profile-level analysis","what":"Visualize MMs and AMCEs","title":"5. Visualize MMs or AMCEs","text":"default, researchers prefer view corrected estimates either MMs AMCEs. Researchers can, however, choose instead visualize uncorrected estimates, view together.","code":"plot(mm) plot(mm, .estimates = \"uncorrected\") plot(mm, .estimates = \"both\") plot(amce) plot(amce, .estimates = \"uncorrected\") plot(amce, .estimates = \"both\")"},{"path":"https://yhoriuchi.github.io/projoint/articles/05-visualize.html","id":"choice-level-analysis","dir":"Articles","previous_headings":"","what":"5.3 Choice-level analysis","title":"5. Visualize MMs or AMCEs","text":"undertake choice-level analysis, first need specify quantity interest using set_qoi(). can estimate choice-level marginal means: Since many estimates, encourage make plots based objectives research. default plot choice-level marginal means basic ggplot object, compares marginal mean two options. sum two percentages 100, thus may think redundant information presented figure. think figure effective way show results head--head (choice-level) comparison. can polish adding layers : Note: current version projoint package function plot choice-level average marginal component effects. Stay tuned!","code":"qoi_mm <- set_qoi(.structure = \"choice_level\", .att_choose = \"att1\", .lev_choose = \"level1\", .att_notchoose = \"att1\", .lev_notchoose = \"level3\") choice_mm <- projoint(.data = out1_arranged, .structure = \"choice_level\", .qoi = qoi_mm, .ignore_position = TRUE) ## Warning in projoint(.data = out1_arranged, .structure = \"choice_level\", : Both ## .qoi and .structure are specified; using the value from .qoi. ## Warning in projoint(.data = out1_arranged, .structure = \"choice_level\", : Both ## .qoi and .estimand are specified; using the value from .qoi. print(choice_mm) ## [A projoint output] ## Estimand: mm ## Structure: choice_level ## IRR: Estimated ## Tau: 0.1721281 ## Remove ties: TRUE ## SE methods: analytical summary(choice_mm) ## # A tibble: 2 × 7 ## estimand estimate se conf.low conf.high att_level_choose ## ## 1 mm_uncorrected 0.581 0.0187 0.544 0.618 att1:level1 ## 2 mm_corrected 0.624 0.0288 0.567 0.680 att1:level1 ## # ℹ 1 more variable: att_level_notchoose plot(choice_mm) plot(choice_mm, .labels = c(\"15% of pre-tax income\", \"30% of pre-tax income\")) + labs(y = \"Marginal mean\", x = \"Housing Cost\") + coord_cartesian(ylim = c(0, 1)) + geom_hline(yintercept = 0.5, linetype = \"dashed\", color = \"darkgray\")"},{"path":"https://yhoriuchi.github.io/projoint/articles/06-compare.html","id":"load-the-projoint-package-","dir":"Articles","previous_headings":"","what":"6.1 Load the projoint package.","title":"6. Compare MMs or AMCEs between the subgroups","text":"Also load additional packages required vignette","code":"library(projoint) library(dplyr) library(ggplot2)"},{"path":[]},{"path":"https://yhoriuchi.github.io/projoint/articles/06-compare.html","id":"read-and-wrangle-data","dir":"Articles","previous_headings":"6.2 Profile-level analysis","what":"Read and Wrangle data","title":"6. Compare MMs or AMCEs between the subgroups","text":"begin, define outcome questions original dataset. Let’s make three data frames – first data frame baseline group (example, respondents report race “white”); second data frame comparison group (example, respondents reported race “white”), third data frame groups. Note .covariates argument specified reshape_conjoint() function third group. , add re-order labels (see 2.3 Arrange order labels attributes levels).","code":"outcomes <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes <- c(outcomes, \"choice1_repeated_flipped\") # Pre-processing df <- exampleData1 %>% mutate(white = ifelse(race == \"White\", 1, 0)) df_0 <- df %>% filter(white == 0) %>% reshape_projoint(.idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE) df_1 <- df %>% filter(white == 1) %>% reshape_projoint(.idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE) df_d <- df %>% reshape_projoint(.idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE, .covariates = \"white\") df_0 <- read_labels(df_0, \"temp/labels_arranged.csv\") df_1 <- read_labels(df_1, \"temp/labels_arranged.csv\") df_d <- read_labels(df_d, \"temp/labels_arranged.csv\")"},{"path":"https://yhoriuchi.github.io/projoint/articles/06-compare.html","id":"estimate-mms-or-amces-and-the-difference-in-the-estimates","dir":"Articles","previous_headings":"6.2 Profile-level analysis","what":"Estimate MMs or AMCEs and the difference in the estimates","title":"6. Compare MMs or AMCEs between the subgroups","text":"three data frames, estimate MMs, AMCEs, differences estimates. following example estimate profile-level marginal means (default). Importantly, conjoint design includes repeated task, projoint() function applied subgroup estimate IRR corresponding subgroup. output out_d includes data differences can also check tau subgroup: , make save three ggplot objects.","code":"out_0 <- projoint(df_0) out_1 <- projoint(df_1) out_d <- projoint(df_d, .by_var = \"white\") out_d@estimates ## # A tibble: 48 × 11 ## estimand att_level_choose estimate_1 se_1 tau estimate_0 se_0 estimate ## ## 1 mm_uncor… att1:level1 0.586 0.0157 0.158 0.545 0.0258 0.0401 ## 2 mm_corre… att1:level1 0.625 0.0236 0.158 0.579 0.0433 0.0464 ## 3 mm_uncor… att1:level2 0.480 0.0158 0.158 0.496 0.0250 -0.0163 ## 4 mm_corre… att1:level2 0.471 0.0233 0.158 0.494 0.0432 -0.0229 ## 5 mm_uncor… att1:level3 0.439 0.0153 0.158 0.460 0.0254 -0.0210 ## 6 mm_corre… att1:level3 0.411 0.0227 0.158 0.431 0.0446 -0.0200 ## 7 mm_uncor… att2:level1 0.529 0.0154 0.158 0.510 0.0245 0.0195 ## 8 mm_corre… att2:level1 0.543 0.0226 0.158 0.517 0.0425 0.0260 ## 9 mm_uncor… att2:level2 0.500 0.0157 0.158 0.461 0.0248 0.0394 ## 10 mm_corre… att2:level2 0.500 0.0230 0.158 0.432 0.0417 0.0683 ## # ℹ 38 more rows ## # ℹ 3 more variables: se , conf.low , conf.high out_d@tau ## tau1 tau0 ## 1 0.1582662 0.2113249 plot_0 <- plot(out_0) plot_1 <- plot(out_1) plot_d <- plot(out_d, .by_var = TRUE)"},{"path":"https://yhoriuchi.github.io/projoint/articles/06-compare.html","id":"visualize-subgroup-differences","dir":"Articles","previous_headings":"6.2 Profile-level analysis","what":"Visualize subgroup differences","title":"6. Compare MMs or AMCEs between the subgroups","text":", make plot using patchwork package. Researchers can add/modify layers ggplot. default horizontal axis label “Difference” .by_var = TRUE specified plot() function.","code":"g_0 <- plot_0 + coord_cartesian(xlim = c(0.2, 0.8)) + scale_x_continuous(breaks = c(0.3, 0.5, 0.7)) + theme(plot.title = element_text(hjust = 0.5)) + labs(title = \"Non-white\", x = \"AMCE\") g_1 <- plot_1 + coord_cartesian(xlim = c(0.2, 0.8)) + scale_x_continuous(breaks = c(0.3, 0.5, 0.7)) + theme(axis.text.y = element_blank(), plot.title = element_text(hjust = 0.5)) + labs(title = \"White\", x = \"AMCE\") g_d <- plot_d + coord_cartesian(xlim = c(-0.4, 0.4)) + scale_x_continuous(breaks = c(-0.25, 0, 0.25)) + theme(axis.text.y = element_blank(), plot.title = element_text(hjust = 0.5)) + labs(title = \"Difference\") library(patchwork) g_0 + g_1 + g_d"},{"path":"https://yhoriuchi.github.io/projoint/articles/06-compare.html","id":"choice-level-analysis","dir":"Articles","previous_headings":"","what":"6.3 Choice-level analysis","title":"6. Compare MMs or AMCEs between the subgroups","text":"encourage users package make custom figures based estimates choice-level analysis. following just one example.","code":"df_D <- exampleData1 %>% filter(party_1 == \"Democrat\") %>% reshape_projoint(.idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE) df_R <- exampleData1 %>% filter(party_1 == \"Republican\") %>% reshape_projoint(.idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE) df_0 <- exampleData1 %>% filter(party_1 %in% c(\"Something else\", \"Independent\")) %>% reshape_projoint(.idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE) qoi <- set_qoi( .structure = \"choice_level\", .estimand = \"mm\", .att_choose = \"att2\", # Presidential Vote (2020) .lev_choose = \"level3\", # 70% Democrat, 30% Republican .att_notchoose = \"att2\", .lev_notchoose = \"level1\", # 30% Democrat, 70% Republican ) out_D <- projoint(df_D, qoi, .structure = \"choice_level\", .ignore_position = TRUE) ## Warning in projoint(df_D, qoi, .structure = \"choice_level\", .ignore_position = ## TRUE): Both .qoi and .structure are specified; using the value from .qoi. ## Warning in projoint(df_D, qoi, .structure = \"choice_level\", .ignore_position = ## TRUE): Both .qoi and .estimand are specified; using the value from .qoi. out_R <- projoint(df_R, qoi, .structure = \"choice_level\", .ignore_position = TRUE) ## Warning in projoint(df_R, qoi, .structure = \"choice_level\", .ignore_position = ## TRUE): Both .qoi and .structure are specified; using the value from .qoi. ## Warning in projoint(df_R, qoi, .structure = \"choice_level\", .ignore_position = ## TRUE): Both .qoi and .estimand are specified; using the value from .qoi. out_0 <- projoint(df_0, qoi, .structure = \"choice_level\", .ignore_position = TRUE) ## Warning in projoint(df_0, qoi, .structure = \"choice_level\", .ignore_position = ## TRUE): Both .qoi and .structure are specified; using the value from .qoi. ## Warning in projoint(df_0, qoi, .structure = \"choice_level\", .ignore_position = ## TRUE): Both .qoi and .estimand are specified; using the value from .qoi. out_merged <- bind_rows( out_D@estimates %>% mutate(party = \"Democrat\"), out_R@estimates %>% mutate(party = \"Republican\"), out_0@estimates %>% mutate(party = \"Independent\") ) %>% filter(estimand == \"mm_corrected\") ggplot(out_merged, aes(y = party, x = estimate)) + geom_vline(xintercept = 0.5, linetype = \"dashed\", color = \"gray\") + geom_pointrange(aes(xmin = conf.low, xmax = conf.high)) + geom_text(aes(label = format(round(estimate, digits = 2), nsmall = 2)), vjust = -1) + labs(y = NULL, x = \"Choice-level marginal mean\", title = \"Choose an area with 70% Democrat\\n as opposed to an area with 30% Democrat\") + theme_classic()"},{"path":"https://yhoriuchi.github.io/projoint/articles/07-explore.html","id":"load-the-projoint-package-and-the-other-necessary-package","dir":"Articles","previous_headings":"","what":"7.1 Load the projoint package and the other necessary package","title":"7. Explore further","text":"previous articles, use already wrangled cleaned data named “out1_reshaped.” see attribute IDs level IDs means, can type:","code":"library(projoint) library(ggplot2) out1_arranged@labels ## # A tibble: 24 × 4 ## attribute level attribute_id level_id ## ## 1 Housing Cost 15% of pre-tax income att1 att1:leve… ## 2 Housing Cost 30% of pre-tax income att1 att1:leve… ## 3 Housing Cost 40% of pre-tax income att1 att1:leve… ## 4 Presidential Vote (2020) 50% Democrat, 50% Republican att2 att2:leve… ## 5 Presidential Vote (2020) 30% Democrat, 70% Republican att2 att2:leve… ## 6 Presidential Vote (2020) 70% Democrat, 30% Republican att2 att2:leve… ## 7 Racial Composition 50% White, 50% Nonwhite att3 att3:leve… ## 8 Racial Composition 75% White, 25% Nonwhite att3 att3:leve… ## 9 Racial Composition 90% White, 10% Nonwhite att3 att3:leve… ## 10 Racial Composition 96% White, 4% Nonwhite att3 att3:leve… ## # ℹ 14 more rows"},{"path":"https://yhoriuchi.github.io/projoint/articles/07-explore.html","id":"examine-trade-offs","dir":"Articles","previous_headings":"","what":"7.1 Examine trade-offs","title":"7. Explore further","text":"may interested people make choice face trade-options. example, one hand, may want live inexpensive house. hand, may prefer avoid living area high crime rate. two options prefer? can compare two options directly. customization figure, see Visualize MMs AMCEs, Choice-level analysis","code":"qoi_1 <- set_qoi( .structure = \"choice_level\", .att_choose = \"att1\", .lev_choose = \"level1\", .att_notchoose = \"att6\", .lev_notchoose = \"level2\" ) mm1 <- projoint(.data = out1_arranged, .qoi = qoi_1, .structure = \"choice_level\", .ignore_position = TRUE) ## Warning in projoint(.data = out1_arranged, .qoi = qoi_1, .structure = ## \"choice_level\", : Both .qoi and .structure are specified; using the value from ## .qoi. ## Warning in projoint(.data = out1_arranged, .qoi = qoi_1, .structure = ## \"choice_level\", : Both .qoi and .estimand are specified; using the value from ## .qoi. plot(mm1, .labels = c(\"Housing Cost\\n(15% of pre-tax income)\", \"Violent Crime Rate\\n(20% > National Average)\")) + labs(y = \"Marginal mean\", x = NULL) + coord_cartesian(ylim = c(0, 1)) + geom_hline(yintercept = 0.5, linetype = \"dashed\", color = \"darkgray\")"},{"path":"https://yhoriuchi.github.io/projoint/articles/07-explore.html","id":"set-multiple-levels-for-the-attribute-of-interest","dir":"Articles","previous_headings":"","what":"6.1 Set multiple levels for the attribute of interest","title":"7. Explore further","text":"may interested measuring marginal means choosing one level. example, may want estimate marginal mean choosing “City, residential area” “City, downtown area” opposed “Suburban, houses” “Suburban, downtown area”. , can run following code:","code":"qoi_2 <- set_qoi( .structure = \"choice_level\", .att_choose = \"att7\", .lev_choose = c(\"level2\", \"level3\"), .att_notchoose = \"att7\", .lev_notchoose = c(\"level5\", \"level6\") ) mm2 <- projoint(.data = out1_arranged, .qoi = qoi_2, .structure = \"choice_level\", .ignore_position = TRUE) ## Warning in projoint(.data = out1_arranged, .qoi = qoi_2, .structure = ## \"choice_level\", : Both .qoi and .structure are specified; using the value from ## .qoi. ## Warning in projoint(.data = out1_arranged, .qoi = qoi_2, .structure = ## \"choice_level\", : Both .qoi and .estimand are specified; using the value from ## .qoi. plot(mm2, .labels = c(\"City\", \"Suburban\")) + labs(y = \"Marginal mean\", x = \"Type of place\") + coord_cartesian(ylim = c(0, 1)) + geom_hline(yintercept = 0.5, linetype = \"dashed\", color = \"darkgray\")"},{"path":"https://yhoriuchi.github.io/projoint/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Yusaku Horiuchi. Author, maintainer. Aaron Kaufman. Author.","code":""},{"path":"https://yhoriuchi.github.io/projoint/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Katherine Clayton, Yusaku Horiuchi, Aaron R. Kaufman, Gary King, Mayya Komisarchik (2023). Correcting Measurement Error Bias Conjoint Survey Experiments. Working Paper. URL https://gking.harvard.edu/files/gking/files/conerr.pdf Yusaku Horiuchi Aaron R. Kaufman (2023). projoint: One Stop Conjoint Shop. URL https://github.com/yhoriuchi/projoint","code":"@Article{, title = {Correcting Measurement Error Bias in Conjoint Survey Experiments}, author = {Katherine Clayton and Yusaku Horiuchi and Aaron Kaufman and Gary King and Mayya Komisarchik}, journal = {Working Paper}, year = {2023}, url = {https://gking.harvard.edu/files/gking/files/conerr.pdf}, } @Misc{, title = {projoint: The One Stop Conjoint Shop}, author = {Yusaku Horiuchi and Aaron Kaufman}, year = {2023}, publisher = {GitHub repository}, url = {https://github.com/yhoriuchi/projoint}, }"},{"path":[]},{"path":[]},{"path":"https://yhoriuchi.github.io/projoint/index.html","id":"the-one-stop-conjoint-shop","dir":"","previous_headings":"","what":"The One-Stop Conjoint Shop","title":"The One Stop Conjoint Shop","text":"projoint package general, straightforward, creative conjoint analysis. estimates—either profile-level choice-level—Marginal Means (MMs) Average Marginal Component Effects (AMCEs) based conjoint survey experiment. produces reliable estimates correcting measurement error bias problems known literature (e.g., levels attribute interest). Furthermore, presents general framework researchers can answer range substantively important questions straightforwardly. notes: current version assumes outcome variable binary forced choice. package still construction. Forthcoming features include following: Allow researchers use weights features respondents. Allow researchers use outcome variables, rating.","code":""},{"path":"https://yhoriuchi.github.io/projoint/index.html","id":"installation","dir":"","previous_headings":"The One-Stop Conjoint Shop","what":"Installation","title":"The One Stop Conjoint Shop","text":"can install development version projoint GitHub :","code":"# install.packages(\"devtools\") devtools::install_github(\"yhoriuchi/projoint\")"},{"path":"https://yhoriuchi.github.io/projoint/index.html","id":"why-projoint","dir":"","previous_headings":"The One-Stop Conjoint Shop","what":"Why projoint?","title":"The One Stop Conjoint Shop","text":"excellent R packages conjoint analysis, including cjoint (Version: 2.1.0, Published: 2018-10-19) cregg (Version: 0.4.0, Published: 2020-06-28). important advantages using package: importantly, unlike packages, researchers can fix measurement error bias (Clayton et al., working paper). cjoint cregg packages assume unit analysis profile even researchers design binary choice experiment. define straightforward choice-level MMs AMCEs allow users estimate (Clayton et al., working paper). profile-level MMs (cregg) always attenuated toward 0.5 conjoint design includes “ties” attribute interest (Gander 2021). Consider, example, attribute interest candidate’s party, two levels, {Republican, Democrat}. levels randomly assigned profile, 50% profile pairs include ties. Therefore, even strongly partisan respondents care candidate’s party always prefer one party another, choose one two tied profiles randomly. Therefore, (profile-level) marginal mean Republican Republican supporters Democrat Democrat supporters 0.75 (= 1 * 0.5 + 0.5 * 0.5). remove ties calculate MMs. profile-level AMCEs (cjoint) may produce counter-intuitive estimates (Abramson, Kocak, Magazinni, Strezhnev, working paper). example, suppose attribute interest candidate’s race, three levels, {white, Black, Asian American}. Specifically, interested whether white respondents prefer Black Asian American candidate. case head--head comparison, suppose 75% white respondents choose Black candidate rather Asian American candidate. (example choice-level marginal mean.) profile-level AMCE choosing Black candidate using Asian American candidate baseline may larger smaller 75%, surprisingly. AMCE’s calculation includes indirect comparisons combinations. set assumptions, profile-level AMCEs can still researchers’ substantive quantities interest (Bansak, Hainmueller, Hopkins, Yamamoto, forthcoming) quantities interest applied researchers. Therefore, provide option estimate alternative intuitive quantities interest, choice-level MMs AMCEs. Researchers often assume profile within profile pair needs independent. critical assumption conjoint analysis. fact, researchers consider variety research questions cross-profile (note: cross-attribute) constraints, profile pair one incumbent one challenger, profile pair sum values one (e.g., expected chance winning seat two candidates), profile pair one column fixed (e.g., show status quo reference). framework software allow researchers examine variety questions flexible innovative manners. Last least, package provides easiest possible way re-label re-order attributes levels.","code":""},{"path":"https://yhoriuchi.github.io/projoint/index.html","id":"relevant-article","dir":"","previous_headings":"The One-Stop Conjoint Shop","what":"Relevant Article","title":"The One Stop Conjoint Shop","text":"framework methods, please read cite following article: Abstract: Conjoint survey designs spreading across social sciences due unusual capacity estimate many causal effects single randomized experiment. Unfortunately, ability mirror complicated real-world choices, designs often generate substantial measurement errors thus bias. replicate data collection analysis eight prominent conjoint studies, closely reproduce published results, show large proportion observed variation answers conjoint questions effectively random noise. discover common empirical pattern measurement error appears conjoint studies , , introduce easy--use statistical method correct bias.","code":""},{"path":"https://yhoriuchi.github.io/projoint/index.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"The One Stop Conjoint Shop","text":"Please note project released Contributor Code Conduct. contributing project, agree abide terms.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData1.html","id":null,"dir":"Reference","previous_headings":"","what":"Projoint Example Data Set 1: Building Conjoint with a Repeated, Flipped Task — exampleData1","title":"Projoint Example Data Set 1: Building Conjoint with a Repeated, Flipped Task — exampleData1","text":"cleaned Qualtrics output conjoint study compares two potential new building developments. 8 standard tasks well repeat first task, used calculate response instability.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData1.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Projoint Example Data Set 1: Building Conjoint with a Repeated, Flipped Task — exampleData1","text":"","code":"exampleData1"},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData1.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Projoint Example Data Set 1: Building Conjoint with a Repeated, Flipped Task — exampleData1","text":"## `exampleData1` data frame 201 rows 186 columns: ResponseId Unique respondent ID race Respondent race: 6 categories party_1 Respondent party: Democrat, Republican, Independent, Something else party_2 party_1 D R: closer Democrats closer Republicans? party_3 party_1 R: strong R strong R party_4 party_1 D: strong D strong D ideology Respondent ideology Extremely liberal Extremely conservative honesty Attention check: respondents select \"never\" choice1, choice2, ..., choice8 Respondent selections initial 8 conjoint tasks choice1_repeated_flipped Respondent choice task repeats choice1 flipped","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData1.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Projoint Example Data Set 1: Building Conjoint with a Repeated, Flipped Task — exampleData1","text":"Qualtrics Prolific; see Clayton et al. replication materials.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData1_labelled_tibble.html","id":null,"dir":"Reference","previous_headings":"","what":"Projoint Example Data Set 1: ","title":"Projoint Example Data Set 1: ","text":"already cleaned data frame (tibble) attribute corresponds column proper attribute name. unit observation must unit observation must two profiles task respondent.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData1_labelled_tibble.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Projoint Example Data Set 1: ","text":"","code":"exampleData1_labelled_tibble"},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData1_labelled_tibble.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Projoint Example Data Set 1: ","text":"## `exampleData1_labelled_tibble` data frame 6,400 rows 14 columns: id Unique respondent ID task Task number profile Profile number = 1,2 selected Whether profile selected selected_repeated Whether profile selected repeated task School Quality, ... Type Place attributes race Respondent race: 6 categories ideology Respondent ideology Extremely liberal Extremely conservative","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData1_labelled_tibble.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Projoint Example Data Set 1: ","text":"Qualtrics Prolific; see Clayton et al. replication materials.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData2.html","id":null,"dir":"Reference","previous_headings":"","what":"Projoint Example Data Set 2: Building Conjoint with a Repeated, Unflipped Task — exampleData2","title":"Projoint Example Data Set 2: Building Conjoint with a Repeated, Unflipped Task — exampleData2","text":"cleaned Qualtrics output conjoint study compares two potential new building developments. 8 standard tasks well repeat first task, used calculate response instability.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Projoint Example Data Set 2: Building Conjoint with a Repeated, Unflipped Task — exampleData2","text":"","code":"exampleData2"},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData2.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Projoint Example Data Set 2: Building Conjoint with a Repeated, Unflipped Task — exampleData2","text":"## `exampleData2` data frame 199 rows 186 columns: ResponseId Unique respondent ID choice1, choice2, ..., choice8 Respondent selections initial 8 conjoint tasks choice1_repeated_notflipped Respondent choice task repeats choice1, unflipped race Respondent race: 5 categories party1 Respondent party party2 party1 D R: closer Democrats closer Republicans? party3 party1 R: strong R strong R party4 party1 D: strong D strong D ideology Respondent ideology Extremely liberal Extremely conservative honesty Attention check: respondents select \"never\" K-1-1, K-1-2, ..., K-8-5 K-X-Y indicates name attribute Yth position table Xth task K-1-1-1, K-1-1-2, ..., K-8-2-7 K-X-Y-Z indicates value attribute Zth position Yth profile (either 1 2 left right profiles) Xth task","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData2.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Projoint Example Data Set 2: Building Conjoint with a Repeated, Unflipped Task — exampleData2","text":"Qualtrics Prolific; see Clayton et al. replication materials.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData3.html","id":null,"dir":"Reference","previous_headings":"","what":"Projoint Example Data Set 3: Building Conjoint without a Repeated Task — exampleData3","title":"Projoint Example Data Set 3: Building Conjoint without a Repeated Task — exampleData3","text":"cleaned Qualtrics output conjoint study compares two potential new building developments. 8 standard tasks.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData3.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Projoint Example Data Set 3: Building Conjoint without a Repeated Task — exampleData3","text":"","code":"exampleData3"},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData3.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Projoint Example Data Set 3: Building Conjoint without a Repeated Task — exampleData3","text":"## `exampleData3` data frame 201 rows 185 columns: ResponseId Unique respondent ID choice1, choice2, ..., choice8 Respondent selections initial 8 conjoint tasks race Respondent race: 5 categories party1 Respondent party party2 party1 D R: closer Democrats closer Republicans? party3 party1 R: strong R strong R party4 party1 D: strong D strong D ideology Respondent ideology Extremely liberal Extremely conservative honesty Attention check: respondents select \"never\" K-1-1, K-1-2, ..., K-8-5 K-X-Y indicates name attribute Yth position table Xth task K-1-1-1, K-1-1-2, ..., K-8-2-7 K-X-Y-Z indicates value attribute Zth position Yth profile (either 1 2 left right profiles) Xth task","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData3.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Projoint Example Data Set 3: Building Conjoint without a Repeated Task — exampleData3","text":"Qualtrics Prolific; see Clayton et al. replication materials.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/make_projoint_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Make a projoint_data object using a labelled tibble (data frame) — make_projoint_data","title":"Make a projoint_data object using a labelled tibble (data frame) — make_projoint_data","text":"function converts labelled tibble (data frame) \"projoint_data\" class object necessary projoint.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/make_projoint_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make a projoint_data object using a labelled tibble (data frame) — make_projoint_data","text":"","code":"make_projoint_data( .dataframe, .attribute_vars, .id_var = \"id\", .task_var = \"task\", .profile_var = \"profile\", .selected_var = \"selected\", .selected_repeated_var = NULL, .fill = FALSE )"},{"path":"https://yhoriuchi.github.io/projoint/reference/make_projoint_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make a projoint_data object using a labelled tibble (data frame) — make_projoint_data","text":".dataframe data frame. unit observation must two profiles task respondent. .attribute_vars character vector identifying names attributes .id_var character identifying name column containing respondent IDs (default: \"id\") .task_var character identifying name column containing task numbers (default: \"task\") .profile_var character identifying name column containing profile numbers IDs (default: \"profile\") .selected_var character identifying name column containing dichotomous response (0, 1) task (default: \"selected\") .selected_repeated_var character identifying name column containing dichotomous response (0, 1) repeated task (default: NULL) .fill logical vector: TRUE want use information whether respondent chose profile repeated task \"fill\" (using `tidyr` package) missing values non-repeated tasks, FALSE (otherwise). number respondents small, number specific profile pairs interest small, /number specific respondent subgroups want study small, worth changing option TRUE. please note `.fill = TRUE` based assumption IRR independent information contained conjoint tables. Although empirical tests suggest validity assumption, unsure , better use default value (FALSE).","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/make_projoint_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make a projoint_data object using a labelled tibble (data frame) — make_projoint_data","text":"projoint object class projoint_data ready pass projoint.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/organize_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Organize data before estimation — organize_data","title":"Organize data before estimation — organize_data","text":"function converts full conjoint data set data set structured analyzing specific attribute interest specific level(s) interest. function receives input reshape_data() output feeds pj_estimate().","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/organize_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Organize data before estimation — organize_data","text":"","code":"organize_data( .dataframe, .structure, .estimand, .remove_ties, .att_choose, .lev_choose, .att_notchoose, .lev_notchoose )"},{"path":"https://yhoriuchi.github.io/projoint/reference/organize_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Organize data before estimation — organize_data","text":".dataframe data frame reorganize -- second element list generated reshape_conjoint() .structure either \"choice_level\" \"profile_level\" .remove_ties TRUE want remove ties attribute interest (profile-level analysis) .att_choose character column name identifying attribute interest (.e., attribute-level attribute-levels *chosen*). .lev_choose character vector identifying level levels interest (.e., attribute-level attribute-levels *chosen*). length 1 profile-level analysis 1+ choice-level analysis .att_notchoose character column name identifying attribute interest (.e., attribute-level attribute-levels *chosen*). argument specified `.structure` argument \"choice-level\". .lev_notchoose character vector identifying level levels interest (.e., attribute-level attribute-levels *chosen*). length 1 profile-level analysis 1+ choice-level analysis. argument specified `.structure` argument \"choice-level\".","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/out1_arranged.html","id":null,"dir":"Reference","previous_headings":"","what":"Reorganized Projoint Example Data Set 1 — out1_arranged","title":"Reorganized Projoint Example Data Set 1 — out1_arranged","text":"data set identical Example Data Set 1, except attributes levels manually relabeled reordered using save_labels read_labels. Please see https://yhoriuchi.github.io/projoint/articles/02-wrangle.html instructions manually relabeling.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/out1_arranged.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reorganized Projoint Example Data Set 1 — out1_arranged","text":"","code":"out1_arranged"},{"path":"https://yhoriuchi.github.io/projoint/reference/out1_arranged.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Reorganized Projoint Example Data Set 1 — out1_arranged","text":"## `exampleData1` data frame 201 rows 186 columns: ResponseId Unique respondent ID race Respondent race: 6 categories party_1 Respondent party: Democrat, Republican, Independent, Something else party_2 party_1 D R: closer Democrats closer Republicans? party_3 party_1 R: strong R strong R party_4 party_1 D: strong D strong D ideology Respondent ideology Extremely liberal Extremely conservative honesty Attention check: respondents select \"never\" choice1, choice2, ..., choice8 Respondent selections initial 8 conjoint tasks choice1_repeated_flipped Respondent choice task repeats choice1 flipped","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/out1_arranged.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Reorganized Projoint Example Data Set 1 — out1_arranged","text":"Qualtrics Prolific; see Clayton et al. replication materials.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/pj_estimate.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate and correct MMs or AMCEs — pj_estimate","title":"Estimate and correct MMs or AMCEs — pj_estimate","text":"internal function used calculate correct marginal means average marginal component effects conjoint design.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/pj_estimate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate and correct MMs or AMCEs — pj_estimate","text":"","code":"pj_estimate( .data, .structure = \"profile_level\", .estimand = \"mm\", .att_choose, .lev_choose, .att_notchoose = NULL, .lev_notchoose = NULL, .att_choose_b = NULL, .lev_choose_b = NULL, .att_notchoose_b = NULL, .lev_notchoose_b = NULL, .se_method = \"analytical\", .irr = NULL, .remove_ties = TRUE, .ignore_position = NULL, .n_sims = NULL, .n_boot = NULL, .weights_1 = NULL, .clusters_1 = NULL, .se_type_1 = \"classical\", .weights_2 = NULL, .clusters_2 = NULL, .se_type_2 = \"classical\" )"},{"path":"https://yhoriuchi.github.io/projoint/reference/pj_estimate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate and correct MMs or AMCEs — pj_estimate","text":".data projoint_data object .structure Either \"profile_level\" (default) \"choice_level\" .estimand Either \"mm\" marginal mean \"amce\" average marginal component effect .att_choose character column name identifying attribute interest (.e., attribute-level attribute-levels chosen). .lev_choose character vector identifying level levels interest (.e., attribute-level attribute-levels chosen). length 1 profile-level analysis 1+ choice-level analysis .att_notchoose character column name identifying attribute interest (.e., attribute-level attribute-levels chosen). argument specified .structure argument \"choice-level\". .lev_notchoose character vector identifying level levels interest (.e., attribute-level attribute-levels chosen). length 1 profile-level analysis 1+ choice-level analysis. argument specified .structure argument \"choice-level\". .att_choose_b [baseline AMCE] character column name identifying attribute interest (.e., attribute-level attribute-levels chosen). .lev_choose_b [baseline AMCE] character vector identifying level levels interest (.e., attribute-level attribute-levels chosen). length 1 profile-level analysis 1+ choice-level analysis .att_notchoose_b [baseline AMCE] character column name identifying attribute interest (.e., attribute-level attribute-levels chosen*). argument specified .structure argument \"choice-level\". .lev_notchoose_b [baseline AMCE] character vector identifying level levels interest (.e., attribute-level attribute-levels chosen). length 1 profile-level analysis 1+ choice-level analysis. argument specified .structure argument \"choice-level\". .se_method default, c(\"analytic\", \"simulation\", \"bootstrap\") description .irr NULL (default) IRR calculated using repeated task. Otherwise, numerical value .remove_ties Logical: ties removed estimation? Defaults TRUE. .ignore_position TRUE (default) ignore location profile (left right). Relevant analyzed choice level .n_sims number simulations. Relevant .se_method == \"simulation\" .n_boot number bootstrapped samples. Relevant .se_method == \"bootstrap\" .weights_1 weight estimate IRR (see lm_robust): NULL (default) .clusters_1 clusters estimate IRR (see lm_robust): NULL (default) .se_type_1 standard error type estimate IRR (see lm_robust): \"classical\" (default) .weights_2 weight estimate MM AMCE (see lm_robust): NULL (default) .clusters_2 clusters estimate MM AMCE (see lm_robust): NULL (default) .se_type_2 standard error type estimate MM AMCE (see lm_robust): \"classical\" (default)","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/pj_estimate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate and correct MMs or AMCEs — pj_estimate","text":"data frame estimates","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/plot.projoint_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot all MMs or AMCEs — plot.projoint_results","title":"Plot all MMs or AMCEs — plot.projoint_results","text":"method produces MM AMCE plots given projoint_results object, output projoint function.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/plot.projoint_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot all MMs or AMCEs — plot.projoint_results","text":"","code":"# S3 method for projoint_results plot( x, .estimates = \"corrected\", .by_var = FALSE, .labels = NULL, .base_size = 12, .base_family = \"\", ... )"},{"path":"https://yhoriuchi.github.io/projoint/reference/plot.projoint_results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot all MMs or AMCEs — plot.projoint_results","text":"x projoint_results object .estimates estimates plotted, either \"corrected\" (default), \"uncorrected\", \"\" .by_var (structure profile-level) TRUE plot difference estimates two subgroups, FALSE (default) otherwise .labels (structure choice-level) chaarcter vector x-axis labels .base_size base font size, given pts. .base_family base font family ... Additional optional arguments","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/plot.projoint_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot all MMs or AMCEs — plot.projoint_results","text":"ggplot object","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/plot.projoint_tau.html","id":null,"dir":"Reference","previous_headings":"","what":"Visualize the results of the extrapolation method for estimating tau. — plot.projoint_tau","title":"Visualize the results of the extrapolation method for estimating tau. — plot.projoint_tau","text":"Visualize results extrapolation method estimating tau.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/plot.projoint_tau.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Visualize the results of the extrapolation method for estimating tau. — plot.projoint_tau","text":"","code":"# S3 method for projoint_tau plot(x, ...)"},{"path":"https://yhoriuchi.github.io/projoint/reference/plot.projoint_tau.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Visualize the results of the extrapolation method for estimating tau. — plot.projoint_tau","text":"x object class projoint_tau derived predict_tau ... Optional arguments; currently none accepted","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/plot.projoint_tau.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Visualize the results of the extrapolation method for estimating tau. — plot.projoint_tau","text":"","code":"library(projoint) library(stringr) ## Example 1: repeated, flipped task data(\"exampleData1\") head(exampleData1) #> # A tibble: 6 × 185 #> ResponseId choice1_repeated_fli…¹ choice1 choice2 choice3 choice4 choice5 #> #> 1 R_1M3TDihZzq9z… Community B Commun… Commun… Commun… Commun… Commun… #> 2 R_3HtXzkcSSlfi… Community B Commun… Commun… Commun… Commun… Commun… #> 3 R_yjYj0jtOY98X… Community B Commun… Commun… Commun… Commun… Commun… #> 4 R_1dKd05O6FTOV… Community B Commun… Commun… Commun… Commun… Commun… #> 5 R_1otDp642wWYl… Community A Commun… Commun… Commun… Commun… Commun… #> 6 R_2BnD3fuJMRKZ… Community A Commun… Commun… Commun… Commun… Commun… #> # ℹ abbreviated name: ¹​choice1_repeated_flipped #> # ℹ 178 more variables: choice6 , choice7 , choice8 , #> # race , party_1 , party_2 , party_3 , party_4 , #> # ideology , honesty , `K-1-1` , `K-1-1-1` , #> # `K-1-2` , `K-1-1-2` , `K-1-3` , `K-1-1-3` , #> # `K-1-4` , `K-1-1-4` , `K-1-5` , `K-1-1-5` , #> # `K-1-6` , `K-1-1-6` , `K-1-7` , `K-1-1-7` , … outcomes <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes <- c(outcomes, \"choice1_repeated_flipped\") reshaped_data <- reshape_projoint( .dataframe = exampleData1, .idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE) tau1 <- predict_tau(reshaped_data) plot(tau1)"},{"path":"https://yhoriuchi.github.io/projoint/reference/plot_projoint_choice_level_mm.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot all ","title":"Plot all ","text":"method produces profile-level MM AMCE plots given projoint_results object, output projoint function. structure must profile-level use function.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/plot_projoint_choice_level_mm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot all ","text":"","code":"plot_projoint_choice_level_mm( x, .estimates = \"corrected\", .labels = NULL, .base_size = 12, .base_family = \"\", ... )"},{"path":"https://yhoriuchi.github.io/projoint/reference/plot_projoint_choice_level_mm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot all ","text":"x projoint_results object .estimates estimates plotted, either \"corrected\" (default) \"uncorrected\" .labels character vector x-axis labels .base_size base font size, given pts. .base_family base font family ... Additional optional arguments","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/plot_projoint_choice_level_mm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot all ","text":"ggplot object","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/plot_projoint_profile_level.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot all ","title":"Plot all ","text":"method produces profile-level MM AMCE plots given projoint_results object, output projoint function. structure must profile-level use function.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/plot_projoint_profile_level.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot all ","text":"","code":"plot_projoint_profile_level( x, .estimates = \"corrected\", .by_var = FALSE, .base_size = 12, .base_family = \"\", ... )"},{"path":"https://yhoriuchi.github.io/projoint/reference/plot_projoint_profile_level.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot all ","text":"x projoint_results object .estimates estimates plotted, either \"corrected\" (default), \"uncorrected\", \"\" .by_var TRUE plot difference estimates two subgroups, FALSE (default) otherwise .base_size base font size, given pts. .base_family base font family ... Additional optional arguments","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/plot_projoint_profile_level.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot all ","text":"ggplot object","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/predict_tau.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate tau when there is no repeated task. — predict_tau","title":"Estimate tau when there is no repeated task. — predict_tau","text":"Given output projoint_data, function uses extrapolation method produce estimate intra-coder reliability (IRR).","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/predict_tau.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate tau when there is no repeated task. — predict_tau","text":"","code":"predict_tau(.data, .title = NULL) # S3 method for projoint_tau print(x, ...) # S3 method for projoint_tau summary(object, ...)"},{"path":"https://yhoriuchi.github.io/projoint/reference/predict_tau.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate tau when there is no repeated task. — predict_tau","text":".data projoint_data object, outputted reshape_projoint .title title figure x object class projoint_tau derived predict_tau ... Optional arguments; currently none accepted object object class projoint_tau derived predict_tau","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/predict_tau.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate tau when there is no repeated task. — predict_tau","text":"projoint_tau object containing estimate tau figure visualizing extrapolation method. tibble showing IRR profile similarity changes. value predicted x=0 estimated IRR.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/predict_tau.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate tau when there is no repeated task. — predict_tau","text":"","code":"library(projoint) library(stringr) ## Example 1: repeated, flipped task data(\"exampleData1\") head(exampleData1) #> # A tibble: 6 × 185 #> ResponseId choice1_repeated_fli…¹ choice1 choice2 choice3 choice4 choice5 #> #> 1 R_1M3TDihZzq9z… Community B Commun… Commun… Commun… Commun… Commun… #> 2 R_3HtXzkcSSlfi… Community B Commun… Commun… Commun… Commun… Commun… #> 3 R_yjYj0jtOY98X… Community B Commun… Commun… Commun… Commun… Commun… #> 4 R_1dKd05O6FTOV… Community B Commun… Commun… Commun… Commun… Commun… #> 5 R_1otDp642wWYl… Community A Commun… Commun… Commun… Commun… Commun… #> 6 R_2BnD3fuJMRKZ… Community A Commun… Commun… Commun… Commun… Commun… #> # ℹ abbreviated name: ¹​choice1_repeated_flipped #> # ℹ 178 more variables: choice6 , choice7 , choice8 , #> # race , party_1 , party_2 , party_3 , party_4 , #> # ideology , honesty , `K-1-1` , `K-1-1-1` , #> # `K-1-2` , `K-1-1-2` , `K-1-3` , `K-1-1-3` , #> # `K-1-4` , `K-1-1-4` , `K-1-5` , `K-1-1-5` , #> # `K-1-6` , `K-1-1-6` , `K-1-7` , `K-1-1-7` , … outcomes <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes <- c(outcomes, \"choice1_repeated_flipped\") reshaped_data <- reshape_projoint( .dataframe = exampleData1, .idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE) tau1 <- predict_tau(reshaped_data) tau1 #> [1] \"Tau estimated using the extrapolation method: 0.743\" ## Example 2: repeated, unflipped task data(\"exampleData2\") head(exampleData2) #> # A tibble: 6 × 185 #> ResponseId choice1_repeated_not…¹ choice1 choice2 choice3 choice4 choice5 #> #> 1 R_1M3TDihZzq9z… Community A Commun… Commun… Commun… Commun… Commun… #> 2 R_3HtXzkcSSlfi… Community A Commun… Commun… Commun… Commun… Commun… #> 3 R_yjYj0jtOY98X… Community A Commun… Commun… Commun… Commun… Commun… #> 4 R_1dKd05O6FTOV… Community A Commun… Commun… Commun… Commun… Commun… #> 5 R_1otDp642wWYl… Community B Commun… Commun… Commun… Commun… Commun… #> 6 R_2BnD3fuJMRKZ… Community B Commun… Commun… Commun… Commun… Commun… #> # ℹ abbreviated name: ¹​choice1_repeated_notflipped #> # ℹ 178 more variables: choice6 , choice7 , choice8 , #> # race , party_1 , party_2 , party_3 , party_4 , #> # ideology , honesty , `K-1-1` , `K-1-1-1` , #> # `K-1-2` , `K-1-1-2` , `K-1-3` , `K-1-1-3` , #> # `K-1-4` , `K-1-1-4` , `K-1-5` , `K-1-1-5` , #> # `K-1-6` , `K-1-1-6` , `K-1-7` , `K-1-1-7` , … outcomes <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes <- c(outcomes, \"choice1_repeated_notflipped\") reshaped_data <- reshape_projoint( .dataframe = exampleData2, .idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = FALSE) tau2 <- predict_tau(reshaped_data) tau2 #> [1] \"Tau estimated using the extrapolation method: 0.743\" ## Example 3: no repeated task data(\"exampleData3\") head(exampleData3) #> # A tibble: 6 × 184 #> ResponseId choice1 choice2 choice3 choice4 choice5 choice6 choice7 choice8 #> #> 1 R_1M3TDihZzq9… Commun… Commun… Commun… Commun… Commun… Commun… Commun… Commun… #> 2 R_3HtXzkcSSlf… Commun… Commun… Commun… Commun… Commun… Commun… Commun… Commun… #> 3 R_yjYj0jtOY98… Commun… Commun… Commun… Commun… Commun… Commun… Commun… Commun… #> 4 R_1dKd05O6FTO… Commun… Commun… Commun… Commun… Commun… Commun… Commun… Commun… #> 5 R_1otDp642wWY… Commun… Commun… Commun… Commun… Commun… Commun… Commun… Commun… #> 6 R_2BnD3fuJMRK… Commun… Commun… Commun… Commun… Commun… Commun… Commun… Commun… #> # ℹ 175 more variables: race , party_1 , party_2 , #> # party_3 , party_4 , ideology , honesty , `K-1-1` , #> # `K-1-1-1` , `K-1-2` , `K-1-1-2` , `K-1-3` , #> # `K-1-1-3` , `K-1-4` , `K-1-1-4` , `K-1-5` , #> # `K-1-1-5` , `K-1-6` , `K-1-1-6` , `K-1-7` , #> # `K-1-1-7` , `K-1-2-1` , `K-1-2-2` , `K-1-2-3` , #> # `K-1-2-4` , `K-1-2-5` , `K-1-2-6` , `K-1-2-7` , … outcomes <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes <- c(outcomes) reshaped_data <- reshape_projoint( .dataframe = exampleData3, .idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = FALSE) tau3 <- predict_tau(reshaped_data) tau3 #> [1] \"Tau estimated using the extrapolation method: 0.743\""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint.html","id":null,"dir":"Reference","previous_headings":"","what":"Analyze a conjoint data set and correct for measurement error — projoint","title":"Analyze a conjoint data set and correct for measurement error — projoint","text":"main function analyzes conjoint data set produces measurement error-corrected estimates either marginal means average marginal component effects, ready plotting. accepts `projoint_data` object, optionally `projoint_qoi` object users wish specify complex quantities interest.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Analyze a conjoint data set and correct for measurement error — projoint","text":"","code":"projoint( .data, .qoi = NULL, .by_var = NULL, .structure = \"profile_level\", .estimand = \"mm\", .se_method = \"analytical\", .irr = NULL, .remove_ties = TRUE, .ignore_position = NULL, .n_sims = NULL, .n_boot = NULL, .weights_1 = NULL, .clusters_1 = NULL, .se_type_1 = \"classical\", .weights_2 = NULL, .clusters_2 = NULL, .se_type_2 = \"classical\" ) # S3 method for projoint_results print(x, ...) # S3 method for projoint_results summary(object, ...)"},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Analyze a conjoint data set and correct for measurement error — projoint","text":".data projoint_data object .qoi projoint_qoi object. NULL, defaults producing MMs AMCEs. .by_var dichotomous variable (character) used subgroup analysis .structure Either \"profile_level\" (default) \"choice_level\". .qoi set, value structure .qoi overrides value. .estimand Either \"mm\" marginal mean \"amce\" average marginal component effect. .qoi set, value estimand .qoi overrides value. .se_method default, c(\"analytic\", \"simulation\", \"bootstrap\") description .irr NULL (default) IRR calculated using repeated task. Otherwise, numerical value .remove_ties Logical: ties removed estimation? Defaults TRUE. .ignore_position NULL (default) .structure = \"profile_level\". Set TRUE ignore position profile (left right); FALSE relative positioning profiles matters analysis. .structure = \"profile_level\" argument NULL, automatically reset TRUE. .n_sims number simulations. Relevant .se_method == \"simulation\" .n_boot number bootstrapped samples. Relevant .se_method == \"bootstrap\" .weights_1 weight estimate IRR (see lm_robust): NULL (default) .clusters_1 clusters estimate IRR (see lm_robust): NULL (default) .se_type_1 standard error type estimate IRR (see lm_robust): \"classical\" (default) .weights_2 weight estimate MM AMCE (see lm_robust): NULL (default) .clusters_2 clusters estimate MM AMCE (see lm_robust): NULL (default) .se_type_2 standard error type estimate MM AMCE (see lm_robust): \"classical\" (default) x projoint_results object ... Optional arguments; currently none accepted object projoint_results object","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Analyze a conjoint data set and correct for measurement error — projoint","text":"projoint_results object","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Analyze a conjoint data set and correct for measurement error — projoint","text":"","code":"library(projoint) data(\"exampleData1\") head(exampleData1) #> # A tibble: 6 × 185 #> ResponseId choice1_repeated_fli…¹ choice1 choice2 choice3 choice4 choice5 #> #> 1 R_1M3TDihZzq9z… Community B Commun… Commun… Commun… Commun… Commun… #> 2 R_3HtXzkcSSlfi… Community B Commun… Commun… Commun… Commun… Commun… #> 3 R_yjYj0jtOY98X… Community B Commun… Commun… Commun… Commun… Commun… #> 4 R_1dKd05O6FTOV… Community B Commun… Commun… Commun… Commun… Commun… #> 5 R_1otDp642wWYl… Community A Commun… Commun… Commun… Commun… Commun… #> 6 R_2BnD3fuJMRKZ… Community A Commun… Commun… Commun… Commun… Commun… #> # ℹ abbreviated name: ¹​choice1_repeated_flipped #> # ℹ 178 more variables: choice6 , choice7 , choice8 , #> # race , party_1 , party_2 , party_3 , party_4 , #> # ideology , honesty , `K-1-1` , `K-1-1-1` , #> # `K-1-2` , `K-1-1-2` , `K-1-3` , `K-1-1-3` , #> # `K-1-4` , `K-1-1-4` , `K-1-5` , `K-1-1-5` , #> # `K-1-6` , `K-1-1-6` , `K-1-7` , `K-1-1-7` , … outcomes <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes <- c(outcomes, \"choice1_repeated_flipped\") reshaped_data <- reshape_projoint( .dataframe = exampleData1, .idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE) projoint(reshaped_data) #> [A projoint output] #> Estimand: mm #> Structure: profile_level #> IRR: Estimated #> Tau: 0.1721281 #> Remove ties: TRUE #> SE methods: analytical"},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_data-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Class generator for projoint_data — projoint_data-class","title":"Class generator for projoint_data — projoint_data-class","text":"Class generator projoint_data","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_diff.html","id":null,"dir":"Reference","previous_headings":"","what":"Analyze a conjoint data set and correct for measurement error — projoint_diff","title":"Analyze a conjoint data set and correct for measurement error — projoint_diff","text":"internal function used calculate correct marginal means average marginal component effects conjoint design.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_diff.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Analyze a conjoint data set and correct for measurement error — projoint_diff","text":"","code":"projoint_diff( .data, .qoi = NULL, .by_var, .structure = \"profile_level\", .estimand = \"mm\", .se_method = \"analytical\", .irr = NULL, .remove_ties = TRUE, .ignore_position = NULL, .n_sims = NULL, .n_boot = NULL, .weights_1 = NULL, .clusters_1 = NULL, .se_type_1 = \"classical\", .weights_2 = NULL, .clusters_2 = NULL, .se_type_2 = \"classical\" )"},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_diff.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Analyze a conjoint data set and correct for measurement error — projoint_diff","text":".data projoint_data object .qoi projoint_qoi object. NULL, defaults producing MMs AMCEs. .by_var dichotomous variable (character) used subgroup analysis .structure Either \"profile_level\" (default) \"choice_level\" .estimand Either \"mm\" marginal mean \"amce\" average marginal component effect .se_method default, c(\"analytic\", \"simulation\", \"bootstrap\") description .irr NULL (default) IRR calculated using repeated task. Otherwise, numerical value .remove_ties Logical: ties removed estimation? Defaults TRUE. .ignore_position TRUE (default) ignore location profile (left right). Relevant analyzed choice level .n_sims number simulations. Relevant .se_method == \"simulation\" .n_boot number bootstrapped samples. Relevant .se_method == \"bootstrap\" .weights_1 weight estimate IRR (see lm_robust): NULL (default) .clusters_1 clusters estimate IRR (see lm_robust): NULL (default) .se_type_1 standard error type estimate IRR (see lm_robust): \"classical\" (default) .weights_2 weight estimate MM AMCE (see lm_robust): NULL (default) .clusters_2 clusters estimate MM AMCE (see lm_robust): NULL (default) .se_type_2 standard error type estimate MM AMCE (see lm_robust): \"classical\" (default)","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_diff.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Analyze a conjoint data set and correct for measurement error — projoint_diff","text":"projoint_results object","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_level.html","id":null,"dir":"Reference","previous_headings":"","what":"Analyze a conjoint data set and correct for measurement error — projoint_level","title":"Analyze a conjoint data set and correct for measurement error — projoint_level","text":"internal function used calculate correct marginal means average marginal component effects conjoint design.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_level.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Analyze a conjoint data set and correct for measurement error — projoint_level","text":"","code":"projoint_level( .data, .qoi = NULL, .structure = \"profile_level\", .estimand = \"mm\", .se_method = \"analytical\", .irr = NULL, .remove_ties = TRUE, .ignore_position = NULL, .n_sims = NULL, .n_boot = NULL, .weights_1 = NULL, .clusters_1 = NULL, .se_type_1 = \"classical\", .weights_2 = NULL, .clusters_2 = NULL, .se_type_2 = \"classical\" )"},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_level.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Analyze a conjoint data set and correct for measurement error — projoint_level","text":".data projoint_data object .qoi projoint_qoi object. NULL, defaults producing MMs AMCEs. .structure Either \"profile_level\" (default) \"choice_level\" .estimand Either \"mm\" marginal mean \"amce\" average marginal component effect .se_method default, c(\"analytic\", \"simulation\", \"bootstrap\") description .irr NULL (default) IRR calculated using repeated task. Otherwise, numerical value .remove_ties Logical: ties removed estimation? Defaults TRUE. .ignore_position TRUE (default) ignore location profile (left right). Relevant analyzed choice level .n_sims number simulations. Relevant .se_method == \"simulation\" .n_boot number bootstrapped samples. Relevant .se_method == \"bootstrap\" .weights_1 weight estimate IRR (see lm_robust): NULL (default) .clusters_1 clusters estimate IRR (see lm_robust): NULL (default) .se_type_1 standard error type estimate IRR (see lm_robust): \"classical\" (default) .weights_2 weight estimate MM AMCE (see lm_robust): NULL (default) .clusters_2 clusters estimate MM AMCE (see lm_robust): NULL (default) .se_type_2 standard error type estimate MM AMCE (see lm_robust): \"classical\" (default)","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_level.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Analyze a conjoint data set and correct for measurement error — projoint_level","text":"projoint_results object","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_qoi-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Class generator for projoint_qoi — projoint_qoi-class","title":"Class generator for projoint_qoi — projoint_qoi-class","text":"Class generator projoint_qoi","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_qoi-class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class generator for projoint_qoi — projoint_qoi-class","text":"slots Takes four MMs eight AMCEs well estimand structure","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_results-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Class generators for projoint_results — projoint_results-class","title":"Class generators for projoint_results — projoint_results-class","text":"Class generators projoint_results","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_results-class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class generators for projoint_results — projoint_results-class","text":"slots Takes 16 slots. See documentation projoint. contains Inherits slots projoint_data","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_tau-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Class generator for projoint_tau objects — projoint_tau-class","title":"Class generator for projoint_tau objects — projoint_tau-class","text":"Class generator projoint_tau objects","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_tau-class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class generator for projoint_tau objects — projoint_tau-class","text":"slots Takes two slots: irr figure contains Inherits slots projoint_data","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/read_Qualtrics.html","id":null,"dir":"Reference","previous_headings":"","what":"Read and re-format a Qualtrics csv (choice text) — read_Qualtrics","title":"Read and re-format a Qualtrics csv (choice text) — read_Qualtrics","text":"Read re-format Qualtrics csv (choice text)","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/read_Qualtrics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read and re-format a Qualtrics csv (choice text) — read_Qualtrics","text":"","code":"read_Qualtrics(.file)"},{"path":"https://yhoriuchi.github.io/projoint/reference/read_Qualtrics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read and re-format a Qualtrics csv (choice text) — read_Qualtrics","text":".file file name corresponding csv downloaded Qualtrics.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/read_Qualtrics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read and re-format a Qualtrics csv (choice text) — read_Qualtrics","text":"data frame suitable reshape_projoint","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/read_Qualtrics.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read and re-format a Qualtrics csv (choice text) — read_Qualtrics","text":"","code":"library(projoint) # Not run: # dat <- read_Qualtrics(\"mummolo_nall_replication_cleaned.csv\") # head(dat)"},{"path":"https://yhoriuchi.github.io/projoint/reference/read_labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Reads in a CSV of reordered attributes and levels, and applies it to a projoint_data object. — read_labels","title":"Reads in a CSV of reordered attributes and levels, and applies it to a projoint_data object. — read_labels","text":"users interested reordering attributes levels conjoint data set. First save existing order CSV using save_labels, manually reorder CSV. Finally, use function read modified CSV automatically apply new order existing projoint_data.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/read_labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reads in a CSV of reordered attributes and levels, and applies it to a projoint_data object. — read_labels","text":"","code":"read_labels(.data, .filename)"},{"path":"https://yhoriuchi.github.io/projoint/reference/read_labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reads in a CSV of reordered attributes and levels, and applies it to a projoint_data object. — read_labels","text":".data `projoint_data` object .filename name revised CSV file, originally derived save_labels, manual arrangement","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/read_labels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reads in a CSV of reordered attributes and levels, and applies it to a projoint_data object. — read_labels","text":"projoint object class projoint_data ready pass projoint.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/read_labels.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reads in a CSV of reordered attributes and levels, and applies it to a projoint_data object. — read_labels","text":"","code":"library(projoint) library(readr) data(\"exampleData1\") head(exampleData1) #> # A tibble: 6 × 185 #> ResponseId choice1_repeated_fli…¹ choice1 choice2 choice3 choice4 choice5 #> #> 1 R_1M3TDihZzq9z… Community B Commun… Commun… Commun… Commun… Commun… #> 2 R_3HtXzkcSSlfi… Community B Commun… Commun… Commun… Commun… Commun… #> 3 R_yjYj0jtOY98X… Community B Commun… Commun… Commun… Commun… Commun… #> 4 R_1dKd05O6FTOV… Community B Commun… Commun… Commun… Commun… Commun… #> 5 R_1otDp642wWYl… Community A Commun… Commun… Commun… Commun… Commun… #> 6 R_2BnD3fuJMRKZ… Community A Commun… Commun… Commun… Commun… Commun… #> # ℹ abbreviated name: ¹​choice1_repeated_flipped #> # ℹ 178 more variables: choice6 , choice7 , choice8 , #> # race , party_1 , party_2 , party_3 , party_4 , #> # ideology , honesty , `K-1-1` , `K-1-1-1` , #> # `K-1-2` , `K-1-1-2` , `K-1-3` , `K-1-1-3` , #> # `K-1-4` , `K-1-1-4` , `K-1-5` , `K-1-1-5` , #> # `K-1-6` , `K-1-1-6` , `K-1-7` , `K-1-1-7` , … # Write outcome column names outcomes <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes <- c(outcomes, \"choice1_repeated_flipped\") # Reshape the data reshaped_data <- reshape_projoint( .dataframe = exampleData1, .idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE) # Save a CSV file (Not Run) # save_labels(reshaped_data, \"data-raw/labels_original.csv\") # Not Run: Read a revised CSV file # reshaped_data_arranged <- read_labels(reshaped_data, \"data-raw/labels_arranged.csv\")"},{"path":"https://yhoriuchi.github.io/projoint/reference/reshape_projoint.html","id":null,"dir":"Reference","previous_headings":"","what":"Reshapes survey response data for conjoint analysis — reshape_projoint","title":"Reshapes survey response data for conjoint analysis — reshape_projoint","text":"function takes data frame, preferably read_Qualtrics, reshapes wide long row distinct conjoint task rather respondent.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/reshape_projoint.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reshapes survey response data for conjoint analysis — reshape_projoint","text":"","code":"reshape_projoint( .dataframe, .idvar, .outcomes, .outcomes_ids = c(\"1\", \"2\"), .alphabet = \"F\", .repeated = FALSE, .flipped = NULL, .covariates = NULL, .fill = FALSE )"},{"path":"https://yhoriuchi.github.io/projoint/reference/reshape_projoint.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reshapes survey response data for conjoint analysis — reshape_projoint","text":".dataframe data frame, preferably read_Qualtrics .idvar character identifying column name containing respondent IDs .outcomes character vector identifying column names contain outcomes. repeated task, LAST element vector. .outcomes_ids vector identifying possibilities outcome variables -- e.g., c(\"Candidate \", \"Candidate B\") .alphabet letter indicating conjoint attributes. using Strezhnev's package (https://github.com/astrezhnev/conjointsdt) Qualtrics, default F. .repeated TRUE repeated task (recommended). repeated task first task. .flipped TRUE profiles repeated task flipped (recommended) .covariates character vector identifying respondents' covariates used subgroup analysis .fill logical vector: TRUE want use information whether respondent chose profile repeated task \"fill\" (using `tidyr` package) missing values non-repeated tasks, FALSE (otherwise). number respondents small, number specific profile pairs interest small, /number specific respondent subgroups want study small, worth changing option TRUE. please note `.fill = TRUE` based assumption IRR independent information contained conjoint tables. Although empirical tests suggest validity assumption, unsure , better use default value (FALSE).","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/reshape_projoint.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reshapes survey response data for conjoint analysis — reshape_projoint","text":"projoint object class `projoint_data` ready pass `projoint()`. projoint object class projoint_data ready pass projoint.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/reshape_projoint.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reshapes survey response data for conjoint analysis — reshape_projoint","text":"","code":"library(projoint) library(stringr) data(\"exampleData1\") head(exampleData1) #> # A tibble: 6 × 185 #> ResponseId choice1_repeated_fli…¹ choice1 choice2 choice3 choice4 choice5 #> #> 1 R_1M3TDihZzq9z… Community B Commun… Commun… Commun… Commun… Commun… #> 2 R_3HtXzkcSSlfi… Community B Commun… Commun… Commun… Commun… Commun… #> 3 R_yjYj0jtOY98X… Community B Commun… Commun… Commun… Commun… Commun… #> 4 R_1dKd05O6FTOV… Community B Commun… Commun… Commun… Commun… Commun… #> 5 R_1otDp642wWYl… Community A Commun… Commun… Commun… Commun… Commun… #> 6 R_2BnD3fuJMRKZ… Community A Commun… Commun… Commun… Commun… Commun… #> # ℹ abbreviated name: ¹​choice1_repeated_flipped #> # ℹ 178 more variables: choice6 , choice7 , choice8 , #> # race , party_1 , party_2 , party_3 , party_4 , #> # ideology , honesty , `K-1-1` , `K-1-1-1` , #> # `K-1-2` , `K-1-1-2` , `K-1-3` , `K-1-1-3` , #> # `K-1-4` , `K-1-1-4` , `K-1-5` , `K-1-1-5` , #> # `K-1-6` , `K-1-1-6` , `K-1-7` , `K-1-1-7` , … # Write outcome column names outcomes <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes <- c(outcomes, \"choice1_repeated_flipped\") # Reshape the data reshaped_data <- reshape_projoint( .dataframe = exampleData1, .idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE, .fill = FALSE)"},{"path":"https://yhoriuchi.github.io/projoint/reference/save_labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Save the attributes and levels, and their order, from a conjoint data set, to a CSV file. — save_labels","title":"Save the attributes and levels, and their order, from a conjoint data set, to a CSV file. — save_labels","text":"function saves labels attributes levels, generated reshape_projoint, CSV file. important step reorganizing labels.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/save_labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Save the attributes and levels, and their order, from a conjoint data set, to a CSV file. — save_labels","text":"","code":"save_labels(.data, .filename)"},{"path":"https://yhoriuchi.github.io/projoint/reference/save_labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save the attributes and levels, and their order, from a conjoint data set, to a CSV file. — save_labels","text":".data projoint_data object .filename name CSV file saved","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/save_labels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Save the attributes and levels, and their order, from a conjoint data set, to a CSV file. — save_labels","text":"None","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/save_labels.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Save the attributes and levels, and their order, from a conjoint data set, to a CSV file. — save_labels","text":"","code":"library(projoint) library(readr) data(\"exampleData1\") head(exampleData1) #> # A tibble: 6 × 185 #> ResponseId choice1_repeated_fli…¹ choice1 choice2 choice3 choice4 choice5 #> #> 1 R_1M3TDihZzq9z… Community B Commun… Commun… Commun… Commun… Commun… #> 2 R_3HtXzkcSSlfi… Community B Commun… Commun… Commun… Commun… Commun… #> 3 R_yjYj0jtOY98X… Community B Commun… Commun… Commun… Commun… Commun… #> 4 R_1dKd05O6FTOV… Community B Commun… Commun… Commun… Commun… Commun… #> 5 R_1otDp642wWYl… Community A Commun… Commun… Commun… Commun… Commun… #> 6 R_2BnD3fuJMRKZ… Community A Commun… Commun… Commun… Commun… Commun… #> # ℹ abbreviated name: ¹​choice1_repeated_flipped #> # ℹ 178 more variables: choice6 , choice7 , choice8 , #> # race , party_1 , party_2 , party_3 , party_4 , #> # ideology , honesty , `K-1-1` , `K-1-1-1` , #> # `K-1-2` , `K-1-1-2` , `K-1-3` , `K-1-1-3` , #> # `K-1-4` , `K-1-1-4` , `K-1-5` , `K-1-1-5` , #> # `K-1-6` , `K-1-1-6` , `K-1-7` , `K-1-1-7` , … # Write outcome column names outcomes <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes <- c(outcomes, \"choice1_repeated_flipped\") # Reshape the data reshaped_data <- reshape_projoint( .dataframe = exampleData1, .idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE) # Not Run: Save a CSV file # save_labels(reshaped_data, \"data-raw/labels_original.csv\")"},{"path":"https://yhoriuchi.github.io/projoint/reference/set_qoi.html","id":null,"dir":"Reference","previous_headings":"","what":"Set the quantities of interest — set_qoi","title":"Set the quantities of interest — set_qoi","text":"function allows users specify fine-tuned details conjoint analysis. particular, users can set specific quantities interest aside simple AMCEs MMs.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/set_qoi.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set the quantities of interest — set_qoi","text":"","code":"set_qoi( .structure = \"profile_level\", .estimand = \"mm\", .att_choose, .lev_choose, .att_notchoose = NULL, .lev_notchoose = NULL, .att_choose_b = NULL, .lev_choose_b = NULL, .att_notchoose_b = NULL, .lev_notchoose_b = NULL )"},{"path":"https://yhoriuchi.github.io/projoint/reference/set_qoi.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set the quantities of interest — set_qoi","text":".structure Either \"profile_level\" \"choice_level\" .estimand Either \"mm\" marginal mean \"amce\" average marginal component effect .att_choose character column name identifying attribute interest (.e., attribute-level attribute-levels chosen). .lev_choose character vector identifying level levels interest (.e., attribute-level attribute-levels chosen). length 1 profile-level analysis 1+ choice-level analysis .att_notchoose character column name identifying attribute interest (.e., attribute-level attribute-levels chosen). argument specified .structure argument \"choice-level\". .lev_notchoose character vector identifying level levels interest (.e., attribute-level attribute-levels chosen). length 1 profile-level analysis 1+ choice-level analysis. argument specified .structure argument \"choice-level\". .att_choose_b [baseline AMCE] character column name identifying attribute interest (.e., attribute-level attribute-levels chosen). .lev_choose_b [baseline AMCE] character vector identifying level levels interest (.e., attribute-level attribute-levels chosen). length 1 profile-level analysis 1+ choice-level analysis .att_notchoose_b [baseline AMCE] character column name identifying attribute interest (.e., attribute-level attribute-levels chosen*). argument specified .structure argument \"choice-level\". .lev_notchoose_b [baseline AMCE] character vector identifying level levels interest (.e., attribute-level attribute-levels chosen). length 1 profile-level analysis 1+ choice-level analysis. argument specified .structure argument \"choice-level\".","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/set_qoi.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set the quantities of interest — set_qoi","text":"projoint_qoi object","code":""},{"path":"https://yhoriuchi.github.io/projoint/news/index.html","id":"projoint-development-version","dir":"Changelog","previous_headings":"","what":"projoint (development version)","title":"projoint (development version)","text":"written","code":""}] +[{"path":[]},{"path":"https://yhoriuchi.github.io/projoint/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://yhoriuchi.github.io/projoint/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://yhoriuchi.github.io/projoint/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://yhoriuchi.github.io/projoint/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://yhoriuchi.github.io/projoint/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement yusaku.horiuchi@dartmouth.edu. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://yhoriuchi.github.io/projoint/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://yhoriuchi.github.io/projoint/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://yhoriuchi.github.io/projoint/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://yhoriuchi.github.io/projoint/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://yhoriuchi.github.io/projoint/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://yhoriuchi.github.io/projoint/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired [Mozilla’s code conduct enforcement ladder][https://github.com/mozilla/inclusion]. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://yhoriuchi.github.io/projoint/articles/01-setup.html","id":"generate-a-javascript-or-php-randomizer","dir":"Articles","previous_headings":"","what":"1.1 Generate a JavaScript or PHP randomizer","title":"1. Setting up your Qualtrics survey","text":"Strezhnev’s guide designing implementing conjoint surveys Qualtrics excellent reiterate . summarize: researchers first use ConjointSDT produce JavaScript PHP randomizer.","code":""},{"path":"https://yhoriuchi.github.io/projoint/articles/01-setup.html","id":"javascript","dir":"Articles","previous_headings":"1.1 Generate a JavaScript or PHP randomizer","what":"JavaScript","title":"1. Setting up your Qualtrics survey","text":"JavaScript randomizer can inputted first screen Qualtrics survey, using Edit Question Javascript functionality. See following screenshot example: Javascript available . JavaScript produced ConjointSDT run internally within Qualtrics automatically creates values embedded fields. attributes levels constitute profile pairs conjoint task. example, embedded field “K-1-1-7” contains value (level) seventh attribute first profile (two) first task, “K-5-2-5” contains level fifth attribute second profile (two) fifth task.","code":""},{"path":"https://yhoriuchi.github.io/projoint/articles/01-setup.html","id":"php","dir":"Articles","previous_headings":"1.1 Generate a JavaScript or PHP randomizer","what":"PHP","title":"1. Setting up your Qualtrics survey","text":"PHP randomizer must hosted server. following example hosted server: https://www.horiuchi.org/php/ACHR_Modified_2.php. (PHP file available .) PHP randomizer used Agadjanian, Carey, Horiuchi, Ryan (2023).","code":""},{"path":"https://yhoriuchi.github.io/projoint/articles/01-setup.html","id":"modify-your-javascript-or-php-randomizer","dir":"Articles","previous_headings":"","what":"1.2 Modify your Javascript or PHP randomizer","title":"1. Setting up your Qualtrics survey","text":"add additional constraints, removing ties two profiles, need revise PHP scripts Javascript manually. future release package, add additional feature make step easier. now, recommend use resources, including Open AI’s GPT-4), learn modify code. PHP example following manually added component end race one profile (candidate) always “White” another always “Black,” “Asian,” “Hispanic.” examples adding additional constraints, please send email package maintainer, Yusaku Horiuchi Thank !","code":"$treat_profile_one = \"B-\" . (string)$p . \"-1-\" . (string)$treat_number; $treat_profile_two = \"B-\" . (string)$p . \"-2-\" . (string)$treat_number; $cond1 = $returnarray[$treat_profile_one] == \"White\" && $returnarray[$treat_profile_two] == $type; $cond2 = $returnarray[$treat_profile_two] == \"White\" && $returnarray[$treat_profile_one] == $type; if ($cond1 or $cond2){$complete = True;}"},{"path":"https://yhoriuchi.github.io/projoint/articles/01-setup.html","id":"add-conjoint-tables-with-embedded-fields-in-qualtrics","dir":"Articles","previous_headings":"","what":"1.3 Add conjoint tables with embedded fields in Qualtrics","title":"1. Setting up your Qualtrics survey","text":"set JavaScript PHP randomizer, next step design, task, table using HTML insert embedded fiels. following screenshot first task example. complete HTML first conjoint task survey available . typical conjoint study include 5-10 tasks. number questions HTML pages correspond number tasks. embedded fields task different: first digit “K” increment 1 10 tasks progress.","code":""},{"path":"https://yhoriuchi.github.io/projoint/articles/01-setup.html","id":"adding-a-repeated-task-recommended","dir":"Articles","previous_headings":"1.3 Add conjoint tables with embedded fields in Qualtrics","what":"Adding a repeated task (recommended!)","title":"1. Setting up your Qualtrics survey","text":"wish implement repeated task, , need copy task repeated (say, first task) later point survey (say, fifth task). recommend researchers flip order two profiles well. Therefore, Profile 1 original task becomes Profile 2 new task. , simply swap middle digit embedded fields . repeated task look like following: complete HTML repeated conjoint task survey available . Importantly,repeated task, researchers can use measure intra-respondent reliability (IRR).","code":""},{"path":"https://yhoriuchi.github.io/projoint/articles/01-setup.html","id":"a-sample-qualtrics-survey","dir":"Articles","previous_headings":"","what":"1.4 A sample Qualtrics survey","title":"1. Setting up your Qualtrics survey","text":"want copy Qualtric survey designed exmaple, download QSF file import Qualtrics account. can use template design conjoint survey experiment!","code":""},{"path":"https://yhoriuchi.github.io/projoint/articles/02-wrangle.html","id":"load-the-projoint-package","dir":"Articles","previous_headings":"","what":"2.1 Load the projoint package","title":"2. Read and wrangle your data for conjoint analysis","text":"","code":"library(projoint)"},{"path":[]},{"path":"https://yhoriuchi.github.io/projoint/articles/02-wrangle.html","id":"with-the-flipped-repeated-tasks","dir":"Articles","previous_headings":"2.2 Read and wrangle data","what":"With the flipped repeated tasks","title":"2. Read and wrangle your data for conjoint analysis","text":"Let’s look simple example. expand arguments clarity: Let’s walk arguments specified. .dataframe data frame, ideally read Qualtrics using read_Qualtrics() necessarily. .idvar argument, character, indicates exampleData1, column ResponseId indicates unique survey respondents. .outcomes variable lists columns outcomes; last element vector repeated task (conducted). .outcomes_ids indicates possible options outcome; specifically, vector characters two elements, last characters names first second profiles. example, c(“”, “B”) profile names “Candidate ” “Candidate B”. character vector can anything, c(“1”, “2”), c(“”, “b”), etc. multiple tasks design, use profile names across tasks. .alphabet defaults “K” conjoint survey conducted using either tool Strezhnev’s Conjoint Survey Design Tool. final two arguments, .repeated .flipped, relate repeated task. .repeated set TRUE, last element .outcomes vector taken repetition first task; .flipped indicates whether profiles reversed order. See Section 2.3 .fill.","code":"outcomes1 <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes1 <- c(outcomes1, \"choice1_repeated_flipped\") out1 <- reshape_projoint(.dataframe = exampleData1, .idvar = \"ResponseId\", .outcomes = outcomes1, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE, .fill = FALSE)"},{"path":"https://yhoriuchi.github.io/projoint/articles/02-wrangle.html","id":"with-the-not-flipped-repeated-tasks","dir":"Articles","previous_headings":"2.2 Read and wrangle data","what":"With the not-flipped repeated tasks","title":"2. Read and wrangle your data for conjoint analysis","text":"slight variation, cases repeated task flipped – , repeated task, original Profile 1 still Profile 1, rather flipping positions Profile 2. specify changing .flipped FALSE.","code":"outcomes2 <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes2 <- c(outcomes2, \"choice1_repeated_notflipped\") out2 <- reshape_projoint(.dataframe = exampleData2, .idvar = \"ResponseId\", .outcomes = outcomes2, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = FALSE, .fill = FALSE)"},{"path":"https://yhoriuchi.github.io/projoint/articles/02-wrangle.html","id":"without-the-repeated-tasks","dir":"Articles","previous_headings":"2.2 Read and wrangle data","what":"Without the repeated tasks","title":"2. Read and wrangle your data for conjoint analysis","text":"cases repeated task , set .repeated FALSE .flipped NULL. Don’t worry, can still correct measurement error using extrapolation method; see third vignette details.","code":"outcomes3 <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) out3 <- reshape_projoint(.dataframe = exampleData3, .idvar = \"ResponseId\", .outcomes = outcomes3, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = FALSE, .flipped = NULL, .fill = FALSE)"},{"path":"https://yhoriuchi.github.io/projoint/articles/02-wrangle.html","id":"the--fill-argument","dir":"Articles","previous_headings":"","what":"2.3 The .fill argument","title":"2. Read and wrangle your data for conjoint analysis","text":".fill argument logical: TRUE want use information whether respondent chose profile repeated task “fill” (using ‘tidyr’ package) missing values non-repeated tasks, FALSE (otherwise). can see difference comparing results reshape_projoint .fill either TRUE FALSE. Looking subset variables, can see first data frame includes values agree variable (whether profile chosen ) repeated task. second data frame fills missing values non-repeated tasks. number respondents small, number specific profile pairs interest small, /number specific respondent subgroups want study small, worth changing option TRUE. please note .fill = TRUE based assumption IRR independent information contained conjoint tables. Although empirical tests suggest validity assumption, unsure , better use default value (FALSE).","code":"fill_FALSE <- reshape_projoint(.dataframe = exampleData1, .idvar = \"ResponseId\", .outcomes = outcomes1, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE, .fill = FALSE) fill_TRUE <- reshape_projoint(.dataframe = exampleData1, .idvar = \"ResponseId\", .outcomes = outcomes1, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE, .fill = TRUE) selected_vars <- c(\"id\", \"task\", \"profile\", \"selected\", \"selected_repeated\", \"agree\") fill_FALSE@data[selected_vars] ## # A tibble: 6,400 × 6 ## id task profile selected selected_repeated agree ## ## 1 R_00zYHdY1te1Qlrz 1 1 1 1 1 ## 2 R_00zYHdY1te1Qlrz 1 2 0 0 1 ## 3 R_00zYHdY1te1Qlrz 2 1 1 NA NA ## 4 R_00zYHdY1te1Qlrz 2 2 0 NA NA ## 5 R_00zYHdY1te1Qlrz 3 1 1 NA NA ## 6 R_00zYHdY1te1Qlrz 3 2 0 NA NA ## 7 R_00zYHdY1te1Qlrz 4 1 0 NA NA ## 8 R_00zYHdY1te1Qlrz 4 2 1 NA NA ## 9 R_00zYHdY1te1Qlrz 5 1 1 NA NA ## 10 R_00zYHdY1te1Qlrz 5 2 0 NA NA ## # ℹ 6,390 more rows fill_TRUE@data[selected_vars] ## # A tibble: 6,400 × 6 ## id task profile selected selected_repeated agree ## ## 1 R_00zYHdY1te1Qlrz 1 1 1 1 1 ## 2 R_00zYHdY1te1Qlrz 1 2 0 0 1 ## 3 R_00zYHdY1te1Qlrz 2 1 1 NA 1 ## 4 R_00zYHdY1te1Qlrz 2 2 0 NA 1 ## 5 R_00zYHdY1te1Qlrz 3 1 1 NA 1 ## 6 R_00zYHdY1te1Qlrz 3 2 0 NA 1 ## 7 R_00zYHdY1te1Qlrz 4 1 0 NA 1 ## 8 R_00zYHdY1te1Qlrz 4 2 1 NA 1 ## 9 R_00zYHdY1te1Qlrz 5 1 1 NA 1 ## 10 R_00zYHdY1te1Qlrz 5 2 0 NA 1 ## # ℹ 6,390 more rows"},{"path":"https://yhoriuchi.github.io/projoint/articles/02-wrangle.html","id":"what-if-your-data-is-already-clean","dir":"Articles","previous_headings":"","what":"2.4 What if your data is already clean?","title":"2. Read and wrangle your data for conjoint analysis","text":"already downloaded data set Qualtrics, loaded R, cleaned , can use make_projoint_data() save data frame tibble projoint_data object use projoint(). example. First, load data frame. look like tibble . row correspond one profile one task one respondent. data frame columns indicating (1) respondent ID, (2) task number, (3) profile number, (4) attributes, (5) column recording response (0, 1) task. design includes repeated task, also include column recording response repeated task. case, column select_repeated. Next, make character vector attributes. data frame attributes vector, can use make_projoint_data() produce projoint_data object. can see column indicating respondent ID called id, pass .id_var argument make_projoint_data. id also default argument. output function look output fill_FALSE previous section.","code":"data <- exampleData1_labelled_tibble options(tibble.width = Inf) data ## # A tibble: 6,400 × 14 ## id task profile selected selected_repeated `School Quality` ## ## 1 R_00zYHdY1te1Qlrz 1 1 1 1 9 out of 10 ## 2 R_00zYHdY1te1Qlrz 1 2 0 0 5 out of 10 ## 3 R_00zYHdY1te1Qlrz 2 1 1 NA 9 out of 10 ## 4 R_00zYHdY1te1Qlrz 2 2 0 NA 9 out of 10 ## 5 R_00zYHdY1te1Qlrz 3 1 1 NA 5 out of 10 ## 6 R_00zYHdY1te1Qlrz 3 2 0 NA 9 out of 10 ## 7 R_00zYHdY1te1Qlrz 4 1 0 NA 5 out of 10 ## 8 R_00zYHdY1te1Qlrz 4 2 1 NA 9 out of 10 ## 9 R_00zYHdY1te1Qlrz 5 1 1 NA 5 out of 10 ## 10 R_00zYHdY1te1Qlrz 5 2 0 NA 5 out of 10 ## `Violent Crime Rate (Vs National Rate)` `Racial Composition` ## ## 1 20% Less Crime Than National Average 50% White, 50% Nonwhite ## 2 20% More Crime Than National Average 50% White, 50% Nonwhite ## 3 20% More Crime Than National Average 90% White, 10% Nonwhite ## 4 20% More Crime Than National Average 96% White, 4% Nonwhite ## 5 20% More Crime Than National Average 96% White, 4% Nonwhite ## 6 20% More Crime Than National Average 90% White, 10% Nonwhite ## 7 20% Less Crime Than National Average 50% White, 50% Nonwhite ## 8 20% Less Crime Than National Average 50% White, 50% Nonwhite ## 9 20% Less Crime Than National Average 75% White, 25% Nonwhite ## 10 20% Less Crime Than National Average 96% White, 4% Nonwhite ## `Housing Cost` `Presidential Vote (2020)` ## ## 1 30% of pre-tax income 50% Democrat, 50% Republican ## 2 30% of pre-tax income 70% Democrat, 30% Republican ## 3 30% of pre-tax income 50% Democrat, 50% Republican ## 4 40% of pre-tax income 30% Democrat, 70% Republican ## 5 40% of pre-tax income 70% Democrat, 30% Republican ## 6 30% of pre-tax income 30% Democrat, 70% Republican ## 7 15% of pre-tax income 70% Democrat, 30% Republican ## 8 15% of pre-tax income 50% Democrat, 50% Republican ## 9 15% of pre-tax income 50% Democrat, 50% Republican ## 10 30% of pre-tax income 50% Democrat, 50% Republican ## `Total Daily Driving Time for Commuting and Errands` ## ## 1 75 min ## 2 10 min ## 3 75 min ## 4 10 min ## 5 10 min ## 6 45 min ## 7 25 min ## 8 10 min ## 9 75 min ## 10 25 min ## `Type of Place` race ## ## 1 Suburban neighborhood with houses only White ## 2 City – downtown, with a mix of offices, apartments, and shops White ## 3 Suburban neighborhood with mix of shops, houses, businesses White ## 4 Suburban neighborhood with mix of shops, houses, businesses White ## 5 Rural area White ## 6 Rural area White ## 7 Suburban neighborhood with houses only White ## 8 Suburban neighborhood with mix of shops, houses, businesses White ## 9 City, more residential area White ## 10 City, more residential area White ## ideology ## ## 1 Moderate; middle of the road ## 2 Moderate; middle of the road ## 3 Moderate; middle of the road ## 4 Moderate; middle of the road ## 5 Moderate; middle of the road ## 6 Moderate; middle of the road ## 7 Moderate; middle of the road ## 8 Moderate; middle of the road ## 9 Moderate; middle of the road ## 10 Moderate; middle of the road ## # ℹ 6,390 more rows attributes <- c(\"School Quality\", \"Violent Crime Rate (Vs National Rate)\", \"Racial Composition\", \"Housing Cost\", \"Presidential Vote (2020)\", \"Total Daily Driving Time for Commuting and Errands\", \"Type of Place\") out4 <- make_projoint_data(.dataframe = data, .attribute_vars = attributes, .id_var = \"id\", # the default name .task_var = \"task\", # the default name .profile_var = \"profile\", # the default name .selected_var = \"selected\", # the default name .selected_repeated_var = \"selected_repeated\", # the default is NULL .fill = TRUE) out4 ## An object of class \"projoint_data\" ## Slot \"labels\": ## # A tibble: 24 × 4 ## attribute_id level level_id attribute ## ## 1 att1 15% of pre-tax income att1:lev1 Housing Cost ## 2 att1 30% of pre-tax income att1:lev2 Housing Cost ## 3 att1 40% of pre-tax income att1:lev3 Housing Cost ## 4 att2 30% Democrat, 70% Republican att2:lev1 Presidential Vote (2020) ## 5 att2 50% Democrat, 50% Republican att2:lev2 Presidential Vote (2020) ## 6 att2 70% Democrat, 30% Republican att2:lev3 Presidential Vote (2020) ## 7 att3 50% White, 50% Nonwhite att3:lev1 Racial Composition ## 8 att3 75% White, 25% Nonwhite att3:lev2 Racial Composition ## 9 att3 90% White, 10% Nonwhite att3:lev3 Racial Composition ## 10 att3 96% White, 4% Nonwhite att3:lev4 Racial Composition ## # ℹ 14 more rows ## ## Slot \"data\": ## # A tibble: 6,400 × 13 ## id task profile selected selected_repeated agree att4 ## ## 1 R_00zYHdY1te1Qlrz 1 1 1 1 1 att4:lev2 ## 2 R_00zYHdY1te1Qlrz 1 2 0 0 1 att4:lev1 ## 3 R_00zYHdY1te1Qlrz 2 1 1 NA 1 att4:lev2 ## 4 R_00zYHdY1te1Qlrz 2 2 0 NA 1 att4:lev2 ## 5 R_00zYHdY1te1Qlrz 3 1 1 NA 1 att4:lev1 ## 6 R_00zYHdY1te1Qlrz 3 2 0 NA 1 att4:lev2 ## 7 R_00zYHdY1te1Qlrz 4 1 0 NA 1 att4:lev1 ## 8 R_00zYHdY1te1Qlrz 4 2 1 NA 1 att4:lev2 ## 9 R_00zYHdY1te1Qlrz 5 1 1 NA 1 att4:lev1 ## 10 R_00zYHdY1te1Qlrz 5 2 0 NA 1 att4:lev1 ## att7 att3 att1 att2 att5 att6 ## ## 1 att7:lev1 att3:lev1 att1:lev2 att2:lev2 att5:lev4 att6:lev5 ## 2 att7:lev2 att3:lev1 att1:lev2 att2:lev3 att5:lev1 att6:lev1 ## 3 att7:lev2 att3:lev3 att1:lev2 att2:lev2 att5:lev4 att6:lev6 ## 4 att7:lev2 att3:lev4 att1:lev3 att2:lev1 att5:lev1 att6:lev6 ## 5 att7:lev2 att3:lev4 att1:lev3 att2:lev3 att5:lev1 att6:lev3 ## 6 att7:lev2 att3:lev3 att1:lev2 att2:lev1 att5:lev3 att6:lev3 ## 7 att7:lev1 att3:lev1 att1:lev1 att2:lev3 att5:lev2 att6:lev5 ## 8 att7:lev1 att3:lev1 att1:lev1 att2:lev2 att5:lev1 att6:lev6 ## 9 att7:lev1 att3:lev2 att1:lev1 att2:lev2 att5:lev4 att6:lev2 ## 10 att7:lev1 att3:lev4 att1:lev2 att2:lev2 att5:lev2 att6:lev2 ## # ℹ 6,390 more rows"},{"path":"https://yhoriuchi.github.io/projoint/articles/02-wrangle.html","id":"arrange-the-order-and-labels-of-attributes-and-levels","dir":"Articles","previous_headings":"","what":"2.5 Arrange the order and labels of attributes and levels","title":"2. Read and wrangle your data for conjoint analysis","text":"default, reshaped data attributes levels ordered alphabetically. like reorder relable attributes levels, make process easy. first save labels using save_labels(), produces CSV file. CSV file saved local computer, revise column named order specify order attributes levels want display figure. can also revise labels attributes levels way like. make change first column named level_id. saving updated CSV file, can use read_labels() read modified CSV. use object later projoint function. can find data set GitHub: labels_original.csv labels_arranged.csv. figure based original order labels alphabetical order: labels order attribute-levels second figure Figure 2 Mummolo Nall (2017).","code":"save_labels(out1, \"temp/labels_original.csv\") out1_arranged <- read_labels(out1, \"temp/labels_arranged.csv\") mm <- projoint(out1, .estimand = \"mm\") plot(mm) mm <- projoint(out1_arranged, .estimand = \"mm\") plot(mm)"},{"path":"https://yhoriuchi.github.io/projoint/articles/03-predict.html","id":"load-the-projoint-package","dir":"Articles","previous_headings":"","what":"3.1 Load the projoint package","title":"3. Predict the intra-respondent reliability (IRR)","text":"","code":"library(projoint)"},{"path":"https://yhoriuchi.github.io/projoint/articles/03-predict.html","id":"predict-irr-based-on-the-extrapolation-method","dir":"Articles","previous_headings":"","what":"3.2 Predict IRR based on the extrapolation method","title":"3. Predict the intra-respondent reliability (IRR)","text":", start reading Qualtrics file reshaping using reshape_projoint(). See 2.2 Read wrangle data, flipped repeated tasks. Since already , ’ll skip right ahead load “out1_arranged” object . (See 2.5 Arrange order labels attributes levels. pass data set predict_tau function, calculates IRR produces figure showing extrapolation method visually (see 2.3 Arrange order labels attributes levels). projoint_tau object, created predict_tau, can explored using usual tools. print method explains estimate tau produced via extrapolation rather assumed calculated using repeated task presents estimate: summary method returns tibble IRR profiles become dissimilar. x=7, example, attributes different two profiles see IRR 0.503. extrapolate x=0, IRR profiles identical: plot method renders plot showing extrapolated value tau:","code":"data(out1_arranged) predicted_irr <- predict_tau(out1_arranged) print(predicted_irr) ## [1] \"Tau estimated using the extrapolation method: 0.743\" summary(predicted_irr) ## # A tibble: 8 × 2 ## x predicted ## ## 1 0 0.743 ## 2 1 0.709 ## 3 2 0.675 ## 4 3 0.640 ## 5 4 0.606 ## 6 5 0.572 ## 7 6 0.537 ## 8 7 0.503 plot(predicted_irr)"},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"load-the-projoint-package-and-set-up-the-data","dir":"Articles","previous_headings":"","what":"4.1 Load the projoint package and set up the data","title":"4. Estimate corrected MMs or AMCEs","text":"","code":"library(projoint) outcomes <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes <- c(outcomes, \"choice1_repeated_flipped\") out1 <- reshape_projoint(.dataframe = exampleData1, .idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE)"},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"why-do-we-recommend-you-use-ids","dir":"Articles","previous_headings":"","what":"4.2 Why do we recommend you use IDs?","title":"4. Estimate corrected MMs or AMCEs","text":"estimate visualize quantities interest using package (least current version), need set attributes levels using IDs, att1 level2, rather actual labels, “Housing Cost” (att1) “15% pre-tax income” (level1 att1). think approach prone error applications may include foreign characters (e.g., 2-byte Japanese characters) special characters. Sometimes, design may include levels one attribute; example, “Teaching quality” = {“High”, “Low”} “Research quality” = {“High”, “Low”)). avoid possible strange result, use unique identiers attribute-level. check IDs correspond attributes levels, can type following line script: can also save_labels() save CSV file reference.","code":"out1@labels ## # A tibble: 24 × 4 ## attribute level attribute_id level_id ## ## 1 Housing Cost 15% of pre-tax income att1 att1:leve… ## 2 Housing Cost 30% of pre-tax income att1 att1:leve… ## 3 Housing Cost 40% of pre-tax income att1 att1:leve… ## 4 Presidential Vote (2020) 30% Democrat, 70% Republican att2 att2:leve… ## 5 Presidential Vote (2020) 50% Democrat, 50% Republican att2 att2:leve… ## 6 Presidential Vote (2020) 70% Democrat, 30% Republican att2 att2:leve… ## 7 Racial Composition 50% White, 50% Nonwhite att3 att3:leve… ## 8 Racial Composition 75% White, 25% Nonwhite att3 att3:leve… ## 9 Racial Composition 90% White, 10% Nonwhite att3 att3:leve… ## 10 Racial Composition 96% White, 4% Nonwhite att3 att3:leve… ## # ℹ 14 more rows"},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"estimate-mms","dir":"Articles","previous_headings":"","what":"4.3 Estimate MMs","title":"4. Estimate corrected MMs or AMCEs","text":"two main setups projoint can produce estimates. profile-level common approach literature, choice-level flexible powerful.","code":""},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"mm-profile-level-all-levels","dir":"Articles","previous_headings":"4.3 Estimate MMs","what":"MM (profile-level) – all levels","title":"4. Estimate corrected MMs or AMCEs","text":"default method projoint estimate marginal means (MMs) profile-level. run projoint(out1), conduct analysis. expand arguments clarity:","code":"mm0 <- projoint(.data = out1, .qoi = NULL, .by_var = NULL, .structure = \"profile_level\", .estimand = \"mm\", .se_method = \"analytical\", .irr = NULL, .remove_ties = TRUE, .ignore_position = NULL, .n_sims = NULL, .n_boot = NULL, .weights_1 = NULL, .clusters_1 = NULL, .se_type_1 = \"classical\", .weights_2 = NULL, .clusters_2 = NULL, .se_type_2 = \"classical\") print(mm0) ## [A projoint output] ## Estimand: mm ## Structure: profile_level ## IRR: Estimated ## Tau: 0.1721281 ## Remove ties: TRUE ## SE methods: analytical summary(mm0) ## # A tibble: 48 × 6 ## estimand estimate se conf.low conf.high att_level_choose ## ## 1 mm_uncorrected 0.574 0.0134 0.548 0.601 att1:level1 ## 2 mm_corrected 0.614 0.0207 0.573 0.654 att1:level1 ## 3 mm_uncorrected 0.485 0.0134 0.458 0.511 att1:level2 ## 4 mm_corrected 0.477 0.0204 0.437 0.517 att1:level2 ## 5 mm_uncorrected 0.445 0.0131 0.419 0.470 att1:level3 ## 6 mm_corrected 0.416 0.0203 0.376 0.455 att1:level3 ## 7 mm_uncorrected 0.489 0.0133 0.463 0.515 att2:level1 ## 8 mm_corrected 0.483 0.0202 0.443 0.522 att2:level1 ## 9 mm_uncorrected 0.524 0.0130 0.498 0.549 att2:level2 ## 10 mm_corrected 0.536 0.0200 0.497 0.575 att2:level2 ## # ℹ 38 more rows"},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"mm-profile-level-specific-level","dir":"Articles","previous_headings":"4.3 Estimate MMs","what":"MM (profile-level) – specific level","title":"4. Estimate corrected MMs or AMCEs","text":"However, also possible specify precise attributes, attribute levels, interest using set_qoi function . set_qoi function main way users specify complex estimands conjoint analysis. Al arguments qoi() expanded clarity, default arguments projoint() dropped simplicity:","code":"qoi_1 <- set_qoi( .structure = \"profile_level\", .estimand = \"mm\", .att_choose = \"att1\", .lev_choose = \"level1\") mm1 <- projoint(.data = out1, .qoi = qoi_1) ## Warning in projoint(.data = out1, .qoi = qoi_1): Both .qoi and .structure are ## specified; using the value from .qoi. ## Warning in projoint(.data = out1, .qoi = qoi_1): Both .qoi and .estimand are ## specified; using the value from .qoi. print(mm1) ## [A projoint output] ## Estimand: mm ## Structure: profile_level ## IRR: Estimated ## Tau: 0.1721281 ## Remove ties: TRUE ## SE methods: analytical summary(mm1) ## # A tibble: 2 × 7 ## estimand estimate se conf.low conf.high att_level_choose ## ## 1 mm_uncorrected 0.574 0.0134 0.548 0.601 att1:level1 ## 2 mm_corrected 0.614 0.0207 0.573 0.654 att1:level1 ## # ℹ 1 more variable: att_level_notchoose "},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"mm-profile-level-specific-level-using-the-predicted-irr","dir":"Articles","previous_headings":"4.3 Estimate MMs","what":"MM (profile-level) – specific level, using the predicted IRR","title":"4. Estimate corrected MMs or AMCEs","text":"conjoint survey design include recommended repeated task, can use specific value .irr, can estimate using predict_tau() function specify value based prior knowledge. following, use 0.75, likely IRR find test data sets. default arguments set_qoi() projoint() dropped hereafter.","code":"mm1b <- projoint(.data = out1, .qoi = qoi_1, .irr = 0.75) ## Warning in projoint(.data = out1, .qoi = qoi_1, .irr = 0.75): Both .qoi and ## .structure are specified; using the value from .qoi. ## Warning in projoint(.data = out1, .qoi = qoi_1, .irr = 0.75): Both .qoi and ## .estimand are specified; using the value from .qoi. print(mm1b) ## [A projoint output] ## Estimand: mm ## Structure: profile_level ## IRR: Assumed (0.75) ## Tau: 0.1464466 ## Remove ties: TRUE ## SE methods: analytical summary(mm1b) ## # A tibble: 2 × 7 ## estimand estimate se conf.low conf.high att_level_choose ## ## 1 mm_uncorrected 0.574 0.0134 0.548 0.601 att1:level1 ## 2 mm_corrected 0.605 0.0190 0.568 0.643 att1:level1 ## # ℹ 1 more variable: att_level_notchoose "},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"mm-choice-level-specific-level","dir":"Articles","previous_headings":"4.3 Estimate MMs","what":"MM (choice-level) – specific level","title":"4. Estimate corrected MMs or AMCEs","text":"soon users wish switch profile-level choice-level analysis, set_qoi function required. exponentially choice-level estimands profile-level estimands, impractical view . specify want return marginal mean attribute 1, levels 1 3 choice-level.","code":"qoi_2 <- set_qoi( .structure = \"choice_level\", .att_choose = \"att1\", .lev_choose = \"level3\", .att_notchoose = \"att1\", .lev_notchoose = \"level1\" ) mm2 <- projoint(.data = out1, .qoi = qoi_2, .structure = \"choice_level\", .ignore_position = FALSE) ## Warning in projoint(.data = out1, .qoi = qoi_2, .structure = \"choice_level\", : ## Both .qoi and .structure are specified; using the value from .qoi. ## Warning in projoint(.data = out1, .qoi = qoi_2, .structure = \"choice_level\", : ## Both .qoi and .estimand are specified; using the value from .qoi. print(mm2) ## [A projoint output] ## Estimand: mm ## Structure: choice_level ## IRR: Estimated ## Tau: 0.1721281 ## Remove ties: TRUE ## SE methods: analytical summary(mm2) ## # A tibble: 2 × 7 ## estimand estimate se conf.low conf.high att_level_choose ## ## 1 mm_uncorrected 0.402 0.0258 0.352 0.453 att1:level3 ## 2 mm_corrected 0.351 0.0408 0.271 0.431 att1:level3 ## # ℹ 1 more variable: att_level_notchoose "},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"estimate-amces","dir":"Articles","previous_headings":"","what":"4.4 Estimate AMCEs","title":"4. Estimate corrected MMs or AMCEs","text":"Note can replicate analyses using AMCE instead MM just specifying .estimand = \"amce\" rather default \"mm\".","code":""},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"amce-profile-level-all-levels","dir":"Articles","previous_headings":"4.4 Estimate AMCEs","what":"AMCE (profile-level) – all levels","title":"4. Estimate corrected MMs or AMCEs","text":"","code":"amce0 <- projoint(.data = out1, .estimand = \"amce\") print(amce0) ## [A projoint output] ## Estimand: amce ## Structure: profile_level ## IRR: Estimated ## Tau: 0.1721281 ## Remove ties: TRUE ## SE methods: analytical summary(amce0) ## # A tibble: 34 × 7 ## estimand estimate se conf.low conf.high att_level_choose ## ## 1 amce_uncorrected -0.0899 0.0190 -0.127 -0.0527 att1:level2 ## 2 amce_corrected -0.137 0.0290 -0.194 -0.0801 att1:level2 ## 3 amce_uncorrected -0.130 0.0188 -0.167 -0.0931 att1:level3 ## 4 amce_corrected -0.198 0.0294 -0.256 -0.140 att1:level3 ## 5 amce_uncorrected 0.0348 0.0186 -0.00170 0.0713 att2:level2 ## 6 amce_corrected 0.0530 0.0284 -0.00258 0.109 att2:level2 ## 7 amce_uncorrected -0.00177 0.0188 -0.0386 0.0350 att2:level3 ## 8 amce_corrected -0.00270 0.0286 -0.0589 0.0535 att2:level3 ## 9 amce_uncorrected 0.0240 0.0204 -0.0159 0.0640 att3:level2 ## 10 amce_corrected 0.0366 0.0312 -0.0246 0.0979 att3:level2 ## # ℹ 24 more rows ## # ℹ 1 more variable: att_level_choose_baseline "},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"amce-profile-level-specific-level","dir":"Articles","previous_headings":"4.4 Estimate AMCEs","what":"AMCE (profile-level) – specific level","title":"4. Estimate corrected MMs or AMCEs","text":"","code":"qoi_3 <- set_qoi( .structure = \"profile_level\", .estimand = \"amce\", .att_choose = \"att1\", .lev_choose = \"level3\", .att_choose_b = \"att1\", .lev_choose_b = \"level1\" ) amce1 <- projoint(.data = out1, .qoi = qoi_3, .estimand = \"amce\") ## Warning in projoint(.data = out1, .qoi = qoi_3, .estimand = \"amce\"): Both .qoi ## and .structure are specified; using the value from .qoi. ## Warning in projoint(.data = out1, .qoi = qoi_3, .estimand = \"amce\"): Both .qoi ## and .estimand are specified; using the value from .qoi. print(amce1) ## [A projoint output] ## Estimand: amce ## Structure: profile_level ## IRR: Estimated ## Tau: 0.1721281 ## Remove ties: TRUE ## SE methods: analytical summary(amce1) ## # A tibble: 2 × 9 ## estimand estimate se conf.low conf.high att_level_choose ## ## 1 amce_uncorrected -0.130 0.0188 -0.167 -0.0931 att1:level3 ## 2 amce_corrected -0.198 0.0294 -0.256 -0.140 att1:level3 ## # ℹ 3 more variables: att_level_notchoose , ## # att_level_choose_baseline , att_level_notchoose_baseline "},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"amce-profile-level-specific-level-using-the-predicted-irr","dir":"Articles","previous_headings":"4.4 Estimate AMCEs","what":"AMCE (profile-level) – specific level, using the predicted IRR","title":"4. Estimate corrected MMs or AMCEs","text":"","code":"amce1b <- projoint(.data = out1, .qoi = qoi_3, .estimand = \"amce\", .irr = 0.75) ## Warning in projoint(.data = out1, .qoi = qoi_3, .estimand = \"amce\", .irr = ## 0.75): Both .qoi and .structure are specified; using the value from .qoi. ## Warning in projoint(.data = out1, .qoi = qoi_3, .estimand = \"amce\", .irr = ## 0.75): Both .qoi and .estimand are specified; using the value from .qoi. print(amce1b) ## [A projoint output] ## Estimand: amce ## Structure: profile_level ## IRR: Assumed (0.75) ## Tau: 0.1464466 ## Remove ties: TRUE ## SE methods: analytical summary(amce1b) ## # A tibble: 2 × 9 ## estimand estimate se conf.low conf.high att_level_choose ## ## 1 amce_uncorrected -0.130 0.0188 -0.167 -0.0931 att1:level3 ## 2 amce_corrected -0.184 0.0266 -0.236 -0.132 att1:level3 ## # ℹ 3 more variables: att_level_notchoose , ## # att_level_choose_baseline , att_level_notchoose_baseline "},{"path":"https://yhoriuchi.github.io/projoint/articles/04-estimate.html","id":"amce-choice-level-specific-level","dir":"Articles","previous_headings":"4.4 Estimate AMCEs","what":"AMCE (choice-level) – specific level","title":"4. Estimate corrected MMs or AMCEs","text":"","code":"qoi_4 <- set_qoi( .structure = \"choice_level\", .estimand = \"amce\", .att_choose = \"att1\", .lev_choose = \"level3\", .att_notchoose = \"att1\", .lev_notchoose = \"level1\", .att_choose_b = \"att1\", .lev_choose_b = \"level2\", .att_notchoose_b = \"att1\", .lev_notchoose_b = \"level1\" ) amce2 <- projoint(.data = out1, .qoi = qoi_4, .structure = \"choice_level\", .estimand = \"amce\", .ignore_position = TRUE) ## Warning in projoint(.data = out1, .qoi = qoi_4, .structure = \"choice_level\", : ## Both .qoi and .structure are specified; using the value from .qoi. ## Warning in projoint(.data = out1, .qoi = qoi_4, .structure = \"choice_level\", : ## Both .qoi and .estimand are specified; using the value from .qoi. print(amce2) ## [A projoint output] ## Estimand: amce ## Structure: choice_level ## IRR: Estimated ## Tau: 0.1721281 ## Remove ties: TRUE ## SE methods: analytical summary(amce2) ## # A tibble: 2 × 9 ## estimand estimate se conf.low conf.high att_level_choose ## ## 1 amce_uncorrected -0.0484 0.0270 -0.101 0.00448 att1:level3 ## 2 amce_corrected -0.0739 0.0414 -0.155 0.00727 att1:level3 ## # ℹ 3 more variables: att_level_notchoose , ## # att_level_choose_baseline , att_level_notchoose_baseline "},{"path":"https://yhoriuchi.github.io/projoint/articles/05-visualize.html","id":"load-the-projoint-package-and-the-other-necessary-package","dir":"Articles","previous_headings":"","what":"5.1 Load the projoint package and the other necessary package","title":"5. Visualize MMs or AMCEs","text":"","code":"library(projoint) library(ggplot2)"},{"path":[]},{"path":"https://yhoriuchi.github.io/projoint/articles/05-visualize.html","id":"estimate-mms-and-amces-","dir":"Articles","previous_headings":"5.2 Profile-level analysis","what":"Estimate MMs and AMCEs.","title":"5. Visualize MMs or AMCEs","text":"","code":"mm <- projoint(out1_arranged) amce <- projoint(out1_arranged, .estimand = \"amce\")"},{"path":"https://yhoriuchi.github.io/projoint/articles/05-visualize.html","id":"visualize-mms-and-amces","dir":"Articles","previous_headings":"5.2 Profile-level analysis","what":"Visualize MMs and AMCEs","title":"5. Visualize MMs or AMCEs","text":"default, researchers prefer view corrected estimates either MMs AMCEs. Researchers can, however, choose instead visualize uncorrected estimates, view together.","code":"plot(mm) plot(mm, .estimates = \"uncorrected\") plot(mm, .estimates = \"both\") plot(amce) plot(amce, .estimates = \"uncorrected\") plot(amce, .estimates = \"both\")"},{"path":"https://yhoriuchi.github.io/projoint/articles/05-visualize.html","id":"choice-level-analysis","dir":"Articles","previous_headings":"","what":"5.3 Choice-level analysis","title":"5. Visualize MMs or AMCEs","text":"undertake choice-level analysis, first need specify quantity interest using set_qoi(). can estimate choice-level marginal means: Since many estimates, encourage make plots based objectives research. default plot choice-level marginal means basic ggplot object, compares marginal mean two options. sum two percentages 100, thus may think redundant information presented figure. think figure effective way show results head--head (choice-level) comparison. can polish adding layers : Note: current version projoint package function plot choice-level average marginal component effects. Stay tuned!","code":"qoi_mm <- set_qoi(.structure = \"choice_level\", .att_choose = \"att1\", .lev_choose = \"level1\", .att_notchoose = \"att1\", .lev_notchoose = \"level3\") choice_mm <- projoint(.data = out1_arranged, .structure = \"choice_level\", .qoi = qoi_mm, .ignore_position = TRUE) ## Warning in projoint(.data = out1_arranged, .structure = \"choice_level\", : Both ## .qoi and .structure are specified; using the value from .qoi. ## Warning in projoint(.data = out1_arranged, .structure = \"choice_level\", : Both ## .qoi and .estimand are specified; using the value from .qoi. print(choice_mm) ## [A projoint output] ## Estimand: mm ## Structure: choice_level ## IRR: Estimated ## Tau: 0.1721281 ## Remove ties: TRUE ## SE methods: analytical summary(choice_mm) ## # A tibble: 2 × 7 ## estimand estimate se conf.low conf.high att_level_choose ## ## 1 mm_uncorrected 0.581 0.0187 0.544 0.618 att1:level1 ## 2 mm_corrected 0.624 0.0288 0.567 0.680 att1:level1 ## # ℹ 1 more variable: att_level_notchoose plot(choice_mm) plot(choice_mm, .labels = c(\"15% of pre-tax income\", \"30% of pre-tax income\")) + labs(y = \"Marginal mean\", x = \"Housing Cost\") + coord_cartesian(ylim = c(0, 1)) + geom_hline(yintercept = 0.5, linetype = \"dashed\", color = \"darkgray\")"},{"path":"https://yhoriuchi.github.io/projoint/articles/06-compare.html","id":"load-the-projoint-package-","dir":"Articles","previous_headings":"","what":"6.1 Load the projoint package.","title":"6. Compare MMs or AMCEs between the subgroups","text":"Also load additional packages required vignette","code":"library(projoint) library(dplyr) library(ggplot2)"},{"path":[]},{"path":"https://yhoriuchi.github.io/projoint/articles/06-compare.html","id":"read-and-wrangle-data","dir":"Articles","previous_headings":"6.2 Profile-level analysis","what":"Read and Wrangle data","title":"6. Compare MMs or AMCEs between the subgroups","text":"begin, define outcome questions original dataset. Let’s make three data frames – first data frame baseline group (example, respondents report race “white”); second data frame comparison group (example, respondents reported race “white”), third data frame groups. Note .covariates argument specified reshape_conjoint() function third group. , add re-order labels (see 2.3 Arrange order labels attributes levels).","code":"outcomes <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes <- c(outcomes, \"choice1_repeated_flipped\") # Pre-processing df <- exampleData1 %>% mutate(white = ifelse(race == \"White\", 1, 0)) df_0 <- df %>% filter(white == 0) %>% reshape_projoint(.idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE) df_1 <- df %>% filter(white == 1) %>% reshape_projoint(.idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE) df_d <- df %>% reshape_projoint(.idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE, .covariates = \"white\") df_0 <- read_labels(df_0, \"temp/labels_arranged.csv\") df_1 <- read_labels(df_1, \"temp/labels_arranged.csv\") df_d <- read_labels(df_d, \"temp/labels_arranged.csv\")"},{"path":"https://yhoriuchi.github.io/projoint/articles/06-compare.html","id":"estimate-mms-or-amces-and-the-difference-in-the-estimates","dir":"Articles","previous_headings":"6.2 Profile-level analysis","what":"Estimate MMs or AMCEs and the difference in the estimates","title":"6. Compare MMs or AMCEs between the subgroups","text":"three data frames, estimate MMs, AMCEs, differences estimates. following example estimate profile-level marginal means (default). Importantly, conjoint design includes repeated task, projoint() function applied subgroup estimate IRR corresponding subgroup. output out_d includes data differences can also check tau subgroup: , make save three ggplot objects.","code":"out_0 <- projoint(df_0) out_1 <- projoint(df_1) out_d <- projoint(df_d, .by_var = \"white\") out_d@estimates ## # A tibble: 48 × 11 ## estimand att_level_choose estimate_1 se_1 tau estimate_0 se_0 estimate ## ## 1 mm_uncor… att1:level1 0.586 0.0157 0.158 0.545 0.0258 0.0401 ## 2 mm_corre… att1:level1 0.625 0.0236 0.158 0.579 0.0433 0.0464 ## 3 mm_uncor… att1:level2 0.480 0.0158 0.158 0.496 0.0250 -0.0163 ## 4 mm_corre… att1:level2 0.471 0.0233 0.158 0.494 0.0432 -0.0229 ## 5 mm_uncor… att1:level3 0.439 0.0153 0.158 0.460 0.0254 -0.0210 ## 6 mm_corre… att1:level3 0.411 0.0227 0.158 0.431 0.0446 -0.0200 ## 7 mm_uncor… att2:level1 0.529 0.0154 0.158 0.510 0.0245 0.0195 ## 8 mm_corre… att2:level1 0.543 0.0226 0.158 0.517 0.0425 0.0260 ## 9 mm_uncor… att2:level2 0.500 0.0157 0.158 0.461 0.0248 0.0394 ## 10 mm_corre… att2:level2 0.500 0.0230 0.158 0.432 0.0417 0.0683 ## # ℹ 38 more rows ## # ℹ 3 more variables: se , conf.low , conf.high out_d@tau ## tau1 tau0 ## 1 0.1582662 0.2113249 plot_0 <- plot(out_0) plot_1 <- plot(out_1) plot_d <- plot(out_d, .by_var = TRUE)"},{"path":"https://yhoriuchi.github.io/projoint/articles/06-compare.html","id":"visualize-subgroup-differences","dir":"Articles","previous_headings":"6.2 Profile-level analysis","what":"Visualize subgroup differences","title":"6. Compare MMs or AMCEs between the subgroups","text":", make plot using patchwork package. Researchers can add/modify layers ggplot. default horizontal axis label “Difference” .by_var = TRUE specified plot() function.","code":"g_0 <- plot_0 + coord_cartesian(xlim = c(0.2, 0.8)) + scale_x_continuous(breaks = c(0.3, 0.5, 0.7)) + theme(plot.title = element_text(hjust = 0.5)) + labs(title = \"Non-white\", x = \"AMCE\") g_1 <- plot_1 + coord_cartesian(xlim = c(0.2, 0.8)) + scale_x_continuous(breaks = c(0.3, 0.5, 0.7)) + theme(axis.text.y = element_blank(), plot.title = element_text(hjust = 0.5)) + labs(title = \"White\", x = \"AMCE\") g_d <- plot_d + coord_cartesian(xlim = c(-0.4, 0.4)) + scale_x_continuous(breaks = c(-0.25, 0, 0.25)) + theme(axis.text.y = element_blank(), plot.title = element_text(hjust = 0.5)) + labs(title = \"Difference\") library(patchwork) g_0 + g_1 + g_d"},{"path":"https://yhoriuchi.github.io/projoint/articles/06-compare.html","id":"choice-level-analysis","dir":"Articles","previous_headings":"","what":"6.3 Choice-level analysis","title":"6. Compare MMs or AMCEs between the subgroups","text":"encourage users package make custom figures based estimates choice-level analysis. following just one example.","code":"df_D <- exampleData1 %>% filter(party_1 == \"Democrat\") %>% reshape_projoint(.idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE) df_R <- exampleData1 %>% filter(party_1 == \"Republican\") %>% reshape_projoint(.idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE) df_0 <- exampleData1 %>% filter(party_1 %in% c(\"Something else\", \"Independent\")) %>% reshape_projoint(.idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE) qoi <- set_qoi( .structure = \"choice_level\", .estimand = \"mm\", .att_choose = \"att2\", # Presidential Vote (2020) .lev_choose = \"level3\", # 70% Democrat, 30% Republican .att_notchoose = \"att2\", .lev_notchoose = \"level1\", # 30% Democrat, 70% Republican ) out_D <- projoint(df_D, qoi, .structure = \"choice_level\", .ignore_position = TRUE) ## Warning in projoint(df_D, qoi, .structure = \"choice_level\", .ignore_position = ## TRUE): Both .qoi and .structure are specified; using the value from .qoi. ## Warning in projoint(df_D, qoi, .structure = \"choice_level\", .ignore_position = ## TRUE): Both .qoi and .estimand are specified; using the value from .qoi. out_R <- projoint(df_R, qoi, .structure = \"choice_level\", .ignore_position = TRUE) ## Warning in projoint(df_R, qoi, .structure = \"choice_level\", .ignore_position = ## TRUE): Both .qoi and .structure are specified; using the value from .qoi. ## Warning in projoint(df_R, qoi, .structure = \"choice_level\", .ignore_position = ## TRUE): Both .qoi and .estimand are specified; using the value from .qoi. out_0 <- projoint(df_0, qoi, .structure = \"choice_level\", .ignore_position = TRUE) ## Warning in projoint(df_0, qoi, .structure = \"choice_level\", .ignore_position = ## TRUE): Both .qoi and .structure are specified; using the value from .qoi. ## Warning in projoint(df_0, qoi, .structure = \"choice_level\", .ignore_position = ## TRUE): Both .qoi and .estimand are specified; using the value from .qoi. out_merged <- bind_rows( out_D@estimates %>% mutate(party = \"Democrat\"), out_R@estimates %>% mutate(party = \"Republican\"), out_0@estimates %>% mutate(party = \"Independent\") ) %>% filter(estimand == \"mm_corrected\") ggplot(out_merged, aes(y = party, x = estimate)) + geom_vline(xintercept = 0.5, linetype = \"dashed\", color = \"gray\") + geom_pointrange(aes(xmin = conf.low, xmax = conf.high)) + geom_text(aes(label = format(round(estimate, digits = 2), nsmall = 2)), vjust = -1) + labs(y = NULL, x = \"Choice-level marginal mean\", title = \"Choose an area with 70% Democrat\\n as opposed to an area with 30% Democrat\") + theme_classic()"},{"path":"https://yhoriuchi.github.io/projoint/articles/07-explore.html","id":"load-the-projoint-package-and-the-other-necessary-package","dir":"Articles","previous_headings":"","what":"7.1 Load the projoint package and the other necessary package","title":"7. Explore further","text":"previous articles, use already wrangled cleaned data named “out1_reshaped.” see attribute IDs level IDs means, can type:","code":"library(projoint) library(ggplot2) out1_arranged@labels ## # A tibble: 24 × 4 ## attribute level attribute_id level_id ## ## 1 Housing Cost 15% of pre-tax income att1 att1:leve… ## 2 Housing Cost 30% of pre-tax income att1 att1:leve… ## 3 Housing Cost 40% of pre-tax income att1 att1:leve… ## 4 Presidential Vote (2020) 50% Democrat, 50% Republican att2 att2:leve… ## 5 Presidential Vote (2020) 30% Democrat, 70% Republican att2 att2:leve… ## 6 Presidential Vote (2020) 70% Democrat, 30% Republican att2 att2:leve… ## 7 Racial Composition 50% White, 50% Nonwhite att3 att3:leve… ## 8 Racial Composition 75% White, 25% Nonwhite att3 att3:leve… ## 9 Racial Composition 90% White, 10% Nonwhite att3 att3:leve… ## 10 Racial Composition 96% White, 4% Nonwhite att3 att3:leve… ## # ℹ 14 more rows"},{"path":"https://yhoriuchi.github.io/projoint/articles/07-explore.html","id":"examine-trade-offs","dir":"Articles","previous_headings":"","what":"7.1 Examine trade-offs","title":"7. Explore further","text":"may interested people make choice face trade-options. example, one hand, may want live inexpensive house. hand, may prefer avoid living area high crime rate. two options prefer? can compare two options directly. customization figure, see Visualize MMs AMCEs, Choice-level analysis","code":"qoi_1 <- set_qoi( .structure = \"choice_level\", .att_choose = \"att1\", .lev_choose = \"level1\", .att_notchoose = \"att6\", .lev_notchoose = \"level2\" ) mm1 <- projoint(.data = out1_arranged, .qoi = qoi_1, .structure = \"choice_level\", .ignore_position = TRUE) ## Warning in projoint(.data = out1_arranged, .qoi = qoi_1, .structure = ## \"choice_level\", : Both .qoi and .structure are specified; using the value from ## .qoi. ## Warning in projoint(.data = out1_arranged, .qoi = qoi_1, .structure = ## \"choice_level\", : Both .qoi and .estimand are specified; using the value from ## .qoi. plot(mm1, .labels = c(\"Housing Cost\\n(15% of pre-tax income)\", \"Violent Crime Rate\\n(20% > National Average)\")) + labs(y = \"Marginal mean\", x = NULL) + coord_cartesian(ylim = c(0, 1)) + geom_hline(yintercept = 0.5, linetype = \"dashed\", color = \"darkgray\")"},{"path":"https://yhoriuchi.github.io/projoint/articles/07-explore.html","id":"set-multiple-levels-for-the-attribute-of-interest","dir":"Articles","previous_headings":"","what":"6.1 Set multiple levels for the attribute of interest","title":"7. Explore further","text":"may interested measuring marginal means choosing one level. example, may want estimate marginal mean choosing “City, residential area” “City, downtown area” opposed “Suburban, houses” “Suburban, downtown area”. , can run following code:","code":"qoi_2 <- set_qoi( .structure = \"choice_level\", .att_choose = \"att7\", .lev_choose = c(\"level2\", \"level3\"), .att_notchoose = \"att7\", .lev_notchoose = c(\"level5\", \"level6\") ) mm2 <- projoint(.data = out1_arranged, .qoi = qoi_2, .structure = \"choice_level\", .ignore_position = TRUE) ## Warning in projoint(.data = out1_arranged, .qoi = qoi_2, .structure = ## \"choice_level\", : Both .qoi and .structure are specified; using the value from ## .qoi. ## Warning in projoint(.data = out1_arranged, .qoi = qoi_2, .structure = ## \"choice_level\", : Both .qoi and .estimand are specified; using the value from ## .qoi. plot(mm2, .labels = c(\"City\", \"Suburban\")) + labs(y = \"Marginal mean\", x = \"Type of place\") + coord_cartesian(ylim = c(0, 1)) + geom_hline(yintercept = 0.5, linetype = \"dashed\", color = \"darkgray\")"},{"path":"https://yhoriuchi.github.io/projoint/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Yusaku Horiuchi. Author, maintainer. Aaron Kaufman. Author.","code":""},{"path":"https://yhoriuchi.github.io/projoint/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Katherine Clayton, Yusaku Horiuchi, Aaron R. Kaufman, Gary King, Mayya Komisarchik (2023). Correcting Measurement Error Bias Conjoint Survey Experiments. Working Paper. URL https://gking.harvard.edu/files/gking/files/conerr.pdf Yusaku Horiuchi Aaron R. Kaufman (2023). projoint: One Stop Conjoint Shop. URL https://github.com/yhoriuchi/projoint","code":"@Article{, title = {Correcting Measurement Error Bias in Conjoint Survey Experiments}, author = {Katherine Clayton and Yusaku Horiuchi and Aaron Kaufman and Gary King and Mayya Komisarchik}, journal = {Working Paper}, year = {2023}, url = {https://gking.harvard.edu/files/gking/files/conerr.pdf}, } @Misc{, title = {projoint: The One Stop Conjoint Shop}, author = {Yusaku Horiuchi and Aaron Kaufman}, year = {2023}, publisher = {GitHub repository}, url = {https://github.com/yhoriuchi/projoint}, }"},{"path":[]},{"path":[]},{"path":"https://yhoriuchi.github.io/projoint/index.html","id":"the-one-stop-conjoint-shop","dir":"","previous_headings":"","what":"The One-Stop Conjoint Shop","title":"The One Stop Conjoint Shop","text":"projoint package general, straightforward, creative conjoint analysis. estimates—either profile-level choice-level—Marginal Means (MMs) Average Marginal Component Effects (AMCEs) based conjoint survey experiment. produces reliable estimates correcting measurement error bias problems known literature (e.g., levels attribute interest). Furthermore, presents general framework researchers can answer range substantively important questions straightforwardly. notes: current version assumes outcome variable binary forced choice. package still construction. Forthcoming features include following: Allow researchers use weights features respondents. Allow researchers use outcome variables, rating.","code":""},{"path":"https://yhoriuchi.github.io/projoint/index.html","id":"installation","dir":"","previous_headings":"The One-Stop Conjoint Shop","what":"Installation","title":"The One Stop Conjoint Shop","text":"can install development version projoint GitHub :","code":"# install.packages(\"devtools\") devtools::install_github(\"yhoriuchi/projoint\")"},{"path":"https://yhoriuchi.github.io/projoint/index.html","id":"why-projoint","dir":"","previous_headings":"The One-Stop Conjoint Shop","what":"Why projoint?","title":"The One Stop Conjoint Shop","text":"excellent R packages conjoint analysis, including cjoint (Version: 2.1.0, Published: 2018-10-19) cregg (Version: 0.4.0, Published: 2020-06-28). important advantages using package: importantly, unlike packages, researchers can fix measurement error bias (Clayton et al., working paper). cjoint cregg packages assume unit analysis profile even researchers design binary choice experiment. define straightforward choice-level MMs AMCEs allow users estimate (Clayton et al., working paper). profile-level MMs (cregg) always attenuated toward 0.5 conjoint design includes “ties” attribute interest (Gander 2021). Consider, example, attribute interest candidate’s party, two levels, {Republican, Democrat}. levels randomly assigned profile, 50% profile pairs include ties. Therefore, even strongly partisan respondents care candidate’s party always prefer one party another, choose one two tied profiles randomly. Therefore, (profile-level) marginal mean Republican Republican supporters Democrat Democrat supporters 0.75 (= 1 * 0.5 + 0.5 * 0.5). remove ties calculate MMs. profile-level AMCEs (cjoint) may produce counter-intuitive estimates (Abramson, Kocak, Magazinni, Strezhnev, working paper). example, suppose attribute interest candidate’s race, three levels, {white, Black, Asian American}. Specifically, interested whether white respondents prefer Black Asian American candidate. case head--head comparison, suppose 75% white respondents choose Black candidate rather Asian American candidate. (example choice-level marginal mean.) profile-level AMCE choosing Black candidate using Asian American candidate baseline may larger smaller 75%, surprisingly. AMCE’s calculation includes indirect comparisons combinations. set assumptions, profile-level AMCEs can still researchers’ substantive quantities interest (Bansak, Hainmueller, Hopkins, Yamamoto, forthcoming) quantities interest applied researchers. Therefore, provide option estimate alternative intuitive quantities interest, choice-level MMs AMCEs. Researchers often assume profile within profile pair needs independent. critical assumption conjoint analysis. fact, researchers consider variety research questions cross-profile (note: cross-attribute) constraints, profile pair one incumbent one challenger, profile pair sum values one (e.g., expected chance winning seat two candidates), profile pair one column fixed (e.g., show status quo reference). framework software allow researchers examine variety questions flexible innovative manners. Last least, package provides easiest possible way re-label re-order attributes levels.","code":""},{"path":"https://yhoriuchi.github.io/projoint/index.html","id":"relevant-article","dir":"","previous_headings":"The One-Stop Conjoint Shop","what":"Relevant Article","title":"The One Stop Conjoint Shop","text":"framework methods, please read cite following article: Abstract: Conjoint survey designs spreading across social sciences due unusual capacity estimate many causal effects single randomized experiment. Unfortunately, ability mirror complicated real-world choices, designs often generate substantial measurement errors thus bias. replicate data collection analysis eight prominent conjoint studies, closely reproduce published results, show large proportion observed variation answers conjoint questions effectively random noise. discover common empirical pattern measurement error appears conjoint studies , , introduce easy--use statistical method correct bias.","code":""},{"path":"https://yhoriuchi.github.io/projoint/index.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"The One Stop Conjoint Shop","text":"Please note project released Contributor Code Conduct. contributing project, agree abide terms.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData1.html","id":null,"dir":"Reference","previous_headings":"","what":"Projoint Example Data Set 1: Building Conjoint with a Repeated, Flipped Task — exampleData1","title":"Projoint Example Data Set 1: Building Conjoint with a Repeated, Flipped Task — exampleData1","text":"cleaned Qualtrics output conjoint study compares two potential new building developments. 8 standard tasks well repeat first task, used calculate response instability.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData1.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Projoint Example Data Set 1: Building Conjoint with a Repeated, Flipped Task — exampleData1","text":"","code":"exampleData1"},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData1.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Projoint Example Data Set 1: Building Conjoint with a Repeated, Flipped Task — exampleData1","text":"## `exampleData1` data frame 201 rows 186 columns: ResponseId Unique respondent ID race Respondent race: 6 categories party_1 Respondent party: Democrat, Republican, Independent, Something else party_2 party_1 D R: closer Democrats closer Republicans? party_3 party_1 R: strong R strong R party_4 party_1 D: strong D strong D ideology Respondent ideology Extremely liberal Extremely conservative honesty Attention check: respondents select \"never\" choice1, choice2, ..., choice8 Respondent selections initial 8 conjoint tasks choice1_repeated_flipped Respondent choice task repeats choice1 flipped","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData1.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Projoint Example Data Set 1: Building Conjoint with a Repeated, Flipped Task — exampleData1","text":"Qualtrics Prolific; see Clayton et al. replication materials.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData1_labelled_tibble.html","id":null,"dir":"Reference","previous_headings":"","what":"Projoint Example Data Set 1: ","title":"Projoint Example Data Set 1: ","text":"already cleaned data frame (tibble) attribute corresponds column proper attribute name. unit observation must unit observation must two profiles task respondent.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData1_labelled_tibble.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Projoint Example Data Set 1: ","text":"","code":"exampleData1_labelled_tibble"},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData1_labelled_tibble.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Projoint Example Data Set 1: ","text":"## `exampleData1_labelled_tibble` data frame 6,400 rows 14 columns: id Unique respondent ID task Task number profile Profile number = 1,2 selected Whether profile selected selected_repeated Whether profile selected repeated task School Quality, ... Type Place attributes race Respondent race: 6 categories ideology Respondent ideology Extremely liberal Extremely conservative","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData1_labelled_tibble.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Projoint Example Data Set 1: ","text":"Qualtrics Prolific; see Clayton et al. replication materials.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData2.html","id":null,"dir":"Reference","previous_headings":"","what":"Projoint Example Data Set 2: Building Conjoint with a Repeated, Unflipped Task — exampleData2","title":"Projoint Example Data Set 2: Building Conjoint with a Repeated, Unflipped Task — exampleData2","text":"cleaned Qualtrics output conjoint study compares two potential new building developments. 8 standard tasks well repeat first task, used calculate response instability.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Projoint Example Data Set 2: Building Conjoint with a Repeated, Unflipped Task — exampleData2","text":"","code":"exampleData2"},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData2.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Projoint Example Data Set 2: Building Conjoint with a Repeated, Unflipped Task — exampleData2","text":"## `exampleData2` data frame 199 rows 186 columns: ResponseId Unique respondent ID choice1, choice2, ..., choice8 Respondent selections initial 8 conjoint tasks choice1_repeated_notflipped Respondent choice task repeats choice1, unflipped race Respondent race: 5 categories party1 Respondent party party2 party1 D R: closer Democrats closer Republicans? party3 party1 R: strong R strong R party4 party1 D: strong D strong D ideology Respondent ideology Extremely liberal Extremely conservative honesty Attention check: respondents select \"never\" K-1-1, K-1-2, ..., K-8-5 K-X-Y indicates name attribute Yth position table Xth task K-1-1-1, K-1-1-2, ..., K-8-2-7 K-X-Y-Z indicates value attribute Zth position Yth profile (either 1 2 left right profiles) Xth task","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData2.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Projoint Example Data Set 2: Building Conjoint with a Repeated, Unflipped Task — exampleData2","text":"Qualtrics Prolific; see Clayton et al. replication materials.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData3.html","id":null,"dir":"Reference","previous_headings":"","what":"Projoint Example Data Set 3: Building Conjoint without a Repeated Task — exampleData3","title":"Projoint Example Data Set 3: Building Conjoint without a Repeated Task — exampleData3","text":"cleaned Qualtrics output conjoint study compares two potential new building developments. 8 standard tasks.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData3.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Projoint Example Data Set 3: Building Conjoint without a Repeated Task — exampleData3","text":"","code":"exampleData3"},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData3.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Projoint Example Data Set 3: Building Conjoint without a Repeated Task — exampleData3","text":"## `exampleData3` data frame 201 rows 185 columns: ResponseId Unique respondent ID choice1, choice2, ..., choice8 Respondent selections initial 8 conjoint tasks race Respondent race: 5 categories party1 Respondent party party2 party1 D R: closer Democrats closer Republicans? party3 party1 R: strong R strong R party4 party1 D: strong D strong D ideology Respondent ideology Extremely liberal Extremely conservative honesty Attention check: respondents select \"never\" K-1-1, K-1-2, ..., K-8-5 K-X-Y indicates name attribute Yth position table Xth task K-1-1-1, K-1-1-2, ..., K-8-2-7 K-X-Y-Z indicates value attribute Zth position Yth profile (either 1 2 left right profiles) Xth task","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/exampleData3.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Projoint Example Data Set 3: Building Conjoint without a Repeated Task — exampleData3","text":"Qualtrics Prolific; see Clayton et al. replication materials.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/make_projoint_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Make a projoint_data object using a labelled tibble (data frame) — make_projoint_data","title":"Make a projoint_data object using a labelled tibble (data frame) — make_projoint_data","text":"function converts labelled tibble (data frame) \"projoint_data\" class object necessary projoint.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/make_projoint_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make a projoint_data object using a labelled tibble (data frame) — make_projoint_data","text":"","code":"make_projoint_data( .dataframe, .attribute_vars, .id_var = \"id\", .task_var = \"task\", .profile_var = \"profile\", .selected_var = \"selected\", .selected_repeated_var = NULL, .fill = FALSE )"},{"path":"https://yhoriuchi.github.io/projoint/reference/make_projoint_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make a projoint_data object using a labelled tibble (data frame) — make_projoint_data","text":".dataframe data frame. unit observation must two profiles task respondent. .attribute_vars character vector identifying names attributes .id_var character identifying name column containing respondent IDs (default: \"id\") .task_var character identifying name column containing task numbers (default: \"task\") .profile_var character identifying name column containing profile numbers IDs (default: \"profile\") .selected_var character identifying name column containing dichotomous response (0, 1) task (default: \"selected\") .selected_repeated_var character identifying name column containing dichotomous response (0, 1) repeated task (default: NULL) .fill logical vector: TRUE want use information whether respondent chose profile repeated task \"fill\" (using `tidyr` package) missing values non-repeated tasks, FALSE (otherwise). number respondents small, number specific profile pairs interest small, /number specific respondent subgroups want study small, worth changing option TRUE. please note `.fill = TRUE` based assumption IRR independent information contained conjoint tables. Although empirical tests suggest validity assumption, unsure , better use default value (FALSE).","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/make_projoint_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make a projoint_data object using a labelled tibble (data frame) — make_projoint_data","text":"projoint object class projoint_data ready pass projoint.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/organize_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Organize data before estimation — organize_data","title":"Organize data before estimation — organize_data","text":"function converts full conjoint data set data set structured analyzing specific attribute interest specific level(s) interest. function receives input reshape_data() output feeds pj_estimate().","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/organize_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Organize data before estimation — organize_data","text":"","code":"organize_data( .dataframe, .structure, .estimand, .remove_ties, .att_choose, .lev_choose, .att_notchoose, .lev_notchoose )"},{"path":"https://yhoriuchi.github.io/projoint/reference/organize_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Organize data before estimation — organize_data","text":".dataframe data frame reorganize -- second element list generated reshape_conjoint() .structure either \"choice_level\" \"profile_level\" .remove_ties TRUE want remove ties attribute interest (profile-level analysis) .att_choose character column name identifying attribute interest (.e., attribute-level attribute-levels *chosen*). .lev_choose character vector identifying level levels interest (.e., attribute-level attribute-levels *chosen*). length 1 profile-level analysis 1+ choice-level analysis .att_notchoose character column name identifying attribute interest (.e., attribute-level attribute-levels *chosen*). argument specified `.structure` argument \"choice-level\". .lev_notchoose character vector identifying level levels interest (.e., attribute-level attribute-levels *chosen*). length 1 profile-level analysis 1+ choice-level analysis. argument specified `.structure` argument \"choice-level\".","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/out1_arranged.html","id":null,"dir":"Reference","previous_headings":"","what":"Reorganized Projoint Example Data Set 1 — out1_arranged","title":"Reorganized Projoint Example Data Set 1 — out1_arranged","text":"data set identical Example Data Set 1, except attributes levels manually relabeled reordered using save_labels read_labels. Please see https://yhoriuchi.github.io/projoint/articles/02-wrangle.html instructions manually relabeling.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/out1_arranged.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reorganized Projoint Example Data Set 1 — out1_arranged","text":"","code":"out1_arranged"},{"path":"https://yhoriuchi.github.io/projoint/reference/out1_arranged.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Reorganized Projoint Example Data Set 1 — out1_arranged","text":"## `out1_arranged` data frame 201 rows 186 columns: ResponseId Unique respondent ID race Respondent race: 6 categories party_1 Respondent party: Democrat, Republican, Independent, Something else party_2 party_1 D R: closer Democrats closer Republicans? party_3 party_1 R: strong R strong R party_4 party_1 D: strong D strong D ideology Respondent ideology Extremely liberal Extremely conservative honesty Attention check: respondents select \"never\" choice1, choice2, ..., choice8 Respondent selections initial 8 conjoint tasks choice1_repeated_flipped Respondent choice task repeats choice1 flipped","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/out1_arranged.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Reorganized Projoint Example Data Set 1 — out1_arranged","text":"Qualtrics Prolific; see Clayton et al. replication materials.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/pj_estimate.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate and correct MMs or AMCEs — pj_estimate","title":"Estimate and correct MMs or AMCEs — pj_estimate","text":"internal function used calculate correct marginal means average marginal component effects conjoint design.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/pj_estimate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate and correct MMs or AMCEs — pj_estimate","text":"","code":"pj_estimate( .data, .structure = \"profile_level\", .estimand = \"mm\", .att_choose, .lev_choose, .att_notchoose = NULL, .lev_notchoose = NULL, .att_choose_b = NULL, .lev_choose_b = NULL, .att_notchoose_b = NULL, .lev_notchoose_b = NULL, .se_method = \"analytical\", .irr = NULL, .remove_ties = TRUE, .ignore_position = NULL, .n_sims = NULL, .n_boot = NULL, .weights_1 = NULL, .clusters_1 = NULL, .se_type_1 = \"classical\", .weights_2 = NULL, .clusters_2 = NULL, .se_type_2 = \"classical\" )"},{"path":"https://yhoriuchi.github.io/projoint/reference/pj_estimate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate and correct MMs or AMCEs — pj_estimate","text":".data projoint_data object .structure Either \"profile_level\" (default) \"choice_level\" .estimand Either \"mm\" marginal mean \"amce\" average marginal component effect .att_choose character column name identifying attribute interest (.e., attribute-level attribute-levels chosen). .lev_choose character vector identifying level levels interest (.e., attribute-level attribute-levels chosen). length 1 profile-level analysis 1+ choice-level analysis .att_notchoose character column name identifying attribute interest (.e., attribute-level attribute-levels chosen). argument specified .structure argument \"choice-level\". .lev_notchoose character vector identifying level levels interest (.e., attribute-level attribute-levels chosen). length 1 profile-level analysis 1+ choice-level analysis. argument specified .structure argument \"choice-level\". .att_choose_b [baseline AMCE] character column name identifying attribute interest (.e., attribute-level attribute-levels chosen). .lev_choose_b [baseline AMCE] character vector identifying level levels interest (.e., attribute-level attribute-levels chosen). length 1 profile-level analysis 1+ choice-level analysis .att_notchoose_b [baseline AMCE] character column name identifying attribute interest (.e., attribute-level attribute-levels chosen*). argument specified .structure argument \"choice-level\". .lev_notchoose_b [baseline AMCE] character vector identifying level levels interest (.e., attribute-level attribute-levels chosen). length 1 profile-level analysis 1+ choice-level analysis. argument specified .structure argument \"choice-level\". .se_method default, c(\"analytic\", \"simulation\", \"bootstrap\") description .irr NULL (default) IRR calculated using repeated task. Otherwise, numerical value .remove_ties Logical: ties removed estimation? Defaults TRUE. .ignore_position TRUE (default) ignore location profile (left right). Relevant analyzed choice level .n_sims number simulations. Relevant .se_method == \"simulation\" .n_boot number bootstrapped samples. Relevant .se_method == \"bootstrap\" .weights_1 weight estimate IRR (see lm_robust): NULL (default) .clusters_1 clusters estimate IRR (see lm_robust): NULL (default) .se_type_1 standard error type estimate IRR (see lm_robust): \"classical\" (default) .weights_2 weight estimate MM AMCE (see lm_robust): NULL (default) .clusters_2 clusters estimate MM AMCE (see lm_robust): NULL (default) .se_type_2 standard error type estimate MM AMCE (see lm_robust): \"classical\" (default)","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/pj_estimate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate and correct MMs or AMCEs — pj_estimate","text":"data frame estimates","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/plot.projoint_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot all MMs or AMCEs — plot.projoint_results","title":"Plot all MMs or AMCEs — plot.projoint_results","text":"method produces MM AMCE plots given projoint_results object, output projoint function.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/plot.projoint_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot all MMs or AMCEs — plot.projoint_results","text":"","code":"# S3 method for projoint_results plot( x, .estimates = \"corrected\", .by_var = FALSE, .labels = NULL, .base_size = 12, .base_family = \"\", ... )"},{"path":"https://yhoriuchi.github.io/projoint/reference/plot.projoint_results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot all MMs or AMCEs — plot.projoint_results","text":"x projoint_results object .estimates estimates plotted, either \"corrected\" (default), \"uncorrected\", \"\" .by_var (structure profile-level) TRUE plot difference estimates two subgroups, FALSE (default) otherwise .labels (structure choice-level) chaarcter vector x-axis labels .base_size base font size, given pts. .base_family base font family ... Additional optional arguments","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/plot.projoint_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot all MMs or AMCEs — plot.projoint_results","text":"ggplot object","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/plot.projoint_tau.html","id":null,"dir":"Reference","previous_headings":"","what":"Visualize the results of the extrapolation method for estimating tau. — plot.projoint_tau","title":"Visualize the results of the extrapolation method for estimating tau. — plot.projoint_tau","text":"Visualize results extrapolation method estimating tau.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/plot.projoint_tau.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Visualize the results of the extrapolation method for estimating tau. — plot.projoint_tau","text":"","code":"# S3 method for projoint_tau plot(x, ...)"},{"path":"https://yhoriuchi.github.io/projoint/reference/plot.projoint_tau.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Visualize the results of the extrapolation method for estimating tau. — plot.projoint_tau","text":"x object class projoint_tau derived predict_tau ... Optional arguments; currently none accepted","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/plot.projoint_tau.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Visualize the results of the extrapolation method for estimating tau. — plot.projoint_tau","text":"","code":"library(projoint) library(stringr) ## Example 1: repeated, flipped task data(\"exampleData1\") head(exampleData1) #> # A tibble: 6 × 185 #> ResponseId choice1_repeated_fli…¹ choice1 choice2 choice3 choice4 choice5 #> #> 1 R_1M3TDihZzq9z… Community B Commun… Commun… Commun… Commun… Commun… #> 2 R_3HtXzkcSSlfi… Community B Commun… Commun… Commun… Commun… Commun… #> 3 R_yjYj0jtOY98X… Community B Commun… Commun… Commun… Commun… Commun… #> 4 R_1dKd05O6FTOV… Community B Commun… Commun… Commun… Commun… Commun… #> 5 R_1otDp642wWYl… Community A Commun… Commun… Commun… Commun… Commun… #> 6 R_2BnD3fuJMRKZ… Community A Commun… Commun… Commun… Commun… Commun… #> # ℹ abbreviated name: ¹​choice1_repeated_flipped #> # ℹ 178 more variables: choice6 , choice7 , choice8 , #> # race , party_1 , party_2 , party_3 , party_4 , #> # ideology , honesty , `K-1-1` , `K-1-1-1` , #> # `K-1-2` , `K-1-1-2` , `K-1-3` , `K-1-1-3` , #> # `K-1-4` , `K-1-1-4` , `K-1-5` , `K-1-1-5` , #> # `K-1-6` , `K-1-1-6` , `K-1-7` , `K-1-1-7` , … outcomes <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes <- c(outcomes, \"choice1_repeated_flipped\") reshaped_data <- reshape_projoint( .dataframe = exampleData1, .idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE) tau1 <- predict_tau(reshaped_data) plot(tau1)"},{"path":"https://yhoriuchi.github.io/projoint/reference/plot_projoint_choice_level_mm.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot all ","title":"Plot all ","text":"method produces profile-level MM AMCE plots given projoint_results object, output projoint function. structure must profile-level use function.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/plot_projoint_choice_level_mm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot all ","text":"","code":"plot_projoint_choice_level_mm( x, .estimates = \"corrected\", .labels = NULL, .base_size = 12, .base_family = \"\", ... )"},{"path":"https://yhoriuchi.github.io/projoint/reference/plot_projoint_choice_level_mm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot all ","text":"x projoint_results object .estimates estimates plotted, either \"corrected\" (default) \"uncorrected\" .labels character vector x-axis labels .base_size base font size, given pts. .base_family base font family ... Additional optional arguments","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/plot_projoint_choice_level_mm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot all ","text":"ggplot object","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/plot_projoint_profile_level.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot all ","title":"Plot all ","text":"method produces profile-level MM AMCE plots given projoint_results object, output projoint function. structure must profile-level use function.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/plot_projoint_profile_level.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot all ","text":"","code":"plot_projoint_profile_level( x, .estimates = \"corrected\", .by_var = FALSE, .base_size = 12, .base_family = \"\", ... )"},{"path":"https://yhoriuchi.github.io/projoint/reference/plot_projoint_profile_level.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot all ","text":"x projoint_results object .estimates estimates plotted, either \"corrected\" (default), \"uncorrected\", \"\" .by_var TRUE plot difference estimates two subgroups, FALSE (default) otherwise .base_size base font size, given pts. .base_family base font family ... Additional optional arguments","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/plot_projoint_profile_level.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot all ","text":"ggplot object","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/predict_tau.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate tau when there is no repeated task. — predict_tau","title":"Estimate tau when there is no repeated task. — predict_tau","text":"Given output projoint_data, function uses extrapolation method produce estimate intra-coder reliability (IRR).","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/predict_tau.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate tau when there is no repeated task. — predict_tau","text":"","code":"predict_tau(.data, .title = NULL) # S3 method for projoint_tau print(x, ...) # S3 method for projoint_tau summary(object, ...)"},{"path":"https://yhoriuchi.github.io/projoint/reference/predict_tau.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate tau when there is no repeated task. — predict_tau","text":".data projoint_data object, outputted reshape_projoint .title title figure x object class projoint_tau derived predict_tau ... Optional arguments; currently none accepted object object class projoint_tau derived predict_tau","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/predict_tau.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate tau when there is no repeated task. — predict_tau","text":"projoint_tau object containing estimate tau figure visualizing extrapolation method. tibble showing IRR profile similarity changes. value predicted x=0 estimated IRR.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/predict_tau.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate tau when there is no repeated task. — predict_tau","text":"","code":"library(projoint) library(stringr) ## Example 1: repeated, flipped task data(\"exampleData1\") head(exampleData1) #> # A tibble: 6 × 185 #> ResponseId choice1_repeated_fli…¹ choice1 choice2 choice3 choice4 choice5 #> #> 1 R_1M3TDihZzq9z… Community B Commun… Commun… Commun… Commun… Commun… #> 2 R_3HtXzkcSSlfi… Community B Commun… Commun… Commun… Commun… Commun… #> 3 R_yjYj0jtOY98X… Community B Commun… Commun… Commun… Commun… Commun… #> 4 R_1dKd05O6FTOV… Community B Commun… Commun… Commun… Commun… Commun… #> 5 R_1otDp642wWYl… Community A Commun… Commun… Commun… Commun… Commun… #> 6 R_2BnD3fuJMRKZ… Community A Commun… Commun… Commun… Commun… Commun… #> # ℹ abbreviated name: ¹​choice1_repeated_flipped #> # ℹ 178 more variables: choice6 , choice7 , choice8 , #> # race , party_1 , party_2 , party_3 , party_4 , #> # ideology , honesty , `K-1-1` , `K-1-1-1` , #> # `K-1-2` , `K-1-1-2` , `K-1-3` , `K-1-1-3` , #> # `K-1-4` , `K-1-1-4` , `K-1-5` , `K-1-1-5` , #> # `K-1-6` , `K-1-1-6` , `K-1-7` , `K-1-1-7` , … outcomes <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes <- c(outcomes, \"choice1_repeated_flipped\") reshaped_data <- reshape_projoint( .dataframe = exampleData1, .idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE) tau1 <- predict_tau(reshaped_data) tau1 #> [1] \"Tau estimated using the extrapolation method: 0.743\" ## Example 2: repeated, unflipped task data(\"exampleData2\") head(exampleData2) #> # A tibble: 6 × 185 #> ResponseId choice1_repeated_not…¹ choice1 choice2 choice3 choice4 choice5 #> #> 1 R_1M3TDihZzq9z… Community A Commun… Commun… Commun… Commun… Commun… #> 2 R_3HtXzkcSSlfi… Community A Commun… Commun… Commun… Commun… Commun… #> 3 R_yjYj0jtOY98X… Community A Commun… Commun… Commun… Commun… Commun… #> 4 R_1dKd05O6FTOV… Community A Commun… Commun… Commun… Commun… Commun… #> 5 R_1otDp642wWYl… Community B Commun… Commun… Commun… Commun… Commun… #> 6 R_2BnD3fuJMRKZ… Community B Commun… Commun… Commun… Commun… Commun… #> # ℹ abbreviated name: ¹​choice1_repeated_notflipped #> # ℹ 178 more variables: choice6 , choice7 , choice8 , #> # race , party_1 , party_2 , party_3 , party_4 , #> # ideology , honesty , `K-1-1` , `K-1-1-1` , #> # `K-1-2` , `K-1-1-2` , `K-1-3` , `K-1-1-3` , #> # `K-1-4` , `K-1-1-4` , `K-1-5` , `K-1-1-5` , #> # `K-1-6` , `K-1-1-6` , `K-1-7` , `K-1-1-7` , … outcomes <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes <- c(outcomes, \"choice1_repeated_notflipped\") reshaped_data <- reshape_projoint( .dataframe = exampleData2, .idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = FALSE) tau2 <- predict_tau(reshaped_data) tau2 #> [1] \"Tau estimated using the extrapolation method: 0.743\" ## Example 3: no repeated task data(\"exampleData3\") head(exampleData3) #> # A tibble: 6 × 184 #> ResponseId choice1 choice2 choice3 choice4 choice5 choice6 choice7 choice8 #> #> 1 R_1M3TDihZzq9… Commun… Commun… Commun… Commun… Commun… Commun… Commun… Commun… #> 2 R_3HtXzkcSSlf… Commun… Commun… Commun… Commun… Commun… Commun… Commun… Commun… #> 3 R_yjYj0jtOY98… Commun… Commun… Commun… Commun… Commun… Commun… Commun… Commun… #> 4 R_1dKd05O6FTO… Commun… Commun… Commun… Commun… Commun… Commun… Commun… Commun… #> 5 R_1otDp642wWY… Commun… Commun… Commun… Commun… Commun… Commun… Commun… Commun… #> 6 R_2BnD3fuJMRK… Commun… Commun… Commun… Commun… Commun… Commun… Commun… Commun… #> # ℹ 175 more variables: race , party_1 , party_2 , #> # party_3 , party_4 , ideology , honesty , `K-1-1` , #> # `K-1-1-1` , `K-1-2` , `K-1-1-2` , `K-1-3` , #> # `K-1-1-3` , `K-1-4` , `K-1-1-4` , `K-1-5` , #> # `K-1-1-5` , `K-1-6` , `K-1-1-6` , `K-1-7` , #> # `K-1-1-7` , `K-1-2-1` , `K-1-2-2` , `K-1-2-3` , #> # `K-1-2-4` , `K-1-2-5` , `K-1-2-6` , `K-1-2-7` , … outcomes <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes <- c(outcomes) reshaped_data <- reshape_projoint( .dataframe = exampleData3, .idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = FALSE) tau3 <- predict_tau(reshaped_data) tau3 #> [1] \"Tau estimated using the extrapolation method: 0.743\""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint.html","id":null,"dir":"Reference","previous_headings":"","what":"Analyze a conjoint data set and correct for measurement error — projoint","title":"Analyze a conjoint data set and correct for measurement error — projoint","text":"main function analyzes conjoint data set produces measurement error-corrected estimates either marginal means average marginal component effects, ready plotting. accepts `projoint_data` object, optionally `projoint_qoi` object users wish specify complex quantities interest.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Analyze a conjoint data set and correct for measurement error — projoint","text":"","code":"projoint( .data, .qoi = NULL, .by_var = NULL, .structure = \"profile_level\", .estimand = \"mm\", .se_method = \"analytical\", .irr = NULL, .remove_ties = TRUE, .ignore_position = NULL, .n_sims = NULL, .n_boot = NULL, .weights_1 = NULL, .clusters_1 = NULL, .se_type_1 = \"classical\", .weights_2 = NULL, .clusters_2 = NULL, .se_type_2 = \"classical\" ) # S3 method for projoint_results print(x, ...) # S3 method for projoint_results summary(object, ...)"},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Analyze a conjoint data set and correct for measurement error — projoint","text":".data projoint_data object .qoi projoint_qoi object. NULL, defaults producing MMs AMCEs. .by_var dichotomous variable (character) used subgroup analysis .structure Either \"profile_level\" (default) \"choice_level\". .qoi set, value structure .qoi overrides value. .estimand Either \"mm\" marginal mean \"amce\" average marginal component effect. .qoi set, value estimand .qoi overrides value. .se_method default, c(\"analytic\", \"simulation\", \"bootstrap\") description .irr NULL (default) IRR calculated using repeated task. Otherwise, numerical value .remove_ties Logical: ties removed estimation? Defaults TRUE. .ignore_position NULL (default) .structure = \"profile_level\". Set TRUE ignore position profile (left right); FALSE relative positioning profiles matters analysis. .structure = \"profile_level\" argument NULL, automatically reset TRUE. .n_sims number simulations. Relevant .se_method == \"simulation\" .n_boot number bootstrapped samples. Relevant .se_method == \"bootstrap\" .weights_1 weight estimate IRR (see lm_robust): NULL (default) .clusters_1 clusters estimate IRR (see lm_robust): NULL (default) .se_type_1 standard error type estimate IRR (see lm_robust): \"classical\" (default) .weights_2 weight estimate MM AMCE (see lm_robust): NULL (default) .clusters_2 clusters estimate MM AMCE (see lm_robust): NULL (default) .se_type_2 standard error type estimate MM AMCE (see lm_robust): \"classical\" (default) x projoint_results object ... Optional arguments; currently none accepted object projoint_results object","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Analyze a conjoint data set and correct for measurement error — projoint","text":"projoint_results object","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Analyze a conjoint data set and correct for measurement error — projoint","text":"","code":"library(projoint) data(\"exampleData1\") head(exampleData1) #> # A tibble: 6 × 185 #> ResponseId choice1_repeated_fli…¹ choice1 choice2 choice3 choice4 choice5 #> #> 1 R_1M3TDihZzq9z… Community B Commun… Commun… Commun… Commun… Commun… #> 2 R_3HtXzkcSSlfi… Community B Commun… Commun… Commun… Commun… Commun… #> 3 R_yjYj0jtOY98X… Community B Commun… Commun… Commun… Commun… Commun… #> 4 R_1dKd05O6FTOV… Community B Commun… Commun… Commun… Commun… Commun… #> 5 R_1otDp642wWYl… Community A Commun… Commun… Commun… Commun… Commun… #> 6 R_2BnD3fuJMRKZ… Community A Commun… Commun… Commun… Commun… Commun… #> # ℹ abbreviated name: ¹​choice1_repeated_flipped #> # ℹ 178 more variables: choice6 , choice7 , choice8 , #> # race , party_1 , party_2 , party_3 , party_4 , #> # ideology , honesty , `K-1-1` , `K-1-1-1` , #> # `K-1-2` , `K-1-1-2` , `K-1-3` , `K-1-1-3` , #> # `K-1-4` , `K-1-1-4` , `K-1-5` , `K-1-1-5` , #> # `K-1-6` , `K-1-1-6` , `K-1-7` , `K-1-1-7` , … outcomes <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes <- c(outcomes, \"choice1_repeated_flipped\") reshaped_data <- reshape_projoint( .dataframe = exampleData1, .idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE) projoint(reshaped_data) #> [A projoint output] #> Estimand: mm #> Structure: profile_level #> IRR: Estimated #> Tau: 0.1721281 #> Remove ties: TRUE #> SE methods: analytical"},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_data-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Class generator for projoint_data — projoint_data-class","title":"Class generator for projoint_data — projoint_data-class","text":"Class generator projoint_data","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_diff.html","id":null,"dir":"Reference","previous_headings":"","what":"Analyze a conjoint data set and correct for measurement error — projoint_diff","title":"Analyze a conjoint data set and correct for measurement error — projoint_diff","text":"internal function used calculate correct marginal means average marginal component effects conjoint design.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_diff.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Analyze a conjoint data set and correct for measurement error — projoint_diff","text":"","code":"projoint_diff( .data, .qoi = NULL, .by_var, .structure = \"profile_level\", .estimand = \"mm\", .se_method = \"analytical\", .irr = NULL, .remove_ties = TRUE, .ignore_position = NULL, .n_sims = NULL, .n_boot = NULL, .weights_1 = NULL, .clusters_1 = NULL, .se_type_1 = \"classical\", .weights_2 = NULL, .clusters_2 = NULL, .se_type_2 = \"classical\" )"},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_diff.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Analyze a conjoint data set and correct for measurement error — projoint_diff","text":".data projoint_data object .qoi projoint_qoi object. NULL, defaults producing MMs AMCEs. .by_var dichotomous variable (character) used subgroup analysis .structure Either \"profile_level\" (default) \"choice_level\" .estimand Either \"mm\" marginal mean \"amce\" average marginal component effect .se_method default, c(\"analytic\", \"simulation\", \"bootstrap\") description .irr NULL (default) IRR calculated using repeated task. Otherwise, numerical value .remove_ties Logical: ties removed estimation? Defaults TRUE. .ignore_position TRUE (default) ignore location profile (left right). Relevant analyzed choice level .n_sims number simulations. Relevant .se_method == \"simulation\" .n_boot number bootstrapped samples. Relevant .se_method == \"bootstrap\" .weights_1 weight estimate IRR (see lm_robust): NULL (default) .clusters_1 clusters estimate IRR (see lm_robust): NULL (default) .se_type_1 standard error type estimate IRR (see lm_robust): \"classical\" (default) .weights_2 weight estimate MM AMCE (see lm_robust): NULL (default) .clusters_2 clusters estimate MM AMCE (see lm_robust): NULL (default) .se_type_2 standard error type estimate MM AMCE (see lm_robust): \"classical\" (default)","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_diff.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Analyze a conjoint data set and correct for measurement error — projoint_diff","text":"projoint_results object","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_level.html","id":null,"dir":"Reference","previous_headings":"","what":"Analyze a conjoint data set and correct for measurement error — projoint_level","title":"Analyze a conjoint data set and correct for measurement error — projoint_level","text":"internal function used calculate correct marginal means average marginal component effects conjoint design.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_level.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Analyze a conjoint data set and correct for measurement error — projoint_level","text":"","code":"projoint_level( .data, .qoi = NULL, .structure = \"profile_level\", .estimand = \"mm\", .se_method = \"analytical\", .irr = NULL, .remove_ties = TRUE, .ignore_position = NULL, .n_sims = NULL, .n_boot = NULL, .weights_1 = NULL, .clusters_1 = NULL, .se_type_1 = \"classical\", .weights_2 = NULL, .clusters_2 = NULL, .se_type_2 = \"classical\" )"},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_level.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Analyze a conjoint data set and correct for measurement error — projoint_level","text":".data projoint_data object .qoi projoint_qoi object. NULL, defaults producing MMs AMCEs. .structure Either \"profile_level\" (default) \"choice_level\" .estimand Either \"mm\" marginal mean \"amce\" average marginal component effect .se_method default, c(\"analytic\", \"simulation\", \"bootstrap\") description .irr NULL (default) IRR calculated using repeated task. Otherwise, numerical value .remove_ties Logical: ties removed estimation? Defaults TRUE. .ignore_position TRUE (default) ignore location profile (left right). Relevant analyzed choice level .n_sims number simulations. Relevant .se_method == \"simulation\" .n_boot number bootstrapped samples. Relevant .se_method == \"bootstrap\" .weights_1 weight estimate IRR (see lm_robust): NULL (default) .clusters_1 clusters estimate IRR (see lm_robust): NULL (default) .se_type_1 standard error type estimate IRR (see lm_robust): \"classical\" (default) .weights_2 weight estimate MM AMCE (see lm_robust): NULL (default) .clusters_2 clusters estimate MM AMCE (see lm_robust): NULL (default) .se_type_2 standard error type estimate MM AMCE (see lm_robust): \"classical\" (default)","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_level.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Analyze a conjoint data set and correct for measurement error — projoint_level","text":"projoint_results object","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_qoi-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Class generator for projoint_qoi — projoint_qoi-class","title":"Class generator for projoint_qoi — projoint_qoi-class","text":"Class generator projoint_qoi","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_qoi-class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class generator for projoint_qoi — projoint_qoi-class","text":"slots Takes four MMs eight AMCEs well estimand structure","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_results-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Class generators for projoint_results — projoint_results-class","title":"Class generators for projoint_results — projoint_results-class","text":"Class generators projoint_results","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_results-class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class generators for projoint_results — projoint_results-class","text":"slots Takes 16 slots. See documentation projoint. contains Inherits slots projoint_data","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_tau-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Class generator for projoint_tau objects — projoint_tau-class","title":"Class generator for projoint_tau objects — projoint_tau-class","text":"Class generator projoint_tau objects","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/projoint_tau-class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class generator for projoint_tau objects — projoint_tau-class","text":"slots Takes two slots: irr figure contains Inherits slots projoint_data","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/read_Qualtrics.html","id":null,"dir":"Reference","previous_headings":"","what":"Read and re-format a Qualtrics csv (choice text) — read_Qualtrics","title":"Read and re-format a Qualtrics csv (choice text) — read_Qualtrics","text":"Read re-format Qualtrics csv (choice text)","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/read_Qualtrics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read and re-format a Qualtrics csv (choice text) — read_Qualtrics","text":"","code":"read_Qualtrics(.file)"},{"path":"https://yhoriuchi.github.io/projoint/reference/read_Qualtrics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read and re-format a Qualtrics csv (choice text) — read_Qualtrics","text":".file file name corresponding csv downloaded Qualtrics.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/read_Qualtrics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read and re-format a Qualtrics csv (choice text) — read_Qualtrics","text":"data frame suitable reshape_projoint","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/read_Qualtrics.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read and re-format a Qualtrics csv (choice text) — read_Qualtrics","text":"","code":"library(projoint) # Not run: # dat <- read_Qualtrics(\"mummolo_nall_replication_cleaned.csv\") # head(dat)"},{"path":"https://yhoriuchi.github.io/projoint/reference/read_labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Reads in a CSV of reordered attributes and levels, and applies it to a projoint_data object. — read_labels","title":"Reads in a CSV of reordered attributes and levels, and applies it to a projoint_data object. — read_labels","text":"users interested reordering attributes levels conjoint data set. First save existing order CSV using save_labels, manually reorder CSV. Finally, use function read modified CSV automatically apply new order existing projoint_data.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/read_labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reads in a CSV of reordered attributes and levels, and applies it to a projoint_data object. — read_labels","text":"","code":"read_labels(.data, .filename)"},{"path":"https://yhoriuchi.github.io/projoint/reference/read_labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reads in a CSV of reordered attributes and levels, and applies it to a projoint_data object. — read_labels","text":".data `projoint_data` object .filename name revised CSV file, originally derived save_labels, manual arrangement","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/read_labels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reads in a CSV of reordered attributes and levels, and applies it to a projoint_data object. — read_labels","text":"projoint object class projoint_data ready pass projoint.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/read_labels.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reads in a CSV of reordered attributes and levels, and applies it to a projoint_data object. — read_labels","text":"","code":"library(projoint) library(readr) data(\"exampleData1\") head(exampleData1) #> # A tibble: 6 × 185 #> ResponseId choice1_repeated_fli…¹ choice1 choice2 choice3 choice4 choice5 #> #> 1 R_1M3TDihZzq9z… Community B Commun… Commun… Commun… Commun… Commun… #> 2 R_3HtXzkcSSlfi… Community B Commun… Commun… Commun… Commun… Commun… #> 3 R_yjYj0jtOY98X… Community B Commun… Commun… Commun… Commun… Commun… #> 4 R_1dKd05O6FTOV… Community B Commun… Commun… Commun… Commun… Commun… #> 5 R_1otDp642wWYl… Community A Commun… Commun… Commun… Commun… Commun… #> 6 R_2BnD3fuJMRKZ… Community A Commun… Commun… Commun… Commun… Commun… #> # ℹ abbreviated name: ¹​choice1_repeated_flipped #> # ℹ 178 more variables: choice6 , choice7 , choice8 , #> # race , party_1 , party_2 , party_3 , party_4 , #> # ideology , honesty , `K-1-1` , `K-1-1-1` , #> # `K-1-2` , `K-1-1-2` , `K-1-3` , `K-1-1-3` , #> # `K-1-4` , `K-1-1-4` , `K-1-5` , `K-1-1-5` , #> # `K-1-6` , `K-1-1-6` , `K-1-7` , `K-1-1-7` , … # Write outcome column names outcomes <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes <- c(outcomes, \"choice1_repeated_flipped\") # Reshape the data reshaped_data <- reshape_projoint( .dataframe = exampleData1, .idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE) # Save a CSV file (Not Run) # save_labels(reshaped_data, \"data-raw/labels_original.csv\") # Not Run: Read a revised CSV file # reshaped_data_arranged <- read_labels(reshaped_data, \"data-raw/labels_arranged.csv\")"},{"path":"https://yhoriuchi.github.io/projoint/reference/reshape_projoint.html","id":null,"dir":"Reference","previous_headings":"","what":"Reshapes survey response data for conjoint analysis — reshape_projoint","title":"Reshapes survey response data for conjoint analysis — reshape_projoint","text":"function takes data frame, preferably read_Qualtrics, reshapes wide long row distinct conjoint task rather respondent.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/reshape_projoint.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reshapes survey response data for conjoint analysis — reshape_projoint","text":"","code":"reshape_projoint( .dataframe, .idvar, .outcomes, .outcomes_ids = c(\"1\", \"2\"), .alphabet = \"F\", .repeated = FALSE, .flipped = NULL, .covariates = NULL, .fill = FALSE )"},{"path":"https://yhoriuchi.github.io/projoint/reference/reshape_projoint.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reshapes survey response data for conjoint analysis — reshape_projoint","text":".dataframe data frame, preferably read_Qualtrics .idvar character identifying column name containing respondent IDs .outcomes character vector identifying column names contain outcomes. repeated task, LAST element vector. .outcomes_ids vector identifying possibilities outcome variables -- e.g., c(\"Candidate \", \"Candidate B\") .alphabet letter indicating conjoint attributes. using Strezhnev's package (https://github.com/astrezhnev/conjointsdt) Qualtrics, default F. .repeated TRUE repeated task (recommended). repeated task first task. .flipped TRUE profiles repeated task flipped (recommended) .covariates character vector identifying respondents' covariates used subgroup analysis .fill logical vector: TRUE want use information whether respondent chose profile repeated task \"fill\" (using `tidyr` package) missing values non-repeated tasks, FALSE (otherwise). number respondents small, number specific profile pairs interest small, /number specific respondent subgroups want study small, worth changing option TRUE. please note `.fill = TRUE` based assumption IRR independent information contained conjoint tables. Although empirical tests suggest validity assumption, unsure , better use default value (FALSE).","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/reshape_projoint.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reshapes survey response data for conjoint analysis — reshape_projoint","text":"projoint object class `projoint_data` ready pass `projoint()`. projoint object class projoint_data ready pass projoint.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/reshape_projoint.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reshapes survey response data for conjoint analysis — reshape_projoint","text":"","code":"library(projoint) library(stringr) data(\"exampleData1\") head(exampleData1) #> # A tibble: 6 × 185 #> ResponseId choice1_repeated_fli…¹ choice1 choice2 choice3 choice4 choice5 #> #> 1 R_1M3TDihZzq9z… Community B Commun… Commun… Commun… Commun… Commun… #> 2 R_3HtXzkcSSlfi… Community B Commun… Commun… Commun… Commun… Commun… #> 3 R_yjYj0jtOY98X… Community B Commun… Commun… Commun… Commun… Commun… #> 4 R_1dKd05O6FTOV… Community B Commun… Commun… Commun… Commun… Commun… #> 5 R_1otDp642wWYl… Community A Commun… Commun… Commun… Commun… Commun… #> 6 R_2BnD3fuJMRKZ… Community A Commun… Commun… Commun… Commun… Commun… #> # ℹ abbreviated name: ¹​choice1_repeated_flipped #> # ℹ 178 more variables: choice6 , choice7 , choice8 , #> # race , party_1 , party_2 , party_3 , party_4 , #> # ideology , honesty , `K-1-1` , `K-1-1-1` , #> # `K-1-2` , `K-1-1-2` , `K-1-3` , `K-1-1-3` , #> # `K-1-4` , `K-1-1-4` , `K-1-5` , `K-1-1-5` , #> # `K-1-6` , `K-1-1-6` , `K-1-7` , `K-1-1-7` , … # Write outcome column names outcomes <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes <- c(outcomes, \"choice1_repeated_flipped\") # Reshape the data reshaped_data <- reshape_projoint( .dataframe = exampleData1, .idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE, .fill = FALSE)"},{"path":"https://yhoriuchi.github.io/projoint/reference/save_labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Save the attributes and levels, and their order, from a conjoint data set, to a CSV file. — save_labels","title":"Save the attributes and levels, and their order, from a conjoint data set, to a CSV file. — save_labels","text":"function saves labels attributes levels, generated reshape_projoint, CSV file. important step reorganizing labels.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/save_labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Save the attributes and levels, and their order, from a conjoint data set, to a CSV file. — save_labels","text":"","code":"save_labels(.data, .filename)"},{"path":"https://yhoriuchi.github.io/projoint/reference/save_labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save the attributes and levels, and their order, from a conjoint data set, to a CSV file. — save_labels","text":".data projoint_data object .filename name CSV file saved","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/save_labels.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Save the attributes and levels, and their order, from a conjoint data set, to a CSV file. — save_labels","text":"None","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/save_labels.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Save the attributes and levels, and their order, from a conjoint data set, to a CSV file. — save_labels","text":"","code":"library(projoint) library(readr) data(\"exampleData1\") head(exampleData1) #> # A tibble: 6 × 185 #> ResponseId choice1_repeated_fli…¹ choice1 choice2 choice3 choice4 choice5 #> #> 1 R_1M3TDihZzq9z… Community B Commun… Commun… Commun… Commun… Commun… #> 2 R_3HtXzkcSSlfi… Community B Commun… Commun… Commun… Commun… Commun… #> 3 R_yjYj0jtOY98X… Community B Commun… Commun… Commun… Commun… Commun… #> 4 R_1dKd05O6FTOV… Community B Commun… Commun… Commun… Commun… Commun… #> 5 R_1otDp642wWYl… Community A Commun… Commun… Commun… Commun… Commun… #> 6 R_2BnD3fuJMRKZ… Community A Commun… Commun… Commun… Commun… Commun… #> # ℹ abbreviated name: ¹​choice1_repeated_flipped #> # ℹ 178 more variables: choice6 , choice7 , choice8 , #> # race , party_1 , party_2 , party_3 , party_4 , #> # ideology , honesty , `K-1-1` , `K-1-1-1` , #> # `K-1-2` , `K-1-1-2` , `K-1-3` , `K-1-1-3` , #> # `K-1-4` , `K-1-1-4` , `K-1-5` , `K-1-1-5` , #> # `K-1-6` , `K-1-1-6` , `K-1-7` , `K-1-1-7` , … # Write outcome column names outcomes <- paste0(\"choice\", seq(from = 1, to = 8, by = 1)) outcomes <- c(outcomes, \"choice1_repeated_flipped\") # Reshape the data reshaped_data <- reshape_projoint( .dataframe = exampleData1, .idvar = \"ResponseId\", .outcomes = outcomes, .outcomes_ids = c(\"A\", \"B\"), .alphabet = \"K\", .repeated = TRUE, .flipped = TRUE) # Not Run: Save a CSV file # save_labels(reshaped_data, \"data-raw/labels_original.csv\")"},{"path":"https://yhoriuchi.github.io/projoint/reference/set_qoi.html","id":null,"dir":"Reference","previous_headings":"","what":"Set the quantities of interest — set_qoi","title":"Set the quantities of interest — set_qoi","text":"function allows users specify fine-tuned details conjoint analysis. particular, users can set specific quantities interest aside simple AMCEs MMs.","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/set_qoi.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set the quantities of interest — set_qoi","text":"","code":"set_qoi( .structure = \"profile_level\", .estimand = \"mm\", .att_choose, .lev_choose, .att_notchoose = NULL, .lev_notchoose = NULL, .att_choose_b = NULL, .lev_choose_b = NULL, .att_notchoose_b = NULL, .lev_notchoose_b = NULL )"},{"path":"https://yhoriuchi.github.io/projoint/reference/set_qoi.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set the quantities of interest — set_qoi","text":".structure Either \"profile_level\" \"choice_level\" .estimand Either \"mm\" marginal mean \"amce\" average marginal component effect .att_choose character column name identifying attribute interest (.e., attribute-level attribute-levels chosen). .lev_choose character vector identifying level levels interest (.e., attribute-level attribute-levels chosen). length 1 profile-level analysis 1+ choice-level analysis .att_notchoose character column name identifying attribute interest (.e., attribute-level attribute-levels chosen). argument specified .structure argument \"choice-level\". .lev_notchoose character vector identifying level levels interest (.e., attribute-level attribute-levels chosen). length 1 profile-level analysis 1+ choice-level analysis. argument specified .structure argument \"choice-level\". .att_choose_b [baseline AMCE] character column name identifying attribute interest (.e., attribute-level attribute-levels chosen). .lev_choose_b [baseline AMCE] character vector identifying level levels interest (.e., attribute-level attribute-levels chosen). length 1 profile-level analysis 1+ choice-level analysis .att_notchoose_b [baseline AMCE] character column name identifying attribute interest (.e., attribute-level attribute-levels chosen*). argument specified .structure argument \"choice-level\". .lev_notchoose_b [baseline AMCE] character vector identifying level levels interest (.e., attribute-level attribute-levels chosen). length 1 profile-level analysis 1+ choice-level analysis. argument specified .structure argument \"choice-level\".","code":""},{"path":"https://yhoriuchi.github.io/projoint/reference/set_qoi.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set the quantities of interest — set_qoi","text":"projoint_qoi object","code":""},{"path":"https://yhoriuchi.github.io/projoint/news/index.html","id":"projoint-development-version","dir":"Changelog","previous_headings":"","what":"projoint (development version)","title":"projoint (development version)","text":"written","code":""}]