<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I script a recode into new column function? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-script-a-recode-into-new-column-function/m-p/51379#M29125</link>
    <description>&lt;P&gt;Do&amp;nbsp;the "Serial Numbers" for each question equate to the same "rank"?&amp;nbsp; Is there a table that has the relationship between the "Serial Numbers" and the "ranks"?&amp;nbsp; Or when you say "ranks", do you want to some how calcualte a statistical ranking?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you possibly provide a small sample of your initial data table and what you need as your final results?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Feb 2018 13:56:39 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2018-02-15T13:56:39Z</dc:date>
    <item>
      <title>How do I script a recode into new column function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-script-a-recode-into-new-column-function/m-p/51362#M29124</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been searching for an answer for this for a few hours, but oddly can't find one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have data that represents the serial numbers of the answers a person has given each question. I need to recode the serial number into ranks, but keep the original answers. I need to do that for 90 questions (where each answer has a different serial number). What is the best way to do that? The&amp;nbsp;only way I could think of was writing a script for each question, I just need to know how to write in the script to recode it into a new column. Any suggestions will be most appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 08:58:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-script-a-recode-into-new-column-function/m-p/51362#M29124</guid>
      <dc:creator>Miki</dc:creator>
      <dc:date>2018-02-15T08:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I script a recode into new column function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-script-a-recode-into-new-column-function/m-p/51379#M29125</link>
      <description>&lt;P&gt;Do&amp;nbsp;the "Serial Numbers" for each question equate to the same "rank"?&amp;nbsp; Is there a table that has the relationship between the "Serial Numbers" and the "ranks"?&amp;nbsp; Or when you say "ranks", do you want to some how calcualte a statistical ranking?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you possibly provide a small sample of your initial data table and what you need as your final results?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 13:56:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-script-a-recode-into-new-column-function/m-p/51379#M29125</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-02-15T13:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I script a recode into new column function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-script-a-recode-into-new-column-function/m-p/51382#M29127</link>
      <description>&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;Each question has 5 possible answers differing from question to question,&amp;nbsp;and the ranking of the answers is always 1-5. But, like I said, due to the nature of the excell file, each answer only has a serial number and not its rank. What I need to do is to fit a rank for each answer. I have the rankings on the test itself (not on a table).&lt;/P&gt;&lt;P&gt;I really don't see a way to do this other than to script a recode command, and then manually write it in for each question. Am I wrong?&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is important though, that I don't lose the original data, so I need to recode it into new columns. How do I add that into the script?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data looks something like that:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;subject number&lt;/TD&gt;&lt;TD&gt;Question 1&lt;/TD&gt;&lt;TD&gt;Question 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;40042&lt;/TD&gt;&lt;TD&gt;33157&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;40041&lt;/TD&gt;&lt;TD&gt;33154&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;40043&lt;/TD&gt;&lt;TD&gt;33156&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;40042&lt;/TD&gt;&lt;TD&gt;33156&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;40044&lt;/TD&gt;&lt;TD&gt;33155&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;40045&lt;/TD&gt;&lt;TD&gt;33153&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 14:18:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-script-a-recode-into-new-column-function/m-p/51382#M29127</guid>
      <dc:creator>Miki</dc:creator>
      <dc:date>2018-02-15T14:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I script a recode into new column function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-script-a-recode-into-new-column-function/m-p/51385#M29128</link>
      <description>&lt;P&gt;You can easily do what you want, by just building a table where you match up the serial number with it's ranking&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;40041&lt;/TD&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;40042&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;40043&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;40044&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;33151&lt;/TD&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;33152&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;33153&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, what you do is read in that table.&lt;/P&gt;
&lt;P&gt;Next take your questions data table and stack all 90 questions using&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Tables==&amp;gt;Stack&lt;/P&gt;
&lt;P&gt;This will create a new table with a column called Label and one called Data.&amp;nbsp; Label will contain the column name from the original table, and Data will contain the serial number.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then what you do, is to use&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Tables==&amp;gt;Join&lt;/P&gt;
&lt;P&gt;to put the stacked question data together with the ranks data.&amp;nbsp; If you indicate to the Join platform to match the Serial Number column from the ranks data table, with the Data column in the stacked table, JMP will create a new table with the data matched up.&lt;/P&gt;
&lt;P&gt;Now all you have to do is to use&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Tables==&amp;gt;Split&lt;/P&gt;
&lt;P&gt;to transform the newly joined table back into the original shaped data table.&amp;nbsp; You will end up with a data table with both the original serial number and the ranks data&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 14:59:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-script-a-recode-into-new-column-function/m-p/51385#M29128</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-02-15T14:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I script a recode into new column function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-script-a-recode-into-new-column-function/m-p/51440#M29165</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;so much!! That is really helpful. I'll try doing that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In any case, do you happen to know how I insert the "new column" to a script of recode? This will be helpful with other data as well.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2018 11:07:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-script-a-recode-into-new-column-function/m-p/51440#M29165</guid>
      <dc:creator>Miki</dc:creator>
      <dc:date>2018-02-16T11:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I script a recode into new column function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-script-a-recode-into-new-column-function/m-p/51442#M29166</link>
      <description>&lt;P&gt;There are 2 sources of documentation on JSL provided to you when JMP is installed, the Scripting Guide and the Scripting Index.&amp;nbsp; If you are going to be using JSL, you need to become familiar with both of these.&lt;/P&gt;
&lt;P&gt;If you go into the Scripting Index&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Help==&amp;gt;Scripting Index&lt;/P&gt;
&lt;P&gt;And then scroll down to&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Data Table==&amp;gt;Data Table Cols&lt;/P&gt;
&lt;P&gt;You will see both the definition of the New Column() function, and at lease 1 example for the function&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="newcolumn.PNG" style="width: 897px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9369i7C63236EA07E27F4/image-size/large?v=v2&amp;amp;px=999" role="button" title="newcolumn.PNG" alt="newcolumn.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2018 11:16:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-script-a-recode-into-new-column-function/m-p/51442#M29166</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-02-16T11:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I script a recode into new column function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-script-a-recode-into-new-column-function/m-p/51443#M29167</link>
      <description>&lt;P&gt;A non-scripting option is also available.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Under the Columns &amp;gt; Recode you should see a "Done" button up in the right hand corner of the dialog box.&amp;nbsp; That is essentially a drop down menu that lists 4 choices for saving your recoded data.&lt;/P&gt;
&lt;P&gt;In Place, New Column, Formula Column and Script.&amp;nbsp; Choosing the first option will overwrite your original data, the next two will create a new column and so on.&amp;nbsp; The Formula Column is a nice option because it creates a formula for what you have recoded.&amp;nbsp; This gives you a record of what and how you chose to recode your data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH&lt;/P&gt;
&lt;P&gt;Bill&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2018 11:49:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-script-a-recode-into-new-column-function/m-p/51443#M29167</guid>
      <dc:creator>Bill_Worley</dc:creator>
      <dc:date>2018-02-16T11:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I script a recode into new column function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-script-a-recode-into-new-column-function/m-p/51555#M29224</link>
      <description>Thank you again. You have helped me tremendously</description>
      <pubDate>Mon, 19 Feb 2018 20:39:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-script-a-recode-into-new-column-function/m-p/51555#M29224</guid>
      <dc:creator>Miki</dc:creator>
      <dc:date>2018-02-19T20:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I script a recode into new column function?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-script-a-recode-into-new-column-function/m-p/51556#M29225</link>
      <description>Thank you. I'll look into that option as well. I know all the other three, but didn't know what the formula was for.</description>
      <pubDate>Mon, 19 Feb 2018 20:41:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-script-a-recode-into-new-column-function/m-p/51556#M29225</guid>
      <dc:creator>Miki</dc:creator>
      <dc:date>2018-02-19T20:41:18Z</dc:date>
    </item>
  </channel>
</rss>

