<?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: Create MANY new variables for differences between time points (continuous measure) in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/779869#M31582</link>
    <description>&lt;P&gt;Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the &amp;lt;/&amp;gt; icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or look at other posts on the forum where data step code is included.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Nov 2021 22:29:25 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-11-11T22:29:25Z</dc:date>
    <item>
      <title>Create MANY new variables for differences between time points (continuous measure)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/779682#M31564</link>
      <description>&lt;P&gt;I have a dataset from a small RCT w/ 2 groups, 3 timepoints and &amp;gt; 80 continuous dependent variables. The analysis plan calls for two-sided independent samples t-tests for most of the dependent variables, w/ adjustment for multiple comparisons.*&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I plan to use PROC TTEST to compare the mean change from each time point to the others for EACH dependent variable across the 2 groups.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I’m assuming I need to create new variables to represent the mean change between time points.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example: Dependent Variable = Blood Pressure (BP) for Group A&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BP_timepoint_1&lt;/P&gt;
&lt;P&gt;BP_timepoint_2&lt;/P&gt;
&lt;P&gt;BP_timepoint_3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Change_BP_timepoint_1_2 = BP_timepoint_1 - BP_timepoint_2&lt;/P&gt;
&lt;P&gt;Change_BP_timepoint_1_3 = BP_timepoint_1 - BP_timepoint_3&lt;/P&gt;
&lt;P&gt;Change_BP_timepoint_2_3 = BP_timepoint_2 - BP_timepoint_3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the best way - for a novice SAS user - to efficiently create a large number of new variables to represent the differences between time points for each of the dependent variables?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;* I realize that running all these t-tests is inefficient, but that is what I have been asked to do. If you think I should use PROC GLM or PROC MIXED, instead, would I still need to create all these new variables with those approaches? I have no experience w/ either approach…&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 23:59:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/779682#M31564</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2021-11-10T23:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Create MANY new variables for differences between time points (continuous measure)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/779690#M31568</link>
      <description>&lt;P&gt;Here's a tutorial on using Arrays in SAS&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/seminars/sas-arrays/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/seminars/sas-arrays/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could use an array to calculate the differences but if all your values are numeric it may also make sense to transpose your data so you can use BY group processing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Switch your data to a format such as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Variable Time1 Time2 Time3;
BP 120 140 125
...
...&lt;/PRE&gt;
&lt;P&gt;Then you can use BY in PROC TTEST to do all tests at once.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc ttest data=long_form;
by variable;
paired time1*time2;
paired time2*time3;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/36911"&gt;@_maldini_&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a dataset from a small RCT w/ 2 groups, 3 timepoints and &amp;gt; 80 continuous dependent variables. The analysis plan calls for two-sided independent samples t-tests for most of the dependent variables, w/ adjustment for multiple comparisons.*&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I plan to use PROC TTEST to compare the mean change from each time point to the others for EACH dependent variable across the 2 groups.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I’m assuming I need to create new variables to represent the mean change between time points.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example: Dependent Variable = Blood Pressure (BP) for Group A&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BP_timepoint_1&lt;/P&gt;
&lt;P&gt;BP_timepoint_2&lt;/P&gt;
&lt;P&gt;BP_timepoint_3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Change_BP_timepoint_1_2 = BP_timepoint_1 - BP_timepoint_2&lt;/P&gt;
&lt;P&gt;Change_BP_timepoint_1_3 = BP_timepoint_1 - BP_timepoint_3&lt;/P&gt;
&lt;P&gt;Change_BP_timepoint_2_3 = BP_timepoint_2 - BP_timepoint_3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the best way - for a novice SAS user - to efficiently create a large number of new variables to represent the differences between time points for each of the dependent variables?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;* I realize that running all these t-tests is inefficient, but that is what I have been asked to do. If you think I should use PROC GLM or PROC MIXED, instead, would I still need to create all these new variables with those approaches? I have no experience w/ either approach…&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 01:54:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/779690#M31568</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-11-11T01:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Create MANY new variables for differences between time points (continuous measure)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/779691#M31569</link>
      <description>&lt;P&gt;Some example data. Or at a minimum the output from Proc Contents so we have a usable description of your variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may end up reshaping data as what I think you are describing can get extremely cumbersome to keep track of quite quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may also be looking at Proc Multtest, which does adjustments for multiple tests from a single data set.&amp;nbsp; It might be a good idea to read through the documentation for this procedure, at least the overview and getting started sections and the examples to see if things look similar to yours.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 01:58:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/779691#M31569</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-11-11T01:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: Create MANY new variables for differences between time points (continuous measure)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/779815#M31578</link>
      <description>Thank you. What is the best way to provide example data?</description>
      <pubDate>Thu, 11 Nov 2021 15:32:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/779815#M31578</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2021-11-11T15:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: Create MANY new variables for differences between time points (continuous measure)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/779833#M31579</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;I'm not sure how to transpose my data into that form.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's currently in this form:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-11-11 at 8.49.41 AM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65620i42354C75AA3D87AD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2021-11-11 at 8.49.41 AM.png" alt="Screen Shot 2021-11-11 at 8.49.41 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;When I try to transpose it, it ends up like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-11-11 at 8.49.59 AM.png" style="width: 179px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65621i3862F277DA8FA22C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2021-11-11 at 8.49.59 AM.png" alt="Screen Shot 2021-11-11 at 8.49.59 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;This is my syntax:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=meta.data_01;
by participant_id;
run;

proc transpose data=meta.data_01 out=meta.data_01_long prefix=value_;
   by participant_id;
run;
PROC PRINT DATA=meta.data_01_long;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also, is there a way to adjust for multiple comparisons using&lt;SPAN&gt;&amp;nbsp;"BY in PROC TTEST"?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 17:14:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/779833#M31579</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2021-11-11T17:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Create MANY new variables for differences between time points (continuous measure)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/779835#M31580</link>
      <description>&lt;P&gt;I'm not entirely clear on this:&lt;/P&gt;
&lt;PRE&gt;Variable Time1 Time2 Time3;
BP 120 140 125
...
...&lt;/PRE&gt;
&lt;P&gt;The BY variable is "Group", so would the desired output look like this?&lt;/P&gt;
&lt;PRE&gt;Participant_id         group     Variable          Time1     Time2     Time3;
         01             A           BP              120        140       125
         01             A           ApoA1           238.65     279.72   171.58
...
         02             B           BP              125        141       135
         02             B           ApoA1           268.65     288.72   181.58
...&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Nov 2021 17:23:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/779835#M31580</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2021-11-11T17:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: Create MANY new variables for differences between time points (continuous measure)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/779869#M31582</link>
      <description>&lt;P&gt;Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the &amp;lt;/&amp;gt; icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or look at other posts on the forum where data step code is included.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 22:29:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/779869#M31582</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-11-11T22:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Create MANY new variables for differences between time points (continuous measure)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/779883#M31585</link>
      <description>&lt;P&gt;I think you may need more than one transpose. One to first get everything in one column and then parse the name to get the time point and then transpose it back out to a semi wide format for one for each time point.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tutorial are below for using either transpose or data step. You could do it in one data step but a bit more typing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Wide to Long:&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-wide-to-long-using-proc-transpose/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-wide-to-long-using-proc-transpose/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/modules/reshaping-data-wide-to-long-using-a-data-step/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/modules/reshaping-data-wide-to-long-using-a-data-step/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;And sometimes a double transpose is needed for extra wide data sets:&lt;BR /&gt;&lt;A href="https://gist.github.com/statgeek/2321b6f62ab78d5bf2b0a5a8626bd7cd" target="_blank"&gt;https://gist.github.com/statgeek/2321b6f62ab78d5bf2b0a5a8626bd7cd&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 01:04:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/779883#M31585</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-11-12T01:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: Create MANY new variables for differences between time points (continuous measure)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/780069#M31610</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;I'm taking a shot at PROC&amp;nbsp;MULTTEST. I'm wondering if you might be able to guide me a bit. I'm trying to compare means at 3 timepoints (V1, V2, V3) between groups (A, B).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a subset of my dataset:&lt;/P&gt;
&lt;PRE&gt; data WORK.DATA_04;
   infile datalines dsd truncover;
   input Participant_ID:$3. Group:$1. Sex:$2. Age:BEST12. Efflux_V1:BEST12. Efflux_V2:BEST12. Efflux_V3:BEST12. ApoA1_V1:BEST12. ApoA1_V2:BEST12. ApoA1_V3:BEST12. ApoC1_V1:BEST12. ApoC1_V2:BEST12. ApoC1_V3:BEST12.;
   format Age BEST12. Efflux_V1 BEST12. Efflux_V2 BEST12. Efflux_V3 BEST12. ApoA1_V1 BEST12. ApoA1_V2 BEST12. ApoA1_V3 BEST12. ApoC1_V1 BEST12. ApoC1_V2 BEST12. ApoC1_V3 BEST12.;
 datalines;
 1 A M 52 11.68 12.59 11.21 238.65 279.72 171.58 41.22 62.36 36.07
 10 B M 68 9.58 9.18 10.78 215.79 214.9 253.98 47.33 38 50.52
 11 A F 71 12.26 9.17 9.94 282.3 227.08 282.3 44.13 44.21 44.13
 12 B M 71 5.88 9.45 10.55 173.07 230.49 174.09 47.8 51.28 37.81
 13 A F 71 13.17 12.69 11.33 259.03 265.83 255.03 61.34 67.46 73.5
 14 B M 54 10.51 7.96 8.28 211.39 192.76 192.17 41.14 36.83 34.86
 15 A F 66 7.34 6.74 8.69 240.58 160.97 205.72 35.8 25.89 44.28
 16 B F 69 11.07 13.44 10.08 236.45 242.66 214.03 54.07 55.34 37.61
 17 A F 58 8.1 7.62 8.03 188.51 159.8 164.22 36.04 32.35 30.78
 18 B F 63 10.14 10.06 10.78 229.05 252.06 228.63 57.49 63.17 50.44
 ;;;;
Run;&lt;/PRE&gt;
&lt;P&gt;Here is my initial syntax:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ods graphics on;
PROC MULTTEST DATA=WORK.DATA_04 bootstrap nsample=20000 seed=41287 notables
              plots=PByTest(vref=0.05 0.1);
              
/* 	BY variables; */
/* 	Must sort by the BY variable first */
/* 	Not clear to me whether to use BY or CLASS */
	
	CLASS group;
	/* Group variable */
	
/* 	CONTRAST 'label' values; */
/* 	 */
/* 	FREQ variable; */
/* 	 */
/* 	ID variables; */
/* 	 */
/* 	STRATA variable; */
	
	TEST MEAN (Efflux_V1--ApoC1_V3);
	/* MEAN - Requests the t test for the mean */
run;
ods graphics off;&lt;/PRE&gt;
&lt;P&gt;The log says, "ERROR: There is no input from the dataset." I guess I can't even get the DATA statement correct?!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 23:29:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/780069#M31610</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2021-11-12T23:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: Create MANY new variables for differences between time points (continuous measure)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/780071#M31611</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;Could you please help me get clear on the desired output (i.e., assuming I'm trying to use&amp;nbsp;BY group processing and PROC TTEST)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Am I trying to get to something that looks like this?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-11-12 at 3.34.26 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65658i52BB25D0F0E7DD44/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2021-11-12 at 3.34.26 PM.png" alt="Screen Shot 2021-11-12 at 3.34.26 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Sample data:&lt;/P&gt;
&lt;PRE&gt; data WORK.DATA_04;
   infile datalines dsd truncover;
   input Participant_ID:$3. Group:$1. Sex:$2. Age:BEST12. Efflux_V1:BEST12. Efflux_V2:BEST12. Efflux_V3:BEST12. ApoA1_V1:BEST12. ApoA1_V2:BEST12. ApoA1_V3:BEST12. ApoC1_V1:BEST12. ApoC1_V2:BEST12. ApoC1_V3:BEST12.;
   format Age BEST12. Efflux_V1 BEST12. Efflux_V2 BEST12. Efflux_V3 BEST12. ApoA1_V1 BEST12. ApoA1_V2 BEST12. ApoA1_V3 BEST12. ApoC1_V1 BEST12. ApoC1_V2 BEST12. ApoC1_V3 BEST12.;
 datalines;
 1 A M 52 11.68 12.59 11.21 238.65 279.72 171.58 41.22 62.36 36.07
 10 B M 68 9.58 9.18 10.78 215.79 214.9 253.98 47.33 38 50.52
 11 A F 71 12.26 9.17 9.94 282.3 227.08 282.3 44.13 44.21 44.13
 12 B M 71 5.88 9.45 10.55 173.07 230.49 174.09 47.8 51.28 37.81
 13 A F 71 13.17 12.69 11.33 259.03 265.83 255.03 61.34 67.46 73.5
 14 B M 54 10.51 7.96 8.28 211.39 192.76 192.17 41.14 36.83 34.86
 15 A F 66 7.34 6.74 8.69 240.58 160.97 205.72 35.8 25.89 44.28
 16 B F 69 11.07 13.44 10.08 236.45 242.66 214.03 54.07 55.34 37.61
 17 A F 58 8.1 7.62 8.03 188.51 159.8 164.22 36.04 32.35 30.78
 18 B F 63 10.14 10.06 10.78 229.05 252.06 228.63 57.49 63.17 50.44
 ;;;;
Run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Nov 2021 23:39:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/780071#M31611</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2021-11-12T23:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Create MANY new variables for differences between time points (continuous measure)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/780080#M31612</link>
      <description>&lt;P&gt;Did you test that input code? Did it work for you? It doesn't for me unfortunately.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That being said, this should get you closer.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you get errors post your full log and code.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=data_04 out=data_04a;
by participant_id group sex age;
run;

data data_04b;
set data_04a;
varName = scan(_name_, 1, "_");
TimePoint = scan(_name_, 2, "_");
*fake data;
col1 = 25;
run;

proc sort data=data_04b;
by participant_id group sex age varName timePoint;
run;

proc transpose data=data_04b out=data_05 prefix=timePoint;
by participant_id group sex age varName;
id timePoint;
var col1;
run;

proc sort data=data_05;
by varName group;
run;

proc ttest data=data_05;
by varName group;
paired timePointv1*timepointV2;
run;

proc ttest data=data_05;
by varName group;
paired timePointv2*timepointV3;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 13 Nov 2021 01:09:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/780080#M31612</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-11-13T01:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: Create MANY new variables for differences between time points (continuous measure)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/780474#M31631</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;Sorry, but I'm not clear on the DATA step below.&lt;/P&gt;
&lt;PRE&gt;data data_04b;
set data_04a;
varName = scan(_name_, 1, "_");
TimePoint = scan(_name_, 2, "_");
*fake data;
col1 = 25;
run;&lt;/PRE&gt;
&lt;P&gt;What am I putting in the place of "varName"? One of the&amp;nbsp;dependent variables?&lt;/P&gt;
&lt;P&gt;What am I putting in the place of "TimePoint"?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, is this what you are referring to as the input code? If so, it does work for me.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WORK.DATA_04;
   infile datalines dsd truncover;
   input Participant_ID:$3. Group:$1. Sex:$2. Age:BEST12. Efflux_V1:BEST12. Efflux_V2:BEST12. Efflux_V3:BEST12. ApoA1_V1:BEST12. ApoA1_V2:BEST12. ApoA1_V3:BEST12. ApoC1_V1:BEST12. ApoC1_V2:BEST12. ApoC1_V3:BEST12.;
   format Age BEST12. Efflux_V1 BEST12. Efflux_V2 BEST12. Efflux_V3 BEST12. ApoA1_V1 BEST12. ApoA1_V2 BEST12. ApoA1_V3 BEST12. ApoC1_V1 BEST12. ApoC1_V2 BEST12. ApoC1_V3 BEST12.;
 datalines;
 1 A M 52 11.68 12.59 11.21 238.65 279.72 171.58 41.22 62.36 36.07
 10 B M 68 9.58 9.18 10.78 215.79 214.9 253.98 47.33 38 50.52
 11 A F 71 12.26 9.17 9.94 282.3 227.08 282.3 44.13 44.21 44.13
 12 B M 71 5.88 9.45 10.55 173.07 230.49 174.09 47.8 51.28 37.81
 13 A F 71 13.17 12.69 11.33 259.03 265.83 255.03 61.34 67.46 73.5
 14 B M 54 10.51 7.96 8.28 211.39 192.76 192.17 41.14 36.83 34.86
 15 A F 66 7.34 6.74 8.69 240.58 160.97 205.72 35.8 25.89 44.28
 16 B F 69 11.07 13.44 10.08 236.45 242.66 214.03 54.07 55.34 37.61
 17 A F 58 8.1 7.62 8.03 188.51 159.8 164.22 36.04 32.35 30.78
 18 B F 63 10.14 10.06 10.78 229.05 252.06 228.63 57.49 63.17 50.44
 ;;;;
Run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Finally, is this the desired format of the data set?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-11-12 at 3.34.26 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65763iACDC6BC155437CF6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2021-11-12 at 3.34.26 PM.png" alt="Screen Shot 2021-11-12 at 3.34.26 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 15:22:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-MANY-new-variables-for-differences-between-time-points/m-p/780474#M31631</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2021-11-16T15:22:31Z</dc:date>
    </item>
  </channel>
</rss>

