std error of estimate?

2009-02-23 Thread Erik Frebold
When I do a linear regression analysis, the model summary always shows what 
appear to be incorrect values for (overall) Std. Error of the Estimate, 
regardless of the data set. It does show individual std. errors for the 
constant and coefficient on X in "Coefficients" section of output and these are 
correct, checked against R and SPSS. Am I missing something?  (probably... ;-) 

This is pspp 0.6.1 for 32bit i586, run on SuSE 10.3, installed from Dr. 
Steuer's repository. 

example: 
REGRESSION
/VARIABLES= x
/DEPENDENT=  y
/STATISTICS=COEFF R ANOVA.

(choose any x or y variable from any data I've tried)

Is this part of the regression procedure not complete yet?
--
Erik Frebold
Vancouver, BC



___
Pspp-users mailing list
Pspp-users@gnu.org
http://lists.gnu.org/mailman/listinfo/pspp-users


Re: std error of estimate?

2009-02-23 Thread Jason Stover
On Mon, Feb 23, 2009 at 02:30:20AM -0800, Erik Frebold wrote:
> When I do a linear regression analysis, the model summary always shows what 
> appear to be incorrect values for (overall) Std. Error of the Estimate, 
> regardless of the data set. It does show individual std. errors for the 
> constant and coefficient on X in "Coefficients" section of output and these 
> are correct, checked against R and SPSS. Am I missing something?  
> (probably... ;-) 

Oops. I coded this to place the standard error of R-squared in the box, rather 
than
root MSE. I'll file a bug and fix it soon.

-Jason


___
Pspp-users mailing list
Pspp-users@gnu.org
http://lists.gnu.org/mailman/listinfo/pspp-users


Re: std error of estimate?

2009-02-23 Thread Jason Stover
I just committed a fix to the source repository. To fix your own local copy,
try this patch. Apply by cd'ing to the directory with the source
code, and run

patch -p1 < regression.patch

Then rebuild pspp.

--- pspp.0/src/math/linreg.c2009-01-19 14:38:06.0 -0500
+++ pspp/src/math/linreg.c  2009-02-23 11:09:16.0 -0500
@@ -737,3 +737,9 @@
   design_matrix_destroy (cov);
 }
 
+double pspp_linreg_mse (const pspp_linreg_cache *c)
+{
+  assert (c != NULL);
+  return (c->sse / c->dfe);
+}
+
--- pspp.0/src/math/linreg.h2009-01-19 14:38:06.0 -0500
+++ pspp/src/math/linreg.h  2009-02-23 11:09:20.0 -0500
@@ -222,4 +222,5 @@
   Regression using only the covariance matrix.
  */
 void pspp_linreg_with_cov (const struct covariance_matrix *, pspp_linreg_cache 
*);
+double pspp_linreg_mse (const pspp_linreg_cache *);
 #endif
--- pspp.0/tests/command/regression.sh  2009-01-19 14:38:06.0 -0500
+++ pspp/tests/command/regression.sh2009-02-23 11:16:21.0 -0500
@@ -95,7 +95,7 @@
 ###=#==#
 #  R #R Square|Adjusted R Square|Std. Error of the Estimate#
 ##===##=#==#
-#|.97# .94|  .93|   .33#
+#|.97# .94|  .93|  1.34#
 ##===##=#==#
 2.2 REGRESSION.  ANOVA
 #===#==#==#===#==##
--- pspp.0/tests/command/regression-qr.sh   2009-01-19 14:38:06.0 
-0500
+++ pspp/tests/command/regression-qr.sh 2009-02-23 11:11:15.0 -0500
@@ -1582,7 +1582,7 @@
 ###=#==#
 #  R #R Square|Adjusted R Square|Std. Error of the Estimate#
 ##===##=#==#
-#|.05# .00|  .00|   .00#
+#|.05# .00|  .00|  8.11#
 ##===##=#==#
 2.2 REGRESSION.  ANOVA
 #===#==##===#=##
--- pspp.0/src/language/stats/regression.q  2009-01-19 14:38:06.0 
-0500
+++ pspp/src/language/stats/regression.q2009-02-23 11:10:07.0 
-0500
@@ -148,7 +148,7 @@
   assert (c != NULL);
   rsq = c->ssm / c->sst;
   adjrsq = 1.0 - (1.0 - rsq) * (c->n_obs - 1.0) / (c->n_obs - c->n_indeps);
-  std_error = sqrt ((c->n_indeps - 1.0) / (c->n_obs - 1.0));
+  std_error = sqrt (pspp_linreg_mse (c));
   t = tab_create (n_cols, n_rows, 0);
   tab_dim (t, tab_natural_dimensions);
   tab_box (t, TAL_2, TAL_2, -1, TAL_1, 0, 0, n_cols - 1, n_rows - 1);
@@ -281,7 +281,7 @@
   int n_cols = 7;
   int n_rows = 4;
   const double msm = c->ssm / c->dfm;
-  const double mse = c->sse / c->dfe;
+  const double mse = pspp_linreg_mse (c);
   const double F = msm / mse;
   const double pval = gsl_cdf_fdist_Q (F, c->dfm, c->dfe);
 

On Mon, Feb 23, 2009 at 02:30:20AM -0800, Erik Frebold wrote:
> When I do a linear regression analysis, the model summary always shows what 
> appear to be incorrect values for (overall) Std. Error of the Estimate, 
> regardless of the data set. It does show individual std. errors for the 
> constant and coefficient on X in "Coefficients" section of output and these 
> are correct, checked against R and SPSS. Am I missing something?  
> (probably... ;-) 
> 
> This is pspp 0.6.1 for 32bit i586, run on SuSE 10.3, installed from Dr. 
> Steuer's repository. 
> 
> example: 
> REGRESSION
>   /VARIABLES= x
>   /DEPENDENT=  y
>   /STATISTICS=COEFF R ANOVA.
> 
> (choose any x or y variable from any data I've tried)
> 
> Is this part of the regression procedure not complete yet?
> --
> Erik Frebold
> Vancouver, BC
> 
> 
> 
> ___
> Pspp-users mailing list
> Pspp-users@gnu.org
> http://lists.gnu.org/mailman/listinfo/pspp-users


___
Pspp-users mailing list
Pspp-users@gnu.org
http://lists.gnu.org/mailman/listinfo/pspp-users


Re: std error of estimate?

2009-02-23 Thread Erik Frebold
Wow, that was quick! :-)

Forgive my ignorance as I'm new to this-- re: your instructions as follows:
"To fix your own local copy, try this patch. Apply by cd'ing to the directory 
with the source
code, and run 
patch -p1 < regression.patch
Then rebuild pspp."

Wasn't sure where the patch file goes physically (and I did read man patch...) 
so I created a .txt file called regression.patch containing the patch text and 
put it in the source directory. Here's what happened:

---
patch -p1 < regression.patch

patching file src/math/linreg.c
patch:  malformed patch at line 4: design_matrix_destroy (cov);
---

Any suggestions?
--
Erik Frebold
Vancouver, BC



___
Pspp-users mailing list
Pspp-users@gnu.org
http://lists.gnu.org/mailman/listinfo/pspp-users


Re: std error of estimate?

2009-02-23 Thread Jason Stover
On Mon, Feb 23, 2009 at 01:54:33PM -0800, Erik Frebold wrote:
> patch -p1 < regression.patch
> Then rebuild pspp."
> 
> Wasn't sure where the patch file goes physically (and I did read man 
> patch...) so I created a .txt file called regression.patch containing the 
> patch text and put it in the source directory. Here's what happened:
> 
> ---
> patch -p1 < regression.patch
> 
> patching file src/math/linreg.c
> patch:  malformed patch at line 4: design_matrix_destroy (cov);
> ---
> 
> Any suggestions?

The line breaks in the email confused the patch program. Here is another
copy, without the line breaks:

http://math.gcsu.edu/~jhs/regression.patch

But there may be a more important problem here: You mentioned getting
PSPP from someone else. Did you compile it from source? If not, then
the patch won't help unless you either get the source code for PSPP
and build it on your own machine, or get a new, precompiled copy.


___
Pspp-users mailing list
Pspp-users@gnu.org
http://lists.gnu.org/mailman/listinfo/pspp-users