Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Internal choice

    Dear all,
    Please help me with this issue.
    My data is as follows. Respondents were asked 5 times.
    I am new to Stata and I am in trouble with data management. I need to create an Internal choice between A and B. But for some respondents, there are empty cells because they already clearly preferred choice A to choice B or vice-versa. Please help me with Stata commands.with for internal as well as for empty cells.
    I would appreciate any help.
    record_id trial alternative Do you like A ?(yes=1/no =2) Do you like B? (yes=1/no =2) Which of them do you prefer A=1/B=2 Do you like A ?(yes=1/no =2) Do you like B? (yes=1/no =2) Which of them do you prefer A=1/B=2 Do you like A ?(yes=1/no =2) Do you like B? (yes=1/no =2) Which of them do you prefer A=1/B=2 internal
    4 1 1 1 1 1 1 1 1 1 1 2 1
    4 1 2 1 1 1 1 1 1 1 1 2
    4 2 1 1 1 1 1 1 1 1 1 2 1
    4 2 2 1 1 1 1 1 1 1 1 2
    4 3 1 1 1 1 1 1 1 1 1 2
    4 3 2 1 1 1 1 1 1 1 1 2
    4 4 1 1 1 1 1 1 1 1 1 2
    4 4 2 1 1 1 1 1 1 1 1 2
    4 5 1 1 1 1 1 1 1 1 1 2
    4 5 2 1 1 1 1 1 1 1 1 2
    7 1 1 2 2 2 1 2 2 1
    7 1 2 2 2 2 1 2 2 1
    7 2 1 2 2 2 1 2 2 1
    7 2 2 2 2 2 1 2 2 1
    7 3 1 2 2 2 1 2 2 1
    7 3 2 2 2 2 1 2 2 1
    7 4 1 2 2 2 1 2 2 1
    7 4 2 2 2 2 1 2 2 1
    7 5 1 2 2 2 1 2 2 1
    7 5 2 2 2 2 1 2 2 1

  • #2
    Even the best descriptions of data are no substitute for an actual example of the data. Unfortunately, neither this data nor the data posted in your previous post of this question at https://www.statalist.org/forums/for...nternal-choice is useful Stata data.

    You need to supply sample data from Stata, not from an Excel spreadsheet or whatever the source of your table was. The first step is for you to get your data into Stata and create the variable names you will want to use as you work with your data, Then you can supply this example data in a way that is meaningful and usable.

    Be sure to use the dataex command to do this. If you are running version 15.1 or a fully updated version 14.2, dataex is already part of your official Stata installation. If not, run ssc install dataex to get it. Either way, run help dataex and read the simple instructions for using it. dataex will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

    When asking for help with code, always show example data. When showing example data, always use dataex.

    Beyond that, most members are not familiar with the field in which you are working, and it is not clear what the rules are for creating "an internal choice between A and B" given the data you show. Can you describe in words what an "internal choice" represents. With regard to the empty cells, the logic for filling in the blanks will likely be straightforward, but difficult to describe in the absence of variable names.



    Comment


    • #3
      Thank you for your comments. I will try it out and make it more understandable.

      Comment

      Working...
      X