<?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 write SAS program for residual transformation on self-paced reading data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-SAS-program-for-residual-transformation-on-self/m-p/447259#M283322</link>
    <description>&lt;P&gt;You need to add&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;by participant;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;into the PROC REG commands.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Mar 2018 20:02:29 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2018-03-20T20:02:29Z</dc:date>
    <item>
      <title>How to write SAS program for residual transformation on self-paced reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-SAS-program-for-residual-transformation-on-self/m-p/447221#M283319</link>
      <description>&lt;P&gt;I'm using SAS 9.4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have data for about 50 participants, who each read a series of sentences that have the same structure. The &lt;STRONG&gt;reading time&lt;/STRONG&gt; (in milliseconds) for each word in each sentence was recorded. I want to get a regression line for how the&lt;STRONG&gt; word length&lt;/STRONG&gt; (in characters) relates to &lt;STRONG&gt;reading time&lt;/STRONG&gt; for &lt;EM&gt;each participant&lt;/EM&gt;, and I want to then convert the &lt;STRONG&gt;reading time&lt;/STRONG&gt; measurement into the corresponding &lt;STRONG&gt;residual&lt;/STRONG&gt; from these regression equations for each data point. I've tried to do this with some stupid things, like below. I don't quite get it.&amp;nbsp; I give an example of how the data look for these variables further below. Please help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&g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D&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;?&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 18:33:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-write-SAS-program-for-residual-transformation-on-self/m-p/447221#M283319</guid>
      <dc:creator>PeteCthulu</dc:creator>
      <dc:date>2018-03-20T18:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to write SAS program for residual transformation on self-paced reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-SAS-program-for-residual-transformation-on-self/m-p/447233#M283320</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc reg data=sashelp.class;
model weight = height age;
output out=want pred = p residual=r;
quit;

proc print data=want;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You need to create an OUTPUT data set, see the code above for a fully worked example.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;In general, you should always have a DATA statement so that you know which data set your procedure is using.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 18:56:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-write-SAS-program-for-residual-transformation-on-self/m-p/447233#M283320</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-20T18:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to write SAS program for residual transformation on self-paced reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-SAS-program-for-residual-transformation-on-self/m-p/447256#M283321</link>
      <description>&lt;P&gt;I don't understand how this would get the Yhat for the regression equation for each participant and then get the residual for each data point....&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 19:55:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-write-SAS-program-for-residual-transformation-on-self/m-p/447256#M283321</guid>
      <dc:creator>PeteCthulu</dc:creator>
      <dc:date>2018-03-20T19:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to write SAS program for residual transformation on self-paced reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-SAS-program-for-residual-transformation-on-self/m-p/447259#M283322</link>
      <description>&lt;P&gt;You need to add&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;by participant;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;into the PROC REG commands.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 20:02:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-write-SAS-program-for-residual-transformation-on-self/m-p/447259#M283322</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-03-20T20:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to write SAS program for residual transformation on self-paced reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-SAS-program-for-residual-transformation-on-self/m-p/447260#M283323</link>
      <description>&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;&lt;BR /&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;reg&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;sashelp&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token statement"&gt;class&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;by sex;
&lt;SPAN class="token procnames"&gt;model&lt;/SPAN&gt; &lt;SPAN class="token statement"&gt;weight&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; height age&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
output out&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;want pred &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; p residual&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;r&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;quit&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;print&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;want&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Mar 2018 20:09:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-write-SAS-program-for-residual-transformation-on-self/m-p/447260#M283323</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-20T20:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to write SAS program for residual transformation on self-paced reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-SAS-program-for-residual-transformation-on-self/m-p/447270#M283324</link>
      <description>&lt;P&gt;A&amp;nbsp;power model would fit pretty well I bet&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temp;
set have;
lReadingTime = log(readingtime);
lWordLength = log(WordLength);
run;

proc mixed data=temp;
class participant;
model lreadingtime = lwordlength / s outpred=outpred residual;
random participant / solution;
ods output SolutionR=SolutionR;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;make sure you include all the same words for every reader.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 21:12:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-write-SAS-program-for-residual-transformation-on-self/m-p/447270#M283324</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-03-20T21:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to write SAS program for residual transformation on self-paced reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-SAS-program-for-residual-transformation-on-self/m-p/447882#M283325</link>
      <description>&lt;P&gt;Thanks! I'll try this too!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2018 18:42:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-write-SAS-program-for-residual-transformation-on-self/m-p/447882#M283325</guid>
      <dc:creator>PeteCthulu</dc:creator>
      <dc:date>2018-03-22T18:42:31Z</dc:date>
    </item>
  </channel>
</rss>

