<?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 SAS book Chapter 2 problem in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/SAS-book-Chapter-2-problem/m-p/433951#M4561</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; I am new to SAS and wanted to get some feedback on a problem. I am only in Chapter 2 so I have a lot to learn still. I am stuck on a problem and need help to understand how the code should be formatted. I think my order of operations is off with the math portion causing errors. See below, for the scenario the book has listed and the code I entered. I appreciate any feedback! I don't want to get discouraged and give up but I don't have a teacher to explain these things to me either. PLEASE HELP!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Given the program here, add the necessary statements to compute four new variables:&lt;/P&gt;&lt;P&gt;a. Weight in kilograms (1 kg=2.2 pounds). Name this variable WtKg.&lt;/P&gt;&lt;P&gt;b. Height in centimeters (1 inch=2.54 cm). Name this variable HtCm.&lt;/P&gt;&lt;P&gt;c. Average blood pressure (call it AveBP) equal to the diastolic blood pressure plus one-third the difference of the systolic blood pressure minus the diastolic blood pressure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;d. A variable (call it HtPolynomial) equal to 2 times the height squared plus 1.5 times the height cubed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data prob2;&lt;BR /&gt;input ID$&lt;BR /&gt;Height /* in inches */&lt;BR /&gt;Weight /* in pounds */&lt;BR /&gt;SBP /* systolic BP */&lt;BR /&gt;DBP /* diastolic BP */;&lt;BR /&gt;HtCm=1 inch = 2.54 cm;&lt;BR /&gt;WtKg=1 kg = 2.2 pounds;&lt;BR /&gt;AveBP=DBP+1/3(SBP-DBP);&lt;BR /&gt;HtPolynomial=2*HtCm**+1.5*HtCm***;&lt;BR /&gt;cards;&lt;BR /&gt;001 68 150 110 70&lt;BR /&gt;002 73 240 150 90&lt;BR /&gt;003 62 101 120 80&lt;BR /&gt;;&lt;BR /&gt;title 'listing of prob2';&lt;BR /&gt;proc print data=prob2;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Feb 2018 15:03:07 GMT</pubDate>
    <dc:creator>ferlopz298</dc:creator>
    <dc:date>2018-02-06T15:03:07Z</dc:date>
    <item>
      <title>SAS book Chapter 2 problem</title>
      <link>https://communities.sas.com/t5/SAS-Studio/SAS-book-Chapter-2-problem/m-p/433951#M4561</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; I am new to SAS and wanted to get some feedback on a problem. I am only in Chapter 2 so I have a lot to learn still. I am stuck on a problem and need help to understand how the code should be formatted. I think my order of operations is off with the math portion causing errors. See below, for the scenario the book has listed and the code I entered. I appreciate any feedback! I don't want to get discouraged and give up but I don't have a teacher to explain these things to me either. PLEASE HELP!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Given the program here, add the necessary statements to compute four new variables:&lt;/P&gt;&lt;P&gt;a. Weight in kilograms (1 kg=2.2 pounds). Name this variable WtKg.&lt;/P&gt;&lt;P&gt;b. Height in centimeters (1 inch=2.54 cm). Name this variable HtCm.&lt;/P&gt;&lt;P&gt;c. Average blood pressure (call it AveBP) equal to the diastolic blood pressure plus one-third the difference of the systolic blood pressure minus the diastolic blood pressure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;d. A variable (call it HtPolynomial) equal to 2 times the height squared plus 1.5 times the height cubed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data prob2;&lt;BR /&gt;input ID$&lt;BR /&gt;Height /* in inches */&lt;BR /&gt;Weight /* in pounds */&lt;BR /&gt;SBP /* systolic BP */&lt;BR /&gt;DBP /* diastolic BP */;&lt;BR /&gt;HtCm=1 inch = 2.54 cm;&lt;BR /&gt;WtKg=1 kg = 2.2 pounds;&lt;BR /&gt;AveBP=DBP+1/3(SBP-DBP);&lt;BR /&gt;HtPolynomial=2*HtCm**+1.5*HtCm***;&lt;BR /&gt;cards;&lt;BR /&gt;001 68 150 110 70&lt;BR /&gt;002 73 240 150 90&lt;BR /&gt;003 62 101 120 80&lt;BR /&gt;;&lt;BR /&gt;title 'listing of prob2';&lt;BR /&gt;proc print data=prob2;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 15:03:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/SAS-book-Chapter-2-problem/m-p/433951#M4561</guid>
      <dc:creator>ferlopz298</dc:creator>
      <dc:date>2018-02-06T15:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: Learning SAS by Example: A Programmer's Guide Chapter 2 problem</title>
      <link>https://communities.sas.com/t5/SAS-Studio/SAS-book-Chapter-2-problem/m-p/433955#M4562</link>
      <description>&lt;P&gt;I'll show you the proper code for converting height to cm. You can take that and figure out the other ones.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;HtCm=2.54 * height;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2018 12:50:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/SAS-book-Chapter-2-problem/m-p/433955#M4562</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-02-04T12:50:28Z</dc:date>
    </item>
  </channel>
</rss>

