• count values within case

    From Alba Johnsen@21:1/5 to All on Tue Aug 25 03:22:48 2020
    Hi,
    I have a variable which has 5 values. I need to mix 1,2,3 and 6,7 together. to make a 2 variable, but I dont know how. Please help!!!

    The item is : What did you do with your photos
    1. I shared them
    2.I plan to share them
    3. I streamed when I was in the concer

    6. I didnt share it
    7. nothing


    so now I need to make a new variable with 1,2,3
    and 6,7

    to do Anova

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bruce Weaver@21:1/5 to Alba Johnsen on Tue Aug 25 05:37:17 2020
    On Tuesday, August 25, 2020 at 6:22:50 AM UTC-4, Alba Johnsen wrote:
    Hi,
    I have a variable which has 5 values. I need to mix 1,2,3 and 6,7 together. to make a 2 variable, but I dont know how. Please help!!!

    The item is : What did you do with your photos
    1. I shared them
    2.I plan to share them
    3. I streamed when I was in the concer

    6. I didnt share it
    7. nothing


    so now I need to make a new variable with 1,2,3
    and 6,7

    to do Anova

    Please generate a small data listing of several cases that shows what the data look like now, and what you want it to look like afterwards.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich Ulrich@21:1/5 to bweaver@lakeheadu.ca on Tue Aug 25 10:28:50 2020
    On Tue, 25 Aug 2020 05:37:17 -0700 (PDT), Bruce Weaver
    <bweaver@lakeheadu.ca> wrote:

    On Tuesday, August 25, 2020 at 6:22:50 AM UTC-4, Alba Johnsen wrote:
    Hi,
    I have a variable which has 5 values. I need to mix 1,2,3 and 6,7 together. to make a 2 variable, but I dont know how. Please help!!!

    The item is : What did you do with your photos
    1. I shared them
    2.I plan to share them
    3. I streamed when I was in the concer

    6. I didnt share it
    7. nothing


    so now I need to make a new variable with 1,2,3
    and 6,7

    to do Anova

    Please generate a small data listing of several cases that shows what the data look like now, and what you want it to look like afterwards.

    My guess is that the intention is to create a dichotomy, in
    a new variable. Thus.

    RECODE Photos(1,2,3=1)(6,7=2)(else=9) into Share .
    Value labels Share(1) share (2) not share.

    --
    Rich Ulrich

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bruce Weaver@21:1/5 to Rich Ulrich on Tue Aug 25 08:23:30 2020
    On Tuesday, August 25, 2020 at 10:28:57 AM UTC-4, Rich Ulrich wrote:
    On Tue, 25 Aug 2020 05:37:17 -0700 (PDT), Bruce Weaver
    <bweaver@lakeheadu.ca> wrote:

    On Tuesday, August 25, 2020 at 6:22:50 AM UTC-4, Alba Johnsen wrote:
    Hi,
    I have a variable which has 5 values. I need to mix 1,2,3 and 6,7 together. to make a 2 variable, but I dont know how. Please help!!!

    The item is : What did you do with your photos
    1. I shared them
    2.I plan to share them
    3. I streamed when I was in the concer

    6. I didnt share it
    7. nothing


    so now I need to make a new variable with 1,2,3
    and 6,7

    to do Anova

    Please generate a small data listing of several cases that shows what the data look like now, and what you want it to look like afterwards.

    My guess is that the intention is to create a dichotomy, in
    a new variable. Thus.

    RECODE Photos(1,2,3=1)(6,7=2)(else=9) into Share .
    Value labels Share(1) share (2) not share.

    --
    Rich Ulrich

    Ah, okay. That makes sense. But what happened to 4 and 5?

    If it is a dichotomous Yes/No variable named Share, my preference is to use 1=Yes, 0=No coding. So my version of Rich's code would be:

    RECODE Photos (1 2 4 = 1) (6 7 = 0) (ELSE = 9) INTO Share.
    FORMATS Share(F1).
    VALUE LABELS Share 1 "Yes" 0 "No" 9 "Missing".
    MISSING VALUES Share (9).

    With this coding, I can write code such as:

    IF Share ...
    IF NOT Share ...

    I think this is more readable than:

    IF Share EQ 1 ...
    IF Share EQ 2 ...

    YMMV!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bruce Weaver@21:1/5 to Bruce Weaver on Tue Aug 25 13:30:44 2020
    On Tuesday, August 25, 2020 at 11:23:33 AM UTC-4, Bruce Weaver wrote:
    On Tuesday, August 25, 2020 at 10:28:57 AM UTC-4, Rich Ulrich wrote:
    On Tue, 25 Aug 2020 05:37:17 -0700 (PDT), Bruce Weaver <bweaver@lakeheadu.ca> wrote:

    On Tuesday, August 25, 2020 at 6:22:50 AM UTC-4, Alba Johnsen wrote:
    Hi,
    I have a variable which has 5 values. I need to mix 1,2,3 and 6,7 together. to make a 2 variable, but I dont know how. Please help!!!

    The item is : What did you do with your photos
    1. I shared them
    2.I plan to share them
    3. I streamed when I was in the concer

    6. I didnt share it
    7. nothing


    so now I need to make a new variable with 1,2,3
    and 6,7

    to do Anova

    Please generate a small data listing of several cases that shows what the data look like now, and what you want it to look like afterwards.

    My guess is that the intention is to create a dichotomy, in
    a new variable. Thus.

    RECODE Photos(1,2,3=1)(6,7=2)(else=9) into Share .
    Value labels Share(1) share (2) not share.

    --
    Rich Ulrich

    Ah, okay. That makes sense. But what happened to 4 and 5?

    If it is a dichotomous Yes/No variable named Share, my preference is to use 1=Yes, 0=No coding. So my version of Rich's code would be:

    RECODE Photos (1 2 4 = 1) (6 7 = 0) (ELSE = 9) INTO Share.

    --- snip ---

    Oops! I meant 3 there, not 4:

    RECODE Photos (1 2 3 = 1) (6 7 = 0) (ELSE = 9) INTO Share.

    The rest of the code in my previous post is okay, I think.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)