Data transformation help needed: mv long to effect coded mv wide

stereotaxon
stereotaxon New Altair Community Member
edited November 5 in Community Q&A
Hello,

I need help with a data transformation in RapidMiner or SQL, or something along these lines.
My data are in a DB, are categorical, and are in multivariate long format.  I need help converting them to
multivariate wide format and then effect coding the categories.

data::
sub1 q1.1  "subject1 responded 1 on q1, which has three choices"
sub1 q2.2  "subject1 responded 2 on q2, which has three choices"
sub2 q1.3  "subject2 responded 3 on q1, which has three choices"
.   "subject2 did not respond to q2"


Intermediary step (may not be necessary)
subject q1 q2
sub1 1 2
sub2 3      .


desired effect coded wide format data:
sub q1.1 q1.2 q1.3 q2.1 q2.2 q2.3
sub1 1 0 0 0 1 0
sub2 0 0 1 0 0 0

Thanks for your help!
-Mike
Tagged:

Answers

  • land
    land New Altair Community Member
    Hi,
    I don't know any quick solution doing this. But you could write your own operator to do this, that's the way I would do it.

    Greetings,
      Sebastian
  • TobiasMalbrecht
    TobiasMalbrecht New Altair Community Member
    Hi,

    well there is indeed an operator to convert a long to a wide data set. It is called [tt]Example2AttributePivoting[/tt]. Unfortunately I do not fully understand the description of your data and hence do not know if the operator alone is sufficient. But maybe you can try yourself ...

    Regards,
    Tobias
  • stereotaxon
    stereotaxon New Altair Community Member
    Hi,

    `Example2AttributePivoting` is just what I need...I hope this isn't too banal a question, but where do I find the operator?  I'm using the community edition v4.2 and I can't see it in the GUI; I tried searching in the New Operator [filter] box but nothing relevant was found.

    Thanks!
  • TobiasMalbrecht
    TobiasMalbrecht New Altair Community Member
    Hi,

    I forget to mention, that it was only added recently and therefore is yet only part of the developer version of RM. This version will be published soon. That means, you either have to wait a few weeks and just download the newly published RM 4.3 then or you can check out the current developer version via CVS (check out the branch Zaniah).

    Regards,
    Tobias