<?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: Dummy variable in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Dummy-variable/m-p/621465#M8723</link>
    <description>Well, in actual code it is a ;</description>
    <pubDate>Fri, 31 Jan 2020 16:13:15 GMT</pubDate>
    <dc:creator>Kati</dc:creator>
    <dc:date>2020-01-31T16:13:15Z</dc:date>
    <item>
      <title>Dummy variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Dummy-variable/m-p/621457#M8721</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create dummy variable EVENT, which take value one in trading days 0 and +1, I have a column called window, which present trading days, which values goes -16 through + 16, so when window is 0 and 1, event should get value 1, and otherwise event=0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to do this?&lt;/P&gt;&lt;P&gt;I get error message that statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;I use SAS University Edition&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;have tried to do this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;event=0,&lt;/P&gt;&lt;P&gt;if window=1 or window=0 then event=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;-beginner&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 15:58:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Dummy-variable/m-p/621457#M8721</guid>
      <dc:creator>Kati</dc:creator>
      <dc:date>2020-01-31T15:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: Dummy variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Dummy-variable/m-p/621464#M8722</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/309932"&gt;@Kati&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems you have a typo -&amp;gt; the coma should be a semi-colon:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;event=0&lt;FONT color="#FF0000"&gt;, &lt;FONT color="#000000"&gt;-&amp;gt;&amp;nbsp;event=0&lt;FONT color="#339966"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;if window=1 or window=0 then event=1;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 16:11:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Dummy-variable/m-p/621464#M8722</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-01-31T16:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dummy variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Dummy-variable/m-p/621465#M8723</link>
      <description>Well, in actual code it is a ;</description>
      <pubDate>Fri, 31 Jan 2020 16:13:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Dummy-variable/m-p/621465#M8723</guid>
      <dc:creator>Kati</dc:creator>
      <dc:date>2020-01-31T16:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Dummy variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Dummy-variable/m-p/621467#M8724</link>
      <description>Seems that I have some other problem as well, can you help with that?</description>
      <pubDate>Fri, 31 Jan 2020 16:14:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Dummy-variable/m-p/621467#M8724</guid>
      <dc:creator>Kati</dc:creator>
      <dc:date>2020-01-31T16:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dummy variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Dummy-variable/m-p/621468#M8725</link>
      <description>&lt;P&gt;OK. Could you please share a sample of your data and the full data step code you are using ?&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 16:14:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Dummy-variable/m-p/621468#M8725</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-01-31T16:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dummy variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Dummy-variable/m-p/621471#M8726</link>
      <description>&lt;P&gt;Here is some code that could answer your question.&lt;/P&gt;
&lt;P&gt;Could you please compare your code ?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input window;
	datalines;
-16
1
7
0
;
run;

data want;
	set have;
	event = 0;
	if window = 0 or window = 1 then event = 1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Jan 2020 16:19:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Dummy-variable/m-p/621471#M8726</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-01-31T16:19:23Z</dc:date>
    </item>
  </channel>
</rss>

