+ Reply to Thread
Results 1 to 2 of 2

Thread: Help with cleaning up data set

  1. #1
    Points: 182, Level: 3
    Level completed: 64%, Points required for next Level: 18

    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry Help with cleaning up data set



    I am working with an interesting data set, however I am having difficulty cleaning it up due to certain imported formatting issues I am encountering.

    The data set is expanded with multiple columns indicating response to surveys. I am trying to condense the data set columns in SAS to have responses to each question unique to each column.I am a little confused on where to start for the coding. For instance:

    Data set now:
    Grade
    K 1 2 3 4
    1
    2
    3
    4
    4

    ____________________
    I would like to have

    Grade
    1
    2
    3
    4
    4

    Any ideas?

    I have attached a sample data set in XLS format. Any help would be greatly appreciated!
    Attached Files
    Last edited by slivingston; 05-07-2012 at 01:05 PM.

  2. #2
    Points: 409, Level: 8
    Level completed: 18%, Points required for next Level: 41
    geosun's Avatar
    Posts
    50
    Thanks
    3
    Thanked 7 Times in 7 Posts

    Re: Help with cleaning up data set


    LESSON 3: WIDE FILE AND RESULTING TRANSPOSED NARROW FILES

    support.sas.com

    edit: actually no just do:

    %macro create(n)
    %do i=1 %to &n.;
    data &i.;
    set data(keep=&i.);
    rename &i.=grade;
    run;
    %end;
    %mend;
    %create(12)

    then merge them together with 1 to 1 reading

    data all;
    set 1;
    set 2;
    ....
    run;
    Last edited by geosun; 05-07-2012 at 04:29 PM.
    I can prove anything with statistics except the truth

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts








Advertise on Talk Stats