Patterns in static

Apophenia

OLS/GLS: The linear projection methods

Defines

Functions


Detailed Description


Define Documentation

#define apop_estimate_r_squared ( in   ) 

Function Documentation

apop_data* apop_estimate_coefficient_of_determination ( apop_model in  ) 

Good ol' $R^2$. Let $Y$ be the dependent variable, $\epsilon$ the residual, $n$ the number of data points, and $k$ the number of independent vars (including the constant). Returns an apop_data set with the following entries (in the vector element):

  • $ SST \equiv \sum (Y_i - \bar Y) ^2 $
  • $ SSE \equiv \sum \epsilon ^2 $
  • $ R^2 \equiv 1 - {SSE\over SST} $
  • $ R^2_{adj} \equiv R^2 - {(k-1)\over (n-k-1)}(1-R^2) $

Internally allocates (and frees) a vector the size of your data set.

Parameters:
in The estimate. I need residuals to have been calculated, and the first column of in->data needs to be the dependent variable.
Returns:
: a $1 \times 5$ apop_data table with the following fields:
  • "R_squared"
  • "R_squared_adj"
  • "SSE"
  • "SST"
  • "SSR"
Parameters:
in An estimated model. I use the expected table (which gives the expected value and residual for each observation), so if you had explicitly set want_expected_value=0 when doing your estimation, you'll have to redo the estimation without that.

SourceForge.net Logo

Autogenerated by doxygen on 23 Nov 2009.