<?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 Help writing code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-writing-code/m-p/621325#M182653</link>
    <description>&lt;P&gt;I need help writting my code correctly as a two sample t test (proc ttest). The way I have it right now it has an error and my professor wants us to write the code using proc ttest, but I am not sure how.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data name;
	input one two @@;
	cards;
	16.03 16.02 16.04 15.97 16.05 15.96 16.05 16.01 16.02 15.99
	16.01 16.03 15.96 16.04 15.98 16.02 16.02 16.01 15.99 16.00
	;
proc ttest data=name;
	class one;
	var two;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 30 Jan 2020 22:13:48 GMT</pubDate>
    <dc:creator>abudyak</dc:creator>
    <dc:date>2020-01-30T22:13:48Z</dc:date>
    <item>
      <title>Help writing code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-writing-code/m-p/621325#M182653</link>
      <description>&lt;P&gt;I need help writting my code correctly as a two sample t test (proc ttest). The way I have it right now it has an error and my professor wants us to write the code using proc ttest, but I am not sure how.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data name;
	input one two @@;
	cards;
	16.03 16.02 16.04 15.97 16.05 15.96 16.05 16.01 16.02 15.99
	16.01 16.03 15.96 16.04 15.98 16.02 16.02 16.01 15.99 16.00
	;
proc ttest data=name;
	class one;
	var two;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Jan 2020 22:13:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-writing-code/m-p/621325#M182653</guid>
      <dc:creator>abudyak</dc:creator>
      <dc:date>2020-01-30T22:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Help writing code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-writing-code/m-p/621328#M182655</link>
      <description>&lt;P&gt;Re posting the exact same question does not change the answers you will get.&lt;/P&gt;
&lt;P&gt;Provide more details on what you tried based on the responses to your earlier question.&lt;/P&gt;
&lt;P&gt;Also please EXPLAIN what your two rows of data mean.&amp;nbsp; Right now you are reading the as alternating between two variables named ONE and TWO.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to run a TTEST you need to groups.&amp;nbsp; Let's call those two groups A and B.&amp;nbsp; Is your data really in the order&lt;/P&gt;
&lt;PRE&gt;A B A B A B A B A B 
A B A B A B A B A B &lt;/PRE&gt;
&lt;P&gt;So you want to compare the even numbered values to the odd numbered values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or is the data really in this order:&lt;/P&gt;
&lt;PRE&gt;A A A A A A A A A A
B B B B B B B B B B&lt;/PRE&gt;
&lt;P&gt;So that you want to test if the values in the first line are different than the values in second line.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 22:24:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-writing-code/m-p/621328#M182655</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-01-30T22:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Help writing code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-writing-code/m-p/621330#M182656</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;I understand what you were saying in the other post, but I am still struggling with writing code because I have never used sas before or any program really and now it is being used in my math class.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data order is :&lt;/P&gt;&lt;P&gt;A B A B A B...&lt;/P&gt;&lt;P&gt;A B A B A B...&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 22:45:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-writing-code/m-p/621330#M182656</guid>
      <dc:creator>abudyak</dc:creator>
      <dc:date>2020-01-30T22:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Help writing code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-writing-code/m-p/621331#M182657</link>
      <description>&lt;P&gt;So read them the value one by one and toggle the group counter between two different values.&lt;/P&gt;
&lt;P&gt;For example you could just do :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
  do group=1,2 ;
    input value @@ ;
    output;
  end;
cards;
10 20 30 40 
;
proc ttest data=have;
  class group;
  var value;
run;    &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So the DO loop says to set GROUP=1 , then read a value using the double&amp;nbsp;@@ to hold the line so next read starts where this one ended.&amp;nbsp; Then it uses the OUTPUT statement to write an observation.&amp;nbsp; Then the DO loop will set GROUP=2 and do it again.&amp;nbsp; This will continue until it runs out of data to read.&amp;nbsp; Now you have a dataset with two variable GROUP with values 1 and 2 and VALUE with the numbers read from the data lines.&lt;/P&gt;
&lt;P&gt;Just replace my dummy data with your data and run it.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 22:52:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-writing-code/m-p/621331#M182657</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-01-30T22:52:25Z</dc:date>
    </item>
  </channel>
</rss>

