<?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: How to compare variables for same patient pre and post exposure in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-compare-variables-for-same-patient-pre-and-post-exposure/m-p/685282#M207819</link>
    <description>So you don't want to compare averages. I don't know what analysis you do want. Can you show what you want as an analysis for your small example?</description>
    <pubDate>Sun, 20 Sep 2020 18:52:18 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-09-20T18:52:18Z</dc:date>
    <item>
      <title>How to compare variables for same patient pre and post exposure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-compare-variables-for-same-patient-pre-and-post-exposure/m-p/685277#M207815</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;
&lt;P&gt;The following table is a sample of my data set where the patients are the control before diagnosis and are the case after diagnosis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="70px" height="85px"&gt;
&lt;P&gt;New_id&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="85px"&gt;
&lt;P&gt;A1C pre&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="85px"&gt;
&lt;P&gt;A1C Cat pre&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="85px"&gt;
&lt;P&gt;A1C post&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="85px"&gt;
&lt;P&gt;A1C Cat post&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="70px" height="30px"&gt;
&lt;P&gt;A&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;7&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;6&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="70px" height="30px"&gt;
&lt;P&gt;B&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;8&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="70px" height="30px"&gt;
&lt;P&gt;C&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;9&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="70px" height="30px"&gt;
&lt;P&gt;D&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;10&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;17&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="70px" height="30px"&gt;
&lt;P&gt;E&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="70px" height="30px"&gt;
&lt;P&gt;F&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;8&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;7&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to compare between the readings of A1C pre and post for each patient, to know if the exposure had an effect on the A1C level and if there is a significance difference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your help&lt;/P&gt;</description>
      <pubDate>Sun, 20 Sep 2020 17:51:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-compare-variables-for-same-patient-pre-and-post-exposure/m-p/685277#M207815</guid>
      <dc:creator>ALAA1</dc:creator>
      <dc:date>2020-09-20T17:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare variables for same patient pre and post exposure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-compare-variables-for-same-patient-pre-and-post-exposure/m-p/685279#M207817</link>
      <description>You don't actually say this, in fact you say something different, so I feel a need to ask. Do you want to compare the average of the pre to the average of the post?</description>
      <pubDate>Sun, 20 Sep 2020 18:19:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-compare-variables-for-same-patient-pre-and-post-exposure/m-p/685279#M207817</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-09-20T18:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare variables for same patient pre and post exposure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-compare-variables-for-same-patient-pre-and-post-exposure/m-p/685281#M207818</link>
      <description>thank you for your reply.&lt;BR /&gt;&lt;BR /&gt;Not really!&lt;BR /&gt;I will explain more &lt;BR /&gt;each patient is a control before exposure (diagnosis) and after exposure (diagnosis) is become a case ( within patient comparison).&lt;BR /&gt;So, each patient has one reading as a control which is A1C pre (actual reading) and A1C cat pre (category) and one reading as a case which is A1C post (actual reading) and A1C cat post  (category).&lt;BR /&gt;&lt;BR /&gt;I hope you that I explained it well.</description>
      <pubDate>Sun, 20 Sep 2020 18:35:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-compare-variables-for-same-patient-pre-and-post-exposure/m-p/685281#M207818</guid>
      <dc:creator>ALAA1</dc:creator>
      <dc:date>2020-09-20T18:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare variables for same patient pre and post exposure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-compare-variables-for-same-patient-pre-and-post-exposure/m-p/685282#M207819</link>
      <description>So you don't want to compare averages. I don't know what analysis you do want. Can you show what you want as an analysis for your small example?</description>
      <pubDate>Sun, 20 Sep 2020 18:52:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-compare-variables-for-same-patient-pre-and-post-exposure/m-p/685282#M207819</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-09-20T18:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare variables for same patient pre and post exposure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-compare-variables-for-same-patient-pre-and-post-exposure/m-p/685283#M207820</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/322510"&gt;@ALAA1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi All&lt;/P&gt;
&lt;P&gt;The following table is a sample of my data set where the patients are the control before diagnosis and are the case after diagnosis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="70px" height="85px"&gt;
&lt;P&gt;New_id&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="85px"&gt;
&lt;P&gt;A1C pre&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="85px"&gt;
&lt;P&gt;A1C Cat pre&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="85px"&gt;
&lt;P&gt;A1C post&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="85px"&gt;
&lt;P&gt;A1C Cat post&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="70px" height="30px"&gt;
&lt;P&gt;A&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;7&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;6&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="70px" height="30px"&gt;
&lt;P&gt;B&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;8&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="70px" height="30px"&gt;
&lt;P&gt;C&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;9&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="70px" height="30px"&gt;
&lt;P&gt;D&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;10&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;17&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="70px" height="30px"&gt;
&lt;P&gt;E&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="70px" height="30px"&gt;
&lt;P&gt;F&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;8&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="52px" height="30px"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;7&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="54px" height="30px"&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to compare between the readings of A1C pre and post for each patient, &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;to know if the exposure had an effect on the A1C level and if there is a significance difference.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your help&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Typically to make any statistically reliable statement about what I have highlighted in blue above you have to include all of the patients. One of the typical tests would be to test if the mean difference across all patients, or subgroups of patients such as gender, age or some such, is larger or smaller. One the tests used for such is a Paired t-test which tests if the mean difference between the before and after is 0 or not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another test might be a sign test, compare the before/after just in a larger/smaller way (magnitude makes no difference). This basically tests whether there is any difference in before/after.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you use all of the patients. Why do you think they bothered to collect data from more than one patient?&lt;/P&gt;</description>
      <pubDate>Sun, 20 Sep 2020 19:02:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-compare-variables-for-same-patient-pre-and-post-exposure/m-p/685283#M207820</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-09-20T19:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare variables for same patient pre and post exposure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-compare-variables-for-same-patient-pre-and-post-exposure/m-p/685287#M207822</link>
      <description>&lt;P&gt;To perform paired post-pre tests, create new variables for the change in values and test for location with proc univariate:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input New_id $ A1Cpre A1CcatPre A1Cpost A1CcatPost;
datalines;
A   7   0   6   0
B   .   .   8   0
C   9   1   .   .
D   10  2   17  3
E   .   .   .   .
F   8   0   7   0
;

data change;
set have;
A1Cchange = A1Cpost - A1cpre;
A1CcatChange = A1CcatPost - A1CcatPre;
run;

proc univariate data=change;
var A1Cchange A1CcatChange;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Look at the &lt;EM&gt;&lt;STRONG&gt;Tests for Location&lt;/STRONG&gt;&lt;/EM&gt; table.&lt;/P&gt;
&lt;P&gt;Note: this is assuming that both your variables are ordinal.&lt;/P&gt;</description>
      <pubDate>Sun, 20 Sep 2020 20:58:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-compare-variables-for-same-patient-pre-and-post-exposure/m-p/685287#M207822</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-09-20T20:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare variables for same patient pre and post exposure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-compare-variables-for-same-patient-pre-and-post-exposure/m-p/685538#M207931</link>
      <description>thank you for your reply&lt;BR /&gt;please can provide me with the codes of paired t test?&lt;BR /&gt;and should I multiple impute the missing data?</description>
      <pubDate>Mon, 21 Sep 2020 20:29:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-compare-variables-for-same-patient-pre-and-post-exposure/m-p/685538#M207931</guid>
      <dc:creator>ALAA1</dc:creator>
      <dc:date>2020-09-21T20:29:13Z</dc:date>
    </item>
  </channel>
</rss>

