<?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: Estimating parameters for each group separately (multiple group data) in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Estimating-parameters-for-each-group-separately-multiple-group/m-p/744615#M80632</link>
    <description>Thanks for the help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;Best regards</description>
    <pubDate>Sat, 29 May 2021 12:40:59 GMT</pubDate>
    <dc:creator>afgdurrani0</dc:creator>
    <dc:date>2021-05-29T12:40:59Z</dc:date>
    <item>
      <title>Estimating parameters for each group separately (multiple group data)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Estimating-parameters-for-each-group-separately-multiple-group/m-p/744562#M80623</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;BR /&gt;I need to estimate parameters a and b as well as R-squared from data for each group (expno=1, expno=2, expno=3 etc.,) separately at once. Could someone help me to modify the below codes? Many thanks&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME CSV "/folders/myfolders/umar2021.csv" TERMSTR=CRLF;

PROC IMPORT DATAFILE=CSV
		    OUT=umar
		    DBMS=CSV
		    REPLACE;
RUN;
title 'LWR for shells';
data exp;
set umar;
if expno=1 or expno=2 or expno=3;
run;

proc nlin data=exp method=marquardt;
parms B=3 A=0.01;

model w=A*tl**B;


output out=expp p=pw r=w_residual;
run;
proc summary data=expp;
     var w_residual w;
     output out=stats css(w)=sstot uss(w_residual)=ssres N=N;
run;
data expp;
     set stats;
     rsquared=1-(ssres/sstot);
     adjrsquared = 1-(1-rsquared)*(N-1) / (N- 3  -1);
run;
proc print data=expp;
run; &lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 23:58:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Estimating-parameters-for-each-group-separately-multiple-group/m-p/744562#M80623</guid>
      <dc:creator>afgdurrani0</dc:creator>
      <dc:date>2021-05-28T23:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: Estimating parameters for each group separately (multiple group data)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Estimating-parameters-for-each-group-separately-multiple-group/m-p/744578#M80624</link>
      <description>&lt;P&gt;Sort your data by expno and use a &lt;STRONG&gt;BY expno&lt;/STRONG&gt; statement in proc nlin and in proc summary.&lt;/P&gt;</description>
      <pubDate>Sat, 29 May 2021 03:23:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Estimating-parameters-for-each-group-separately-multiple-group/m-p/744578#M80624</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2021-05-29T03:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Estimating parameters for each group separately (multiple group data)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Estimating-parameters-for-each-group-separately-multiple-group/m-p/744587#M80625</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;I modify my codes like as below but I did not get results separately for each group.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data exp;
set rapana;
by expno;
if expno=1 or expno=2 or expno=3;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Also added in summary like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=expp by expno;
     var w_residual w;
     output out=stats css(w)=sstot uss(w_residual)=ssres N=N;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 May 2021 06:20:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Estimating-parameters-for-each-group-separately-multiple-group/m-p/744587#M80625</guid>
      <dc:creator>afgdurrani0</dc:creator>
      <dc:date>2021-05-29T06:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: Estimating parameters for each group separately (multiple group data)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Estimating-parameters-for-each-group-separately-multiple-group/m-p/744596#M80626</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you get errors in the LOG it is better to post the LOG and not just the code.&lt;/P&gt;
&lt;P&gt;Your data step will fail if the data are not p&lt;SPAN&gt;reviously&amp;nbsp;&lt;/SPAN&gt;sorted by "expno". Use PROC SORT.&lt;/P&gt;
&lt;P&gt;And the BY statement in PROC SUMMARY should be a separate statement,&amp;nbsp;thus preceded by a semicolon.&lt;/P&gt;
&lt;P&gt;And your PROC NLIN should have the BY-statement as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I repeat what PROC NLIN says about its BY statement. It says much more than the below. The below is just the 1st paragraph. Specify "BY expno;".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The NLIN Procedure&lt;/P&gt;
&lt;P&gt;&amp;nbsp; BY Statement&lt;BR /&gt;&amp;nbsp; &amp;nbsp; BY variables;&lt;/P&gt;
&lt;P&gt;You can specify a BY statement with PROC NLIN to obtain separate analyses of observations in groups that are defined by the BY variables. When a BY statement appears, the procedure expects the input data set to be sorted in order of the BY variables. If you specify more than one BY statement, only the last one specified is used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Koen&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 May 2021 09:25:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Estimating-parameters-for-each-group-separately-multiple-group/m-p/744596#M80626</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-05-29T09:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Estimating parameters for each group separately (multiple group data)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Estimating-parameters-for-each-group-separately-multiple-group/m-p/744600#M80627</link>
      <description>&lt;P&gt;Thanks for the comments and hints. I followed them like this:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME CSV "/folders/myfolders/rapana2021.csv" TERMSTR=CRLF;

PROC IMPORT DATAFILE=CSV
		    OUT=rapana
		    DBMS=CSV
		    REPLACE;
RUN;

PROC SORT DATA=exp;
BY expno;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But got this error:&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR: Import unsuccessful. See SAS Log for details.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.54 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.48 seconds&lt;/DIV&gt;</description>
      <pubDate>Sat, 29 May 2021 10:22:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Estimating-parameters-for-each-group-separately-multiple-group/m-p/744600#M80627</guid>
      <dc:creator>afgdurrani0</dc:creator>
      <dc:date>2021-05-29T10:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Estimating parameters for each group separately (multiple group data)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Estimating-parameters-for-each-group-separately-multiple-group/m-p/744602#M80628</link>
      <description>&lt;P&gt;I need to estimate parameters a and b for each "expno group" (expno 1, 2 and 3 separately).&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAS results.PNG" style="width: 599px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59882i718B60A43F9EE338/image-size/large?v=v2&amp;amp;px=999" role="button" title="SAS results.PNG" alt="SAS results.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 29 May 2021 10:25:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Estimating-parameters-for-each-group-separately-multiple-group/m-p/744602#M80628</guid>
      <dc:creator>afgdurrani0</dc:creator>
      <dc:date>2021-05-29T10:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Estimating parameters for each group separately (multiple group data)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Estimating-parameters-for-each-group-separately-multiple-group/m-p/744605#M80629</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45801"&gt;@afgdurrani0&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see and I understand, but the problem is not in your NLIN-analyses.&lt;/P&gt;
&lt;P&gt;You have a PROC IMPORT problem that needs to be solved first.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But why do you import? I see that you have run your analysis on the 3 groups together, so the import has already been done? No need for another PROC IMPORT I would say, correct?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To correct the PROC IMPORT (if still needed), go to the LOG-window and copy the data step that was generated by PROC IMPORT. Paste the data step in your SAS-editor and adjust accordingly until all errors are gone.&lt;/P&gt;
&lt;P&gt;You can also import using a UI (User Interface). As well SAS 9.4 as VIYA have UIs to import CSV-files without code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sat, 29 May 2021 11:07:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Estimating-parameters-for-each-group-separately-multiple-group/m-p/744605#M80629</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-05-29T11:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: Estimating parameters for each group separately (multiple group data)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Estimating-parameters-for-each-group-separately-multiple-group/m-p/744610#M80630</link>
      <description>&lt;P&gt;Thanks, I got the desired results using these codes. Also, the error related to import was also corrected following your suggestions. I attached the&amp;nbsp;SAS output results.&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS. I also need to get plot (figures with curve line using power function) for expno 1, expno 2 and expno 3 where "tl" at x-axis and "w" at y-axis.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 May 2021 12:11:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Estimating-parameters-for-each-group-separately-multiple-group/m-p/744610#M80630</guid>
      <dc:creator>afgdurrani0</dc:creator>
      <dc:date>2021-05-29T12:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: Estimating parameters for each group separately (multiple group data)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Estimating-parameters-for-each-group-separately-multiple-group/m-p/744612#M80631</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With respect to the plot ...&lt;/P&gt;
&lt;P&gt;, this example should give you the right inspiration:&lt;/P&gt;
&lt;P&gt;SAS/STAT® 15.2 User's Guide&lt;/P&gt;
&lt;P&gt;The NLIN Procedure&lt;BR /&gt;Example 87.5 Comparing Nonlinear Trends among Groups&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/statug/15.2/statug_nlin_examples05.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/statug/15.2/statug_nlin_examples05.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sat, 29 May 2021 12:35:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Estimating-parameters-for-each-group-separately-multiple-group/m-p/744612#M80631</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-05-29T12:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Estimating parameters for each group separately (multiple group data)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Estimating-parameters-for-each-group-separately-multiple-group/m-p/744615#M80632</link>
      <description>Thanks for the help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;Best regards</description>
      <pubDate>Sat, 29 May 2021 12:40:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Estimating-parameters-for-each-group-separately-multiple-group/m-p/744615#M80632</guid>
      <dc:creator>afgdurrani0</dc:creator>
      <dc:date>2021-05-29T12:40:59Z</dc:date>
    </item>
  </channel>
</rss>

