Pages: [1]
  Print  
Author Topic: Data transformation help needed: mv long to effect coded mv wide  (Read 1669 times)
stereotaxon
Newbie
*
Posts: 10


« on: November 01, 2008, 03:03:37 AM »

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
Logged
Sebastian Land
Administrator
Hero Member
*****
Posts: 2426


« Reply #1 on: November 03, 2008, 03:10:52 PM »

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
Logged
Tobias Malbrecht
Global Moderator
Sr. Member
*****
Posts: 293



WWW
« Reply #2 on: November 03, 2008, 05:44:08 PM »

Hi,

well there is indeed an operator to convert a long to a wide data set. It is called Example2AttributePivoting. 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
Logged

Tobias Malbrecht
Director of Product Marketing
RapidMiner
stereotaxon
Newbie
*
Posts: 10


« Reply #3 on: November 04, 2008, 06:21:59 AM »

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!
Logged
Tobias Malbrecht
Global Moderator
Sr. Member
*****
Posts: 293



WWW
« Reply #4 on: November 04, 2008, 03:42:55 PM »

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
Logged

Tobias Malbrecht
Director of Product Marketing
RapidMiner
Pages: [1]
  Print  
 
Jump to: