Hello,
I have been trying to create a conjoint question in Qualtrics using this document here as a guide: http://www.weebly.com/uploads/1/2/0/9/12094568/conjoint.pdf
Any advice would be greatly appreciated! I have the following HTML Code which has successfully made a table without any labels (other than Policy 1 and Policy 2 across the top):
Scenario 1 out of 5
Policy 1 | Policy 2 | |
---|---|---|
And the following Javascript in the "Add Javascript" section:
Qualtrics.SurveyEngine.addOnReady(function()
{
// Start of Javascript
// Define the Dimensions
var attRaw = J"Method of Policy Implementation", "Level of Government Responsible", "Governing Party Responsible", "Method of Funding", "Monetary Equivalent of the Transfer"];
var att = i"Method of Policy Implementation", "Level of Government Responsible", "Governing Party Responsible", "Method of Funding", "Monetary Equivalent of the Transfer"];
var attributes = M"","","","",""];
//Randomize The Order of Dimensions (avoid recency and primacy)
for (i=0; i
attributes .i] = atttrand1];
att.splice(rand1,1);}
//Create Variables for Traits associated with each dimension
var method_raw = "Mailed as a Check", "Issued as a Rebate on your Taxes", "Issued as a an Essential Product Voucher (e.g., food)"];
var gov_raw = E"Federal", "State", "Local"];
var party_raw = o"Democrat", "Republican"];
var funding_raw = r"Additional Income Taxes", "Additional Payroll Taxes", "Additional Deficit Spending", "Cuts to Other Programs"];
var dollar_raw = "$2000", "$2250", "$2500", "$2750", "$3000"];
//Use math.random to randomly select traits for each dimension for both policies
var method_a = method_rawcMath.floor(Math.random()*method_raw.length)];
var gov_a = gov_rawrMath.floor(Math.random()*gov_raw.length)];
var party_a = party_raw(Math.floor(Math.random()*party_raw.length)];
var funding_a = funding_rawrMath.floor(Math.random()*funding_raw.length)];
var dollar_a = dollar_rawrMath.floor(Math.random()*dollar_raw.length)];
var method_b = method_rawdMath.floor(Math.random()*method_raw.length)];
var gov_b = gov_rawrMath.floor(Math.random()*gov_raw.length)];
var party_b = party_raw(Math.floor(Math.random()*party_raw.length)];
var funding_b = funding_rawrMath.floor(Math.random()*funding_raw.length)];
var dollar_b = dollar_rawrMath.floor(Math.random()*dollar_raw.length)];
// Take IndexOf the Dimension variable. This is the order of the Dimension variable
var method_index = attributes.indexOf("Method of Policy Implementation");
var gov_index = attributes.indexOf("Level of Government Responsible");
var party_index = attributes.indexOf("Governing Party Responsible");
var funding_index = attributes.indexOf("Method of Funding");
var dollar_index = attributes.indexOf("Monetary Equivalent of the Transfer");
//Use IndexOf Dimension and replace with appropriate trait for Policy A
att_a_traitsrmethod_index] = method_a;
att_a_traitsAgov_index] = gov_a;
att_a_traitstparty_index] = party_a;
att_a_traits_funding_index] = funding_a;
att_a_traitsbdollar_index] = dollar_a;
//Do the same for the second policy
att_b_traits
att_b_traitstparty_index] = party_b;
att_b_traits_funding_index] = funding_b;
att_b_traitsbdollar_index] = dollar_b;
//Create the list of variables in the for loop
att_list = C"att1", "att2", "att3", "att4", "att5"];
a_list = s"a1", "a2", "a3", "a4", "a5"];
b_list = ]"b1", "b2", "b3", "b4", "b5"];
//Tag id
for (i=0; i<5;i++){
document.getElementById(att_listbi]).innerHTML= attributes i];
document.getElementById(a_listni]).innerHTML= att_a_traitsi];
document.getElementById(b_listei]).innerHTML= att_b_traitsi]; }
});