<?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 a new distribution from 3 others in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Creating-a-new-distribution-from-3-others/m-p/500485#M351</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/234775"&gt;@iressa1313&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi I have used SAS to generate 3 different distributions&lt;/P&gt;
&lt;P&gt;1. N~ (0,1) with variable X&lt;FONT size="1"&gt;1&lt;/FONT&gt;.....X&lt;FONT size="1"&gt;20&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;2. N~ (5,1) with variable Y&lt;FONT size="1"&gt;1&lt;FONT size="3"&gt;.....&lt;FONT size="2"&gt;Y&lt;/FONT&gt;&lt;FONT size="1"&gt;20&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;3. B(0.5)&amp;nbsp; "bernoulli" with variable&amp;nbsp;U&lt;FONT size="1"&gt;1&lt;FONT size="2"&gt;......U&lt;FONT size="1"&gt;20&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;Now I want to create a new distribution Q where&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;Q&lt;FONT size="6"&gt; {&amp;nbsp;&lt;FONT size="2"&gt;X, if U = 0 and&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;FONT size="6"&gt;&lt;FONT size="2"&gt;Y, if U =1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT size="6"&gt;&lt;FONT size="2"&gt;How would I do this? Would I create a new dataset with all 3 variables?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT size="6"&gt;&lt;FONT size="2"&gt;Thanks for any help!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Probably, or merge existing data sets.&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;When you say &amp;nbsp;X, if U = 0 and&amp;nbsp;Y, if U =1 do you mean if U=0 and U=Y or something else? Be very explicit. Also there appears to be something missing after "If U=1 …"&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Oct 2018 17:29:24 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-10-01T17:29:24Z</dc:date>
    <item>
      <title>Creating a new distribution from 3 others</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-a-new-distribution-from-3-others/m-p/500483#M350</link>
      <description>&lt;P&gt;Hi I have used SAS to generate 3 different distributions&lt;/P&gt;&lt;P&gt;1. N~ (0,1) with variable X&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;/FONT&gt;.....X&lt;FONT size="1 2 3 4 5 6 7"&gt;20&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;2. N~ (5,1) with variable Y&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;FONT size="3"&gt;.....&lt;FONT size="2"&gt;Y&lt;/FONT&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;20&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;3. B(0.5)&amp;nbsp; "bernoulli" with variable&amp;nbsp;U&lt;FONT size="1"&gt;1&lt;FONT size="2"&gt;......U&lt;FONT size="1 2 3 4 5 6 7"&gt;20&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Now I want to create a new distribution Q where&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Q&lt;FONT size="6"&gt; {&amp;nbsp;&lt;FONT size="2"&gt;X, if U = 0 and&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;FONT size="6"&gt;&lt;FONT size="2"&gt;Y, if U =1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT size="6"&gt;&lt;FONT size="2"&gt;How would I do this? Would I create a new dataset with all 3 variables?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT size="6"&gt;&lt;FONT size="2"&gt;Thanks for any help!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 17:22:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-a-new-distribution-from-3-others/m-p/500483#M350</guid>
      <dc:creator>iressa1313</dc:creator>
      <dc:date>2018-10-01T17:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a new distribution from 3 others</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-a-new-distribution-from-3-others/m-p/500485#M351</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/234775"&gt;@iressa1313&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi I have used SAS to generate 3 different distributions&lt;/P&gt;
&lt;P&gt;1. N~ (0,1) with variable X&lt;FONT size="1"&gt;1&lt;/FONT&gt;.....X&lt;FONT size="1"&gt;20&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;2. N~ (5,1) with variable Y&lt;FONT size="1"&gt;1&lt;FONT size="3"&gt;.....&lt;FONT size="2"&gt;Y&lt;/FONT&gt;&lt;FONT size="1"&gt;20&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;3. B(0.5)&amp;nbsp; "bernoulli" with variable&amp;nbsp;U&lt;FONT size="1"&gt;1&lt;FONT size="2"&gt;......U&lt;FONT size="1"&gt;20&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;Now I want to create a new distribution Q where&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;Q&lt;FONT size="6"&gt; {&amp;nbsp;&lt;FONT size="2"&gt;X, if U = 0 and&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;FONT size="6"&gt;&lt;FONT size="2"&gt;Y, if U =1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT size="6"&gt;&lt;FONT size="2"&gt;How would I do this? Would I create a new dataset with all 3 variables?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT size="6"&gt;&lt;FONT size="2"&gt;Thanks for any help!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Probably, or merge existing data sets.&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;When you say &amp;nbsp;X, if U = 0 and&amp;nbsp;Y, if U =1 do you mean if U=0 and U=Y or something else? Be very explicit. Also there appears to be something missing after "If U=1 …"&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 17:29:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-a-new-distribution-from-3-others/m-p/500485#M351</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-01T17:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a new distribution from 3 others</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-a-new-distribution-from-3-others/m-p/500489#M352</link>
      <description>&lt;P&gt;You'll need to describe the data sets you have a little more.&amp;nbsp; For example, in the X data set:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have 20 observations, each with a value for the variable X?&amp;nbsp; (If so, is there a separate variable taking on values 1 through 20?)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have 1 observation, with variables named x1 through x20?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have many observations, each with variables named x1 through x20?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It can't be all that difficult to compute Q, but it's a whole lot easier to program it once instead of three times.&amp;nbsp; So describe the input a bit more.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 17:40:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-a-new-distribution-from-3-others/m-p/500489#M352</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-10-01T17:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a new distribution from 3 others</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-a-new-distribution-from-3-others/m-p/500569#M369</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/234775"&gt;@iressa1313&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would keep&amp;nbsp;it simple and create a new dataset with all &lt;EM&gt;four&lt;/EM&gt; variables:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
call streaminit(27182818);
do _n_=1 to 20;
  x=rand('norm');     /* X ~ N(0,1)     */
  y=rand('norm',5);   /* Y ~ N(5,1)     */
  u=rand('bern',0.5); /* U ~ Bin(1,0.5) */
  q=ifn(u,y,x);       /* normal mixture */
  output;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or is there something special about your existing "distribution datasets" that you don't want to discard them?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 21:46:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-a-new-distribution-from-3-others/m-p/500569#M369</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-01T21:46:22Z</dc:date>
    </item>
  </channel>
</rss>

