<?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: Creating three new variables in a panel ? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Creating-three-new-variables-in-a-panel/m-p/675206#M23607</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/340611"&gt;@AntonioFinn&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;DIV class="forum-topic-flex-article"&gt;
&lt;DIV class="forum-article"&gt;
&lt;DIV class="forum-post"&gt;
&lt;DIV class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation"&gt;
&lt;DIV class="lia-message-body-content"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. I have several variables which are in percentage (they have been calculated using avg() format=percent7.2 ). I need to convert these to numbers. so for example&amp;nbsp;91.70% should be converted to 0.917.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks so much in advance for your help.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;once more: a format only changes how a variable is displayed, not the value of the variable.So removing the format from the variable should solve that issue.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Aug 2020 10:28:38 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2020-08-07T10:28:38Z</dc:date>
    <item>
      <title>Creating three new variables in a panel ?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-three-new-variables-in-a-panel/m-p/675085#M23594</link>
      <description>&lt;DIV class="forum-topic-flex-article"&gt;&lt;DIV class="forum-article"&gt;&lt;DIV class="forum-post"&gt;&lt;DIV class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;I have a panel dataset which includes weekly data for several brands across four years (250 observations per brand). I appreciate if you help me with doing the following three things (I apologize in advance if I shouldn't ask multiple questions under one topic). Also sorry I cannot share a sample of my data due to NDA.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. My dataset includes a column named "brand_name". I want to create a new column ("id") which uniquely identifies each brand. So it should take on the same value for all the 250 rows associated with each brand.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. I need a new variable which assigns a number (from 1 to 250) to each observation for each brand. My dataset includes two columns "Year0" and "week". For each brand, my data starts from the 6th week of 2014 up until 52nd week of 2014. Then, from week 0 of 2015 to week 52 of 2015, and so on. In other words, when "Year0" is 2014, "week" starts from 6 all the way to 52. Then for the next row, in which "Year0" is 2015,&amp;nbsp;"week" is 0 (so the variable week starts over with a change in Year0). The new variable should assign 1 whenever Year0 is 2014 and week is 6, and continue this until the last observation, for which it should be 250.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. I have several variables which are in percentage (they have been calculated using avg() format=percent7.2 ). I need to convert these to numbers. so for example&amp;nbsp;91.70% should be converted to 0.917.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much in advance for your help.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="KudosButton lia-button-image-kudos-wrapper lia-component-kudos-widget-button-version-3 lia-component-kudos-widget-button-horizontal lia-component-kudos-widget-button lia-component-kudos-action lia-component-message-view-widget-kudos-action"&gt;&lt;DIV class="lia-button-image-kudos lia-button-image-kudos-horizontal lia-button-image-kudos-enabled lia-button-image-kudos-not-kudoed lia-button"&gt;&lt;DIV class="lia-button-image-kudos-count"&gt;&lt;SPAN class="lia-link-navigation kudos-count-link lia-link-disabled"&gt;&lt;SPAN class="MessageKudosCount lia-component-kudos-widget-message-kudos-count"&gt;0&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-button-image-kudos-label lia-component-kudos-widget-kudos-count-label"&gt;Likes&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-button-image-kudos-give"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 Aug 2020 17:52:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-three-new-variables-in-a-panel/m-p/675085#M23594</guid>
      <dc:creator>AntonioFinn</dc:creator>
      <dc:date>2020-08-06T17:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Creating three new variables in a panel ?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-three-new-variables-in-a-panel/m-p/675093#M23595</link>
      <description>&lt;P&gt;Sort by brand, year and week.&lt;/P&gt;
&lt;P&gt;Then run a data step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
by brand;
retain id count 0;
if first.brand
then do;
  id + 1;
  count = 1;
end;
else count + 1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To display the percent value in its raw form, just change the format to a "normal" one like 8.3.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 18:14:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-three-new-variables-in-a-panel/m-p/675093#M23595</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-08-06T18:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: Creating three new variables in a panel ?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-three-new-variables-in-a-panel/m-p/675206#M23607</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/340611"&gt;@AntonioFinn&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;DIV class="forum-topic-flex-article"&gt;
&lt;DIV class="forum-article"&gt;
&lt;DIV class="forum-post"&gt;
&lt;DIV class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation"&gt;
&lt;DIV class="lia-message-body-content"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. I have several variables which are in percentage (they have been calculated using avg() format=percent7.2 ). I need to convert these to numbers. so for example&amp;nbsp;91.70% should be converted to 0.917.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks so much in advance for your help.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;once more: a format only changes how a variable is displayed, not the value of the variable.So removing the format from the variable should solve that issue.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2020 10:28:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-three-new-variables-in-a-panel/m-p/675206#M23607</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-08-07T10:28:38Z</dc:date>
    </item>
  </channel>
</rss>

