Difference between revisions of "Analyze data with the Statistics software R"

From JSXGraph Wiki
Jump to navigationJump to search
(2 intermediate revisions by the same user not shown)
Line 6: Line 6:
 
* mean, standard deviation: red (non-robust!)<br />
 
* mean, standard deviation: red (non-robust!)<br />
 
* median and MAD: black (most-robust!)<br />  
 
* median and MAD: black (most-robust!)<br />  
* optimally robust radius-minimax estimator: green (cf. Rieder et al. (2008))<br /><br />
+
* radius-minimax estimator: green (optimally robust; cf. Rieder et al. (2008))<br /><br />
 
By changing the y-position of the four movable points you should recognize the instability (non-robustness) of mean and standard deviation in contrast to the robust estimates; e.g., move one of the four movable points to the top of the plot.<br /><br />
 
By changing the y-position of the four movable points you should recognize the instability (non-robustness) of mean and standard deviation in contrast to the robust estimates; e.g., move one of the four movable points to the top of the plot.<br /><br />
 
<html>
 
<html>
Line 90: Line 90:
 
                 t += p[i].Y() + ';';
 
                 t += p[i].Y() + ';';
 
             }
 
             }
             new Ajax.Request('/~alfred/jsxgraph/branches/0.70/examples/rserv.php', {
+
             new Ajax.Request('/~mkohl/rserv.php', {
 
                 method:'post',
 
                 method:'post',
 
                 parameters:'input='+escape(t),
 
                 parameters:'input='+escape(t),
Line 110: Line 110:
 
                             graph3 = brd.createElement('curve', [[x[0],x[x.length-1]],[m+sd,m+sd]], {strokecolor:'red',dash:2});  
 
                             graph3 = brd.createElement('curve', [[x[0],x[x.length-1]],[m+sd,m+sd]], {strokecolor:'red',dash:2});  
 
                             graph4 = brd.createElement('curve', [[x[0],x[x.length-1]],[m-sd,m-sd]], {strokecolor:'red',dash:2});  
 
                             graph4 = brd.createElement('curve', [[x[0],x[x.length-1]],[m-sd,m-sd]], {strokecolor:'red',dash:2});  
                             graph5 = brd.createElement('curve', [[x[0],x[x.length-1]],[med,med]], {strokecolor:'gray'});  
+
                             graph5 = brd.createElement('curve', [[x[0],x[x.length-1]],[med,med]], {strokecolor:'black'});  
 
                             graph1 = brd.createElement('curve', [[x[0],x[x.length-1]],[med-mad,med-mad]], {strokecolor:'black',dash:3});  
 
                             graph1 = brd.createElement('curve', [[x[0],x[x.length-1]],[med-mad,med-mad]], {strokecolor:'black',dash:3});  
 
                             graph6 = brd.createElement('curve', [[x[0],x[x.length-1]],[med+mad,med+mad]], {strokecolor:'black',dash:3});  
 
                             graph6 = brd.createElement('curve', [[x[0],x[x.length-1]],[med+mad,med+mad]], {strokecolor:'black',dash:3});  

Revision as of 12:33, 17 December 2008

Normal Location and Scale

This litte application sends the y-coordinates of the points which are normal distributed (pseudo-)random numbers to the server.
There, location and scale of the sample are estimated using the Statistics software R.
The return values are plotted and displayed.

The computed estimates are:

  • mean, standard deviation: red (non-robust!)
  • median and MAD: black (most-robust!)
  • radius-minimax estimator: green (optimally robust; cf. Rieder et al. (2008))

By changing the y-position of the four movable points you should recognize the instability (non-robustness) of mean and standard deviation in contrast to the robust estimates; e.g., move one of the four movable points to the top of the plot.

Online results:

Statistics:<br>

The underlying source code

The underlying JavaScript and PHP code

The R script can be downloaded here.

References

  • The Costs of not Knowing the Radius, Helmut Rieder, Matthias Kohl and Peter Ruckdeschel, Statistical Methods and Application 2008 Feb; 17(1): p.13-40; cf. also [1] for an extended version.
  • Robust Asymptotic Statistics, Helmut Rieder, Springer, 1994.
  • Numerical Contributions to the Asymptotic Theory of Robustness, Matthias Kohl, PhD-Thesis, University of Bayreuth, 2005; cf. also [2].

External links