Announcement

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

  • Processing data from a skip question where skipped answers are labelled as never in subsequent questions

    Hello Stata team,

    Unfortunately, I’m really struggling with processing data from a skip question from survey data.

    The question flow runs as:

    Q7 Do you feel you can be specific about NTWD diagnosis? (yes/no)
    *Yes (move on to Question 8) No (Skip to Question 10)
    Q8 To what extent are you confident in making diagnosis for the following conditions? (Likert scale 1-5)
    DiagnConfGanglia
    DiagnConfTendin

    This looks like this from my coding:
    label values SpecdiagnNTWD SpecdiagnNTWD
    label define SpecdiagnNTWD 1 "yes" 3 "no"
    *Yes (move on to Question 8) No (Skip to Question 10)
    *Q8 ConfDiag
    label define Confidence 1 "always" 2 "very often" 3 "sometimes" 4 "rarely" 5 "never"
    label values DiagnConfGanglia Confidence
    generate New_DiagnConfGanglia 5=SpecdiagnNTWD no

    When I generate a table for Q8 it looks as I would wish (below)

    Click image for larger version

Name:	Table Qu 01.02.24.PNG
Views:	1
Size:	29.5 KB
ID:	1741819



    However, when I generate a table for each diagnosis, the missing values are lumped together with the 'no' category below:

    [ATTACH=CONFIG]n1741817[/ATTACH]

    I set the rule of “no” = “never” in my data cleaning guide, but can't work out how to move the 83 'no' values into 'never.

    I’ve unsuccessfully tried the following:
    • SpecdiagnNTWD = Confidence, sort if Confidence == 5
    • by SpecdiagnNTWD, sort if Confidence_5 = SpecdiagnNTWD == 5
    • by SpecdiagnNTWD_no = Confidence_5, sort if Confidence == 5
    • by SpecdiagnNTWD_no == Confidence_never
    Thanks in advance for any advice.

    Thomas

  • #2
    Click image for larger version

Name:	Table 2 Qu.PNG
Views:	1
Size:	30.4 KB
ID:	1741821


    I set the rule of “no” = “never” in my data cleaning guide, but can't work out how to move the 83 'no' values into 'never.

    I’ve unsuccessfully tried the following:
    • SpecdiagnNTWD = Confidence, sort if Confidence == 5
    • by SpecdiagnNTWD, sort if Confidence_5 = SpecdiagnNTWD == 5
    • by SpecdiagnNTWD_no = Confidence_5, sort if Confidence == 5
    • by SpecdiagnNTWD_no == Confidence_never
    Thanks in advance for any advice.

    Thomas

    Comment


    • #3
      I find it very hard to follow what you are doing and what you want to do. Partly because you use screenshots not output in CODE delimiters, partly because you provide no example data, and partly because a lot of what you show cannot possibly produce any result other than syntax errors in Stata, e.g.

      Code:
      SpecdiagnNTWD = Confidence, sort if Confidence == 5
      by SpecdiagnNTWD, sort if Confidence_5 = SpecdiagnNTWD == 5
      by SpecdiagnNTWD_no = Confidence_5, sort if Confidence == 5
      by SpecdiagnNTWD_no == Confidence_never
      are nowhere near legal syntax. Neither is

      Code:
      generate New_DiagnConfGanglia 5=SpecdiagnNTWD no
      Please fix these issues and present your problem in a way that is easier to reproduce.

      Comment


      • #4
        Thank you Daniel

        Comment

        Working...
        X