Description Usage Arguments Value
Computation as in: http://en.wikipedia.org/wiki/Fraction_of_variance_unexplained
ss_est becomes zero if dvec_est equals dvec_0=rep(mean(dvec),length(dvec)). If dvec_est is better estimate than dvec_0, R2 is positive. If dvec_est is worse than dvec_0, R2 is negative.
1 | var_explained(dvec, dvec_est)
|
dvec |
[1,m] numeric, data vector |
dvec_est |
[1,m] numeric, data vector, an estimate of dvec |
A list with elements:
ss_tot: |
Sum of squares in dvec |
ss_est: |
Sum of squares in dvec_est |
ss_err: |
Sum of squares of dvec - dvec_est |
R2: |
Percentage of variance explained i.e. 1 - ss_err/ss_tot |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.