<?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: Proc nlin with weights and SSE in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-nlin-with-weights-and-SSE/m-p/247226#M13036</link>
    <description>&lt;P&gt;Why do you think the results are wrong? I just ran your program with plots turned on, and everything looks fine for the fit. Taking out the weight statement gives a different confidence region, different SE, etc.,as expected. I think you just have a coincidence about the "0.1". For instance, I ran:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data b; set startdata;&lt;BR /&gt;pred = x**2;&lt;BR /&gt;SS = (y - pred)**2;&lt;BR /&gt;WSS = z*SS;&lt;BR /&gt;run;&lt;BR /&gt;proc means data=b&amp;nbsp; sum;&lt;BR /&gt;var SS WSS;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To manually get the sum of squares, weighted and unweighted, based on your parameter estimate. Weighted SS = 0.1, just like the NLIN output. If you run NLIN without the weight, you get SS = 1.0. This is what you get manually (above). I think everything is fine. By the way, put a plots=all option in your NLIN statement for good graphs.&lt;/P&gt;</description>
    <pubDate>Mon, 01 Feb 2016 15:34:08 GMT</pubDate>
    <dc:creator>lvm</dc:creator>
    <dc:date>2016-02-01T15:34:08Z</dc:date>
    <item>
      <title>Proc nlin with weights and SSE</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-nlin-with-weights-and-SSE/m-p/247194#M13034</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a problem estimating a nlin function on weighted data which basically comes down to the problem below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Consider the following data where clearly y =x² and z aresome weights. Bij adapting the standard proc nlin to include the weights:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data STARTDATA;
input x  y z ;
datalines ;
1 2 0.1
2 4 0.2 
3 9 0.2 
4 16 0.5 
; 
PROC SQL;
	CREATE VIEW WORK.SORTTempTableSorted AS
		SELECT T.y, T.x, T.z
	FROM WORK.STARTDATA as T;
PROC NLIN DATA=WORK.SORTTempTableSorted
	MAXITER=100
	CONVERGE=1E-05
		SINGULAR=1E-08
	MAXSUBIT=30;
	_WEIGHT_ = z;
	MODEL y = x ** b
	;
	PARMS
	b=0.01;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;The parameter b is estimated correctly as 2. However the SSE is minimized&amp;nbsp;to the first weight which is 0.1 and is not&amp;nbsp;further decreased to &amp;nbsp;0.&lt;BR /&gt;This makes the R²&amp;nbsp; (here 1) wrongly estimated.&lt;BR /&gt;&lt;BR /&gt;How can I correct my example such that the SSE can be smaller than the first weight?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2016 13:17:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-nlin-with-weights-and-SSE/m-p/247194#M13034</guid>
      <dc:creator>RB_Wouter</dc:creator>
      <dc:date>2016-02-01T13:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Proc nlin with weights and SSE</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-nlin-with-weights-and-SSE/m-p/247226#M13036</link>
      <description>&lt;P&gt;Why do you think the results are wrong? I just ran your program with plots turned on, and everything looks fine for the fit. Taking out the weight statement gives a different confidence region, different SE, etc.,as expected. I think you just have a coincidence about the "0.1". For instance, I ran:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data b; set startdata;&lt;BR /&gt;pred = x**2;&lt;BR /&gt;SS = (y - pred)**2;&lt;BR /&gt;WSS = z*SS;&lt;BR /&gt;run;&lt;BR /&gt;proc means data=b&amp;nbsp; sum;&lt;BR /&gt;var SS WSS;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To manually get the sum of squares, weighted and unweighted, based on your parameter estimate. Weighted SS = 0.1, just like the NLIN output. If you run NLIN without the weight, you get SS = 1.0. This is what you get manually (above). I think everything is fine. By the way, put a plots=all option in your NLIN statement for good graphs.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2016 15:34:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-nlin-with-weights-and-SSE/m-p/247226#M13036</guid>
      <dc:creator>lvm</dc:creator>
      <dc:date>2016-02-01T15:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: Proc nlin with weights and SSE</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-nlin-with-weights-and-SSE/m-p/247230#M13037</link>
      <description>&lt;P&gt;Forgot the mention above, your SS should not be 0 because your y values are not exactly equal to x**2 (the first y should be 1, not 2, if you want an exact match).&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2016 15:43:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-nlin-with-weights-and-SSE/m-p/247230#M13037</guid>
      <dc:creator>lvm</dc:creator>
      <dc:date>2016-02-01T15:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: Proc nlin with weights and SSE</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-nlin-with-weights-and-SSE/m-p/247232#M13038</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;There is an input error in my trial model: y1 should be 1 of course. However In my real problem this gives still some strange results. Thanks for the plots =all. It helps for my real problem</description>
      <pubDate>Mon, 01 Feb 2016 15:44:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-nlin-with-weights-and-SSE/m-p/247232#M13038</guid>
      <dc:creator>RB_Wouter</dc:creator>
      <dc:date>2016-02-01T15:44:48Z</dc:date>
    </item>
  </channel>
</rss>

