Hello, I´m using the following code and it is working but not with the information I would like:
My dataset has 81 respondents who have to choose 12 times (12 choice tasks) among 3 alternatives ("alternative 1", "alternative 2" and "nochoice"). There are different attributes for each alternative: type of access, weekly access, days per week and price. For the first alternative, the attributes were labelled as alt1_type, alt1_weac, alt1_dayp, alt1_pri. However, for the second alternative the attributes were labelled as alt2_type, alt2_weac, alt2_dayp, alt2_pri. The attribute I want to focus on is the "type of access" (present in alt1_type and alt2_type) and the corresponding levels are "mixed gender" and "female only".
The level ("mixed gender" and "female only") of each attribute ("type of access" present in "alt1_type" and "alt2_type") is shown to the respondant changing randomly between alternative 1 and 2. For example, in the first choice task (from a total of 12 choice tasks) a respondent can choose "female only" that appears under "alt1_type" and obviously "mixed gender" appears under "alt2_type". In the second choice task "mixed gender" appears under "alt1_type" and obviously "female only" appears under "alt2_type". Levels are randomly assigned to each alternative until 12 choice tasks are completed by the survey respondent. For nochoice is always the same level, so no problem in here.
With the code below I'm assuming that the first alternative is always "female only" (or "mixed gender") and the second is always "mixed gender" (or "female only") and the third is always "nochoice" (that in that case is always the same, so no problem).
In the dataset I have a variable called "choice" that equals 1 to the first alternative selected: alternative 1. Choice equals 2 to the second alternative selected: alternative 2 and 3 to the third alternative "nochoice". How can I chose the correct level from each attribute?
Any suggestion is more than helpful! Many thanks!
Nerea
Code:
egen choice1 = sum(choice == 1), by(userid) egen choice2 = sum(choice == 2), by(userid) egen nochoice = sum(choice == 3), by(userid)
The level ("mixed gender" and "female only") of each attribute ("type of access" present in "alt1_type" and "alt2_type") is shown to the respondant changing randomly between alternative 1 and 2. For example, in the first choice task (from a total of 12 choice tasks) a respondent can choose "female only" that appears under "alt1_type" and obviously "mixed gender" appears under "alt2_type". In the second choice task "mixed gender" appears under "alt1_type" and obviously "female only" appears under "alt2_type". Levels are randomly assigned to each alternative until 12 choice tasks are completed by the survey respondent. For nochoice is always the same level, so no problem in here.
With the code below I'm assuming that the first alternative is always "female only" (or "mixed gender") and the second is always "mixed gender" (or "female only") and the third is always "nochoice" (that in that case is always the same, so no problem).
In the dataset I have a variable called "choice" that equals 1 to the first alternative selected: alternative 1. Choice equals 2 to the second alternative selected: alternative 2 and 3 to the third alternative "nochoice". How can I chose the correct level from each attribute?
Any suggestion is more than helpful! Many thanks!
Nerea
Comment