<?xml-stylesheet type="text/xsl" href="../styles/pmathml.xsl"?>
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:dsi="http://www.w3.org/1999/xlink" xmlns:m="http://www.w3.org/1998/Math/MathML" xml:space="preserve"><head><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"/><title>G10ZAF : NAG Library, Mark 22</title><link rel="stylesheet" href="../styles/libdoc.css" type="text/css"/><script type="text/javascript">
   function showLevel(_levelId){
    var thisLevel = document.getElementById(_levelId);
    var thisplus = document.getElementById( _levelId.concat('plus'));
    var thisminus = document.getElementById( _levelId.concat('minus'));
    if(thisLevel.style.display != "block"){
     thisLevel.style.display = "block";
     thisplus.style.display = "none";
     thisminus.style.display = "inline";
     }
    else{
     thisLevel.style.display = "none";
     thisminus.style.display = "none";
     thisplus.style.display = "inline";
     }
    }
  </script></head><body><hr/><div><a class="rout" href="../../pdf/G10/g10zaf.pdf">G10ZAF (PDF version)</a></div><div><a class="chap" href="g10conts.xml">G10 Chapter Contents</a></div><div><a class="chapint" href="g10intro.xml">G10 Chapter Introduction</a></div>
<div><a class="htmltoc" href="../FRONTMATTER/manconts.xml">NAG Library Manual</a></div><hr/><h1 class="libdoc">NAG Library Routine Document<br/><br/>G10ZAF</h1><div class="paramtext"><div class="header"><b>Note:</b>&#160; before using this routine, please read the Users' Note for your implementation to check the interpretation of <span class="bitalic">bold italicised</span> terms and other implementation-dependent details.</div></div> 
<div class="htmltoc">
<h2 class="htmltoc"><span class="htmltochead" onclick="showLevel('htmltoc');"><span class="htmltocplus" id="htmltocplus">+</span><span class="htmltocminus" id="htmltocminus">&#8722;</span></span>&#160;Contents</h2>
<div class="htmltocitem" id="htmltoc">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#purpose">1&#160;&#160;<b>Purpose</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#specification">2&#160;&#160;<b>Specification</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#description">3&#160;&#160;<b>Description</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#references">4&#160;&#160;<b>References</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#parameters">5&#160;&#160;<b>Parameters</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#errors">6&#160;&#160;<b>Error Indicators and Warnings</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#accuracy">7&#160;&#160;<b>Accuracy</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments">8&#160;&#160;<b>Further Comments</b></a>
</div><div class="htmltoc">
<span class="htmltoc" onclick="showLevel('tocexample');"><span class="htmltocplus" id="tocexampleplus">+</span><span class="htmltocminus" id="tocexampleminus">&#8722;</span></span>
<a class="htmltoc" href="#example">9&#160;&#160;<b>Example</b></a>
<div class="htmltocitem" id="tocexample">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examtext">9.1&#160;&#160;<b>Program Text</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examdata">9.2&#160;&#160;<b>Program Data</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examresults">9.3&#160;&#160;<b>Program Results</b></a>
</div>
</div>
</div>
</div>
</div><h2 class="standard"><a class="sec" name="purpose" id="purpose"/>1&#160;&#160;Purpose</h2>
<div class="paramtext">G10ZAF orders and weights data which is entered unsequentially, weighted or unweighted.</div><h2 class="standard"><a class="sec" name="specification" id="specification"/>2&#160;&#160;Specification</h2>
<table class="fspec"><tr><td class="tdfspec1">SUBROUTINE&#160;G10ZAF&#160;(</td><td class="tdfspec2"><a class="arg" href="#WEIGHT">WEIGHT</a>, <a class="arg" href="#N">N</a>, <a class="arg" href="#X">X</a>, <a class="arg" href="#Y">Y</a>, <a class="arg" href="#WT">WT</a>, <a class="arg" href="#NORD">NORD</a>, <a class="arg" href="#XORD">XORD</a>, <a class="arg" href="#YORD">YORD</a>, <a class="arg" href="#WTORD">WTORD</a>, <a class="arg" href="#RSS">RSS</a>, <a class="arg" href="#IWRK">IWRK</a>, <a class="arg" href="#IFAIL">IFAIL</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">N, NORD, IWRK(N), IFAIL</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">X(N), Y(N), WT(*), XORD(N), YORD(N), WTORD(N), RSS</td></tr><tr><td class="tdfspec1">CHARACTER*1</td><td class="tdfspec2">WEIGHT</td></tr></table><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">Given a set of observations <m:math><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:mi>y</m:mi><m:mi>i</m:mi></m:msub></m:mfenced></m:math>, for  <m:math><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>n</m:mi></m:math>, with corresponding weights  <m:math><m:msub><m:mi>w</m:mi><m:mi>i</m:mi></m:msub></m:math>,  G10ZAF rearranges the observations so that the <m:math><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;are in ascending order.</div><div class="paramtext">For any equal <m:math><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;in the ordered set, say  <m:math><m:msub><m:mi>x</m:mi><m:mi>j</m:mi></m:msub><m:mo>=</m:mo><m:msub><m:mi>x</m:mi><m:mrow><m:mi>j</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo>=</m:mo><m:mo>&#8943;</m:mo><m:mo>=</m:mo><m:msub><m:mi>x</m:mi><m:mrow><m:mi>j</m:mi><m:mo>+</m:mo><m:mi>k</m:mi></m:mrow></m:msub></m:math>, a single observation  <m:math><m:msub><m:mi>x</m:mi><m:mi>j</m:mi></m:msub></m:math>&#160;is returned with a corresponding <m:math><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup></m:math>&#160;and <m:math><m:msup><m:mi>w</m:mi><m:mo>&#8242;</m:mo></m:msup></m:math>, calculated as

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:msup><m:mi>w</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mo>=</m:mo><m:munderover><m:mo>&#8721;</m:mo><m:mrow><m:mi>l</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:mrow><m:mi>k</m:mi></m:munderover><m:msub><m:mi>w</m:mi><m:mrow><m:mi>i</m:mi><m:mo>+</m:mo><m:mi>l</m:mi></m:mrow></m:msub>
</m:math></td><td class="formula2"/></tr></table></div>

and

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup><m:mo>=</m:mo><m:mfrac><m:mrow><m:munderover><m:mo>&#8721;</m:mo><m:mrow><m:mi>l</m:mi><m:mo>=</m:mo> <m:mn>0</m:mn></m:mrow><m:mi>k</m:mi></m:munderover><m:msub><m:mi>w</m:mi><m:mrow><m:mi>i</m:mi><m:mo>+</m:mo><m:mi>l</m:mi></m:mrow></m:msub><m:msub><m:mi>y</m:mi><m:mrow><m:mi>i</m:mi><m:mo>+</m:mo><m:mi>l</m:mi></m:mrow></m:msub></m:mrow>
  <m:msup><m:mi>w</m:mi><m:mo>&#8242;</m:mo></m:msup>
 </m:mfrac><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

Observations with zero weight are ignored.  If no weights are supplied by you, then unit weights are assumed; that is <m:math><m:msub><m:mi>w</m:mi><m:mi>i</m:mi></m:msub><m:mo>=</m:mo><m:mn>1</m:mn></m:math>,  for <m:math><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>n</m:mi></m:math>.</div><div class="paramtext">In addition, the within group sum of squares is computed for the tied observations using West's algorithm (see <a class="ref" href="#ref137">West (1979)</a>).</div><h2 class="standard"><a class="sec" name="references" id="references"/>4&#160;&#160;References</h2><div class="paramtext"><a name="ref138" id="ref138"/>Draper N R and Smith H (1985)  <i>Applied Regression Analysis</i> (2nd Edition) Wiley </div>
<div class="paramtext"><a name="ref137" id="ref137"/>West D H D (1979)  Updating mean and variance estimates: An improved method <i>Comm. ACM</i> <b>22</b> 532&#8211;555 </div><h2 class="standard"><a class="sec" name="parameters" id="parameters"/>5&#160;&#160;Parameters</h2>
<dl><dt class="paramhead"><a name="WEIGHT" id="WEIGHT"/>1: &#160;&#160;&#8194; WEIGHT &#8211; CHARACTER*1<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: indicates whether user-defined weights are to be used.
<ul class="listind"><li class="listind">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WEIGHT"><m:mi mathcolor="#EE0000" mathvariant="bold">WEIGHT</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'W'</m:mtext></m:math>, user-defined weights are to be used and must be supplied in <a class="arg" href="#WT">WT</a>.</li><li class="listind">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WEIGHT"><m:mi mathcolor="#EE0000" mathvariant="bold">WEIGHT</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'U'</m:mtext></m:math>, the data is treated as unweighted.</li></ul>
</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WEIGHT"><m:mi mathcolor="#EE0000" mathvariant="bold">WEIGHT</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'W'</m:mtext></m:math>&#160;or <m:math><m:mtext>'U'</m:mtext></m:math>.
</div></dd><dt class="paramhead"><a name="N" id="N"/>2: &#160;&#160;&#8194; N &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: 

<m:math><m:mi>n</m:mi></m:math>, the number of observations.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>1</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="X" id="X"/>3: &#160;&#160;&#8194; X(<a class="arg" href="#N">N</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the values, <m:math><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>, for <m:math><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>n</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="Y" id="Y"/>4: &#160;&#160;&#8194; Y(<a class="arg" href="#N">N</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the values, <m:math><m:msub><m:mi>y</m:mi><m:mi>i</m:mi></m:msub></m:math>, for <m:math><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>n</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="WT" id="WT"/>5: &#160;&#160;&#8194; WT(<m:math><m:mo>*</m:mo></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd><div class="paramtext"><b>Note:</b> the dimension of the array <a class="arg" href="#WT">WT</a>
must be at least
<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>&#160;if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WEIGHT"><m:mi mathcolor="#EE0000" mathvariant="bold">WEIGHT</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'W'</m:mtext></m:math>&#160;and at least <m:math><m:mn>1</m:mn></m:math>&#160;if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WEIGHT"><m:mi mathcolor="#EE0000" mathvariant="bold">WEIGHT</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'U'</m:mtext></m:math>.</div>
<div class="paramtext"><i>On entry</i>: if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WEIGHT"><m:mi mathcolor="#EE0000" mathvariant="bold">WEIGHT</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'W'</m:mtext></m:math>, <a class="arg" href="#WT">WT</a> must contain <m:math><m:mi>n</m:mi></m:math>&#160;weights, <m:math><m:msub><m:mi>w</m:mi><m:mi>i</m:mi></m:msub></m:math>, for <m:math><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>n</m:mi></m:math>. 
<div class="paramtext">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WEIGHT"><m:mi mathcolor="#EE0000" mathvariant="bold">WEIGHT</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'U'</m:mtext></m:math>, <a class="arg" href="#WT">WT</a> is not referenced.</div>
</div><div class="paramtext"><i>Constraint</i>:
  
if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WEIGHT"><m:mi mathcolor="#EE0000" mathvariant="bold">WEIGHT</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'W'</m:mtext></m:math>, <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#WT"><m:mi mathcolor="#EE0000" mathvariant="bold">WT</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow><m:mo>&#8805;</m:mo><m:mn>0.0</m:mn></m:math>, for <m:math><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>n</m:mi></m:math>, and at least one <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#WT"><m:mi mathcolor="#EE0000" mathvariant="bold">WT</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow><m:mo>&gt;</m:mo><m:mn>0.0</m:mn></m:math>&#160;for some <m:math><m:mi>i</m:mi></m:math>.
</div></dd><dt class="paramhead"><a name="NORD" id="NORD"/>6: &#160;&#160;&#8194; NORD &#8211; INTEGER<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: the number of distinct observations.</div></dd><dt class="paramhead"><a name="XORD" id="XORD"/>7: &#160;&#160;&#8194; XORD(<a class="arg" href="#N">N</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: the first <a class="arg" href="#NORD">NORD</a> elements contain the ordered and distinct <m:math><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>.</div></dd><dt class="paramhead"><a name="YORD" id="YORD"/>8: &#160;&#160;&#8194; YORD(<a class="arg" href="#N">N</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: the first <a class="arg" href="#NORD">NORD</a> elements contain the values <m:math><m:msup><m:mi>y</m:mi><m:mo>&#8242;</m:mo></m:msup></m:math>&#160;corresponding to the values in <a class="arg" href="#XORD">XORD</a>.</div></dd><dt class="paramhead"><a name="WTORD" id="WTORD"/>9: &#160;&#160;&#8194; WTORD(<a class="arg" href="#N">N</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: the first <a class="arg" href="#NORD">NORD</a> elements contain the values <m:math><m:msup><m:mi>w</m:mi><m:mo>&#8242;</m:mo></m:msup></m:math>&#160;corresponding to the values of <a class="arg" href="#XORD">XORD</a> and <a class="arg" href="#YORD">YORD</a>.</div></dd><dt class="paramhead"><a name="RSS" id="RSS"/>10: &#8194; RSS &#8211; <span class="bitalic">double precision</span><span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: the within group sum of squares for tied observations.</div></dd><dt class="paramhead"><a name="IWRK" id="IWRK"/>11: &#8194; IWRK(<a class="arg" href="#N">N</a>) &#8211; INTEGER array<span class="pclass">Workspace</span></dt><dt class="paramhead"><a name="IFAIL" id="IFAIL"/>12: &#8194; IFAIL &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: <a class="arg" href="#IFAIL">IFAIL</a> must be set to <m:math><m:mn>0</m:mn></m:math>, <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn>1</m:mn></m:math>. If you are unfamiliar with this parameter you should refer to <a class="sec" href="../GENINT/essint.xml#library3">Section 3.3</a> in  the Essential Introduction for details.</div>
<div class="paramtext"><i>On exit</i>: <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">0</m:mn></m:maction></m:math>&#160;unless the routine detects an error (see <a class="sec" href="#errors">Section 6</a>). <div class="paramtext">For environments where it might be inappropriate to halt program execution when an error is detected, the value <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn>1</m:mn></m:math>&#160;is recommended.  If the output of error messages is undesirable, then the value <m:math><m:mn>1</m:mn></m:math>&#160;is recommended.  Otherwise, if you are not familiar with this parameter, the recommended value is <m:math><m:mn>0</m:mn></m:math>.  <b>When the value <m:math><m:mrow><m:mo>-</m:mo><m:mn mathvariant="bold">1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn mathvariant="bold">1</m:mn></m:math>&#160;is used it is essential to test the value of <a class="arg" href="#IFAIL">IFAIL</a> on exit.</b></div></div></dd></dl><h2 class="standard"><a class="sec" name="errors" id="errors"/>6&#160;&#160;Error Indicators and Warnings</h2>
<div class="paramtext">If on entry <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">0</m:mn></m:maction></m:math>&#160;or <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">-1</m:mn></m:maction></m:math>, explanatory error messages are output on the current error message unit (as defined by <a class="rout" href="../X04/x04aaf.xml">X04AAF</a>).</div><div class="paramtext">Errors or warnings detected by the routine:</div>
<dl class="ifail">
<dt class="errorhead"><a name="IFeq1" id="IFeq1"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math></dt>
<dd>
<table class="ifail"><tr><td class="ifail1">On&#160;entry,</td><td class="ifail2-90"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WEIGHT"><m:mi mathcolor="#EE0000" mathvariant="bold">WEIGHT</m:mi></m:maction><m:mo>&#8800;</m:mo><m:mtext>'W'</m:mtext></m:math>&#160;or <m:math><m:mtext>'U'</m:mtext></m:math>,</td></tr><tr><td class="ifail1">or</td><td class="ifail2-90"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>1</m:mn></m:math>.</td></tr></table>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq2" id="IFeq2"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>2</m:mn></m:math></dt>
<dd>
<table class="ifail"><tr><td class="ifail1">On&#160;entry,</td><td class="ifail2-90"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WEIGHT"><m:mi mathcolor="#EE0000" mathvariant="bold">WEIGHT</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'W'</m:mtext></m:math>&#160;and at least one element of  <a class="arg" href="#WT">WT</a> is <m:math><m:mtext/><m:mo>&lt;</m:mo><m:mn>0.0</m:mn></m:math>, or all elements of <a class="arg" href="#WT">WT</a> are <m:math><m:mn>0.0</m:mn></m:math>.</td></tr></table>
</dd>
</dl><h2 class="standard"><a class="sec" name="accuracy" id="accuracy"/>7&#160;&#160;Accuracy</h2>
<div class="paramtext">For a discussion on the accuracy of the algorithm for computing mean and variance see <a class="ref" href="#ref137">West (1979)</a>.</div><h2 class="standard"><a class="sec" name="fcomments" id="fcomments"/>8&#160;&#160;Further Comments</h2>
<div class="paramtext">G10ZAF may be used to compute the pure error sum of squares in simple linear regression along with <a class="rout" href="../G02/g02daf.xml">G02DAF</a>; see <a class="ref" href="#ref138">Draper and Smith (1985)</a>.</div><h2 class="standard"><a class="sec" name="example" id="example"/>9&#160;&#160;Example</h2>
<div class="paramtext">A set of unweighted observations are input and G10ZAF used to produce a set of strictly increasing weighted observations.</div><h3 class="standard"><a class="sec" name="examtext" id="examtext"/>9.1&#160;&#160;Program Text</h3>
<p><a class="verbatimref" href="../../examples/source/g10zafe.f">Program Text (g10zafe.f)</a></p><h3 class="standard"><a class="sec" name="examdata" id="examdata"/>9.2&#160;&#160;Program Data</h3>
<p><a class="verbatimref" href="../../examples/data/g10zafe.d">Program&#160;Data (g10zafe.d)</a></p><h3 class="standard"><a class="sec" name="examresults" id="examresults"/>9.3&#160;&#160;Program Results</h3>
<p><a class="verbatimref" href="../../examples/baseresults/g10zafe.r">Program Results (g10zafe.r)</a></p>
<hr/><div><a class="rout" href="../../pdf/G10/g10zaf.pdf">G10ZAF (PDF version)</a></div><div><a class="chap" href="g10conts.xml">G10 Chapter Contents</a></div><div><a class="chapint" href="g10intro.xml">G10 Chapter Introduction</a></div>
<div><a class="htmltoc" href="../FRONTMATTER/manconts.xml">NAG Library Manual</a></div>
<div><hr/><a class="genint" href="../FRONTMATTER/copyright.xml">&#169; The Numerical Algorithms Group Ltd, Oxford, UK. 2009</a></div></body></html>
