<?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: Size effects in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256430#M13544</link>
    <description>&lt;P&gt;Dears,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use this equation to find the intercept and slope for my data;&amp;nbsp;&amp;nbsp;St=a- slope*t and then I used this: slope=slope*W^b to find the effect of fish size on slope (b).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need sas proc for this.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 13 Mar 2016 18:41:59 GMT</pubDate>
    <dc:creator>afgdurrani0</dc:creator>
    <dc:date>2016-03-13T18:41:59Z</dc:date>
    <item>
      <title>Size effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256274#M13523</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to find the fish size effects on its digestion rate (slope value) using proc satatement?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can find the slop and intercepet of&amp;nbsp;each group using proc reg. But I have two groups and both produced different slope value. I know this change is becasue of fish size (one group has 30g size fish, another has 150g size fish), so&amp;nbsp;is there any way to find the effect of fish size (exponent)?&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2016 09:41:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256274#M13523</guid>
      <dc:creator>afgdurrani0</dc:creator>
      <dc:date>2016-03-12T09:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: Size effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256280#M13524</link>
      <description>&lt;P&gt;You can include fish size in the model.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2016 10:58:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256280#M13524</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-12T10:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Size effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256284#M13525</link>
      <description>It is the proc statement;&lt;BR /&gt;Proc reg data=abcd;&lt;BR /&gt;Model y=x;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;So where to insert the fish size here? The relationship between slope and fish size is mostly described by simple power function.</description>
      <pubDate>Sat, 12 Mar 2016 11:44:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256284#M13525</guid>
      <dc:creator>afgdurrani0</dc:creator>
      <dc:date>2016-03-12T11:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Size effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256297#M13526</link>
      <description>I'm not sure what you mean. Can you write out the equation your trying to model? &lt;BR /&gt;&lt;BR /&gt;I was suggesting you add size into model, but it sounds like you want a more complex model. &lt;BR /&gt;&lt;BR /&gt;Model Y = x size;</description>
      <pubDate>Sat, 12 Mar 2016 16:38:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256297#M13526</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-12T16:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Size effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256301#M13527</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;Dear Reeza,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;Generally we run first proc reg (model y=x) etc to find the slop value. Suppose I have two sample&lt;SPAN class="apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;of 35g and 150g. I find the digestion rate (slope) for each group. After finding slope values, I plot the slope values at y-axis and fish body weight (W) at x-axis and run the power trending (see the fig. below). &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;But I want to modify my model y=x to also calculate the effect of body mass of fish on slope value.&amp;nbsp;&lt;/SPAN&gt;&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;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2292iDB823EFB6EA3E1D7/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="4.png" title="4.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2016 16:57:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256301#M13527</guid>
      <dc:creator>afgdurrani0</dc:creator>
      <dc:date>2016-03-12T16:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: Size effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256303#M13528</link>
      <description>&lt;P&gt;Try the suggested code above then. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2016 17:01:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256303#M13528</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-12T17:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Size effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256307#M13529</link>
      <description>&lt;P&gt;Dear Reeza,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try but not working. I attached the xlsx&amp;nbsp;file, you can try it too. As I told you that I run the simple linear regression and then plot the generated slope values against the fish weight to find the mass exponent (effect of fish size on slope value).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2016 17:19:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256307#M13529</guid>
      <dc:creator>afgdurrani0</dc:creator>
      <dc:date>2016-03-12T17:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: Size effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256311#M13530</link>
      <description>&lt;P&gt;I don't like to download attachments, if you'd like further assistance from me&amp;nbsp;please post your code and log. Otherwise someone else will help out.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a macro that will transform your data step into a data set code that can be pasted into the window here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_blank"&gt;http://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2016 17:58:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256311#M13530</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-12T17:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Size effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256313#M13531</link>
      <description>&lt;P&gt;Deare Reeza,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately I don't know the method you shared for data sharing. We have to wait for someone else then to help me in this case.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2016 18:08:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256313#M13531</guid>
      <dc:creator>afgdurrani0</dc:creator>
      <dc:date>2016-03-12T18:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: Size effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256324#M13532</link>
      <description>&lt;P&gt;In your data, is Y = S(t), X = t and fish_size = W ?&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2016 19:29:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256324#M13532</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-03-12T19:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Size effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256342#M13533</link>
      <description>Why didn't the following work?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Proc reg data=abcd;&lt;BR /&gt;Model y=Size x;&lt;BR /&gt;Run;&lt;BR /&gt;</description>
      <pubDate>Sat, 12 Mar 2016 22:12:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256342#M13533</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-12T22:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: Size effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256399#M13539</link>
      <description>&lt;P&gt;Yes, it is like that (&lt;SPAN&gt;Y = S(t), X = t and fish_size = W). I want to find the fish size effect on slope value (digestion rate). You can see in my above shared graph.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2016 08:07:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256399#M13539</guid>
      <dc:creator>afgdurrani0</dc:creator>
      <dc:date>2016-03-13T08:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Size effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256430#M13544</link>
      <description>&lt;P&gt;Dears,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use this equation to find the intercept and slope for my data;&amp;nbsp;&amp;nbsp;St=a- slope*t and then I used this: slope=slope*W^b to find the effect of fish size on slope (b).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need sas proc for this.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2016 18:41:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256430#M13544</guid>
      <dc:creator>afgdurrani0</dc:creator>
      <dc:date>2016-03-13T18:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Size effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256444#M13545</link>
      <description>&lt;P&gt;You are looking for nonlinear regression. I renamed your data file &lt;STRONG&gt;Fish size effects.xlsx&lt;/STRONG&gt; and ran:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname xl Excel "&amp;amp;sasforum\datasets\Fish size effect.xlsx" access=readonly;
data fish;
set xl.'Sheet1$'n;
rename x=t y=S_t;
label y="S(t)" x="t";
run;

proc nlin data=fish;
parms slope_0 = 1.0 intercept_1 = 1.75 intercept_2 = 0.75 exponent = 1.0 ;
slope = slope_0*fish_size**exponent;
group_1 = (group = 1);
group_2 = (group = 2);
model S_t = intercept_1*group_1 + intercept_2*group_2 - slope*t;
output out=fishPred predicted=p_S_t;
run;

proc sort data=fishPred; by group t; run;

title;
proc sgplot data=fishPred;
scatter y=S_t x=t / group=group;
series y=p_S_t x=t / group=group;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I got this fit (the vertical transitions represent the effect of fish size for each value of t):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2302i9ECE20315F9EF929/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Non linear fit" title="Non linear fit" align="left" /&gt;&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;P&gt;&amp;nbsp;&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;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2016 21:04:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256444#M13545</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-03-13T21:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: Size effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256450#M13546</link>
      <description>&lt;P&gt;Thanks PG Stats,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I run like that:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FILENAME CSV "/folders/myfolders/Sir nadir.csv" TERMSTR=CRLF;&lt;BR /&gt;PROC IMPORT DATAFILE=CSV&lt;BR /&gt;OUT=geumar2&lt;BR /&gt;DBMS=CSV&lt;BR /&gt;REPLACE;&lt;BR /&gt;RUN;&lt;BR /&gt;title 'geumar';&lt;BR /&gt;data group;&lt;BR /&gt;set geumar2;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data group;&lt;BR /&gt;set geumar2;&lt;BR /&gt;rename x=t y=S_t;&lt;BR /&gt;label y="S(t)" x="t";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc nlin data=exp;&lt;BR /&gt;parms slope_0 = 1.0 intercept_1 = 1.75 intercept_2 = 0.75 exponent = 1.0 ;&lt;BR /&gt;slope = slope_0*fish_size**exponent;&lt;BR /&gt;group_1 = (group = 1);&lt;BR /&gt;group_2 = (group = 2);&lt;BR /&gt;model S_t = intercept_1*group_1 + intercept_2*group_2 - slope*t;&lt;BR /&gt;output out=fishPred predicted=p_S_t;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it doesn't give any error but it doesn't converge.&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasWarning focus-line"&gt;WARNING: Step size shows no improvement.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: PROC NLIN failed to converge.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;&lt;P&gt;I am sharing a file which&amp;nbsp;has total 6 groups, I edited your constricted proc to include others group too but the mass exponent is -48. According to my data analysis done with hands, it should be near to 0.55.&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 14 Mar 2016 07:29:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256450#M13546</guid>
      <dc:creator>afgdurrani0</dc:creator>
      <dc:date>2016-03-14T07:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Size effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256469#M13549</link>
      <description>&lt;P&gt;You must fit an intercept for every group:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data fish;
set xl.'Sir Nadir$'n;
rename x=t y=S_t;
label y="S(t)" x="t";
run;

proc nlin data=fish;
parms slope_0 = 1.0 exponent = 1.0
    intercept_1 = 1.5 
    intercept_2 = 1.5 
    intercept_3 = 1.5 
    intercept_4 = 1.5 
    intercept_5 = 1.5 
    intercept_6 = 1.5 ;
slope = slope_0*fish_size**exponent;
group_1 = (group = 1);
group_2 = (group = 2);
group_3 = (group = 3);
group_4 = (group = 4);
group_5 = (group = 5);
group_6 = (group = 6);
model S_t = 
    intercept_1*group_1 + 
    intercept_2*group_2 + 
    intercept_3*group_3 + 
    intercept_4*group_4 + 
    intercept_5*group_5 + 
    intercept_6*group_6 -
    slope*t;
output out=fishPred predicted=p_S_t residual=r_S_t;
run;

proc sort data=fishPred; by group t fish_size; run;

title;
proc sgplot data=fishPred;
scatter y=S_t x=t / group=group;
series y=p_S_t x=t / group=group lineattrs=(pattern=Solid) 
    curvelabel curvelabelpos=end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;                                          Approx       Approximate 95% Confidence
            Parameter      Estimate    Std Error                 Limits

            slope_0         0.00114     0.000405    0.000348     0.00194
            exponent         0.4911       0.0725      0.3485      0.6337
            intercept_1      1.2018       0.0284      1.1459      1.2578
            intercept_2      0.9589       0.0276      0.9046      1.0131
            intercept_3      0.7986       0.0258      0.7478      0.8494
            intercept_4      1.8081       0.0283      1.7524      1.8638
            intercept_5      1.4271       0.0290      1.3700      1.4842
            intercept_6      1.1312       0.0268      1.0785      1.1838
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2303i864830E19EC9049A/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Six fish groups" title="Six fish groups" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 02:43:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256469#M13549</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-03-14T02:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Size effects</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256494#M13552</link>
      <description>&lt;P&gt;Thanks a lot&amp;nbsp; &lt;SPAN class="login-bold"&gt;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462" target="_self"&gt;PGStats&lt;/A&gt;, you did it. It works perfectly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; kind of you&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 07:28:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Size-effects/m-p/256494#M13552</guid>
      <dc:creator>afgdurrani0</dc:creator>
      <dc:date>2016-03-14T07:28:37Z</dc:date>
    </item>
  </channel>
</rss>

