Skip to content

Instantly share code, notes, and snippets.

@xuanlongma
Last active December 14, 2015 11:49
Show Gist options
  • Save xuanlongma/5082391 to your computer and use it in GitHub Desktop.
Save xuanlongma/5082391 to your computer and use it in GitHub Desktop.
compute r^2 values for nonlinear regression model.
## m is the nonlinear model, x is the variable
r2 <- 1 - (deviance(m) / sum((x - mean(x)) ^ 2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment