Created
July 22, 2014 10:29
-
-
Save christophergandrud/4b6ac56c10e4b8b58ae8 to your computer and use it in GitHub Desktop.
Simple function to transform a dependent variable that in [0,1] rather than (0, 1) to beta regression. Suggested by Smithson & Verkuilen (2006).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #' Simple function to transform a dependent variable that in [0,1] rather than | |
| #' (0, 1) to beta regression. Suggested by Smithson & Verkuilen (2006). | |
| #' | |
| #' @param y vector of the dependent variable that is in [0, 1]. | |
| svTransform <- function(y) | |
| { | |
| n <- length(y) | |
| transformed <- (y * (n-1) + 0.5)/n | |
| return(transformed) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment