Skip to content

Instantly share code, notes, and snippets.

@dmarcelinobr
Created May 30, 2013 15:10
Show Gist options
  • Save dmarcelinobr/5678611 to your computer and use it in GitHub Desktop.
Save dmarcelinobr/5678611 to your computer and use it in GitHub Desktop.
# See: http://stats.stackexchange.com/questions/12148/looking-for-a-name-for-a-mean-influencing-statistic
# Somewhat personalized
sdfBeta <- function(numer, denom = 1){
if(identical(1, denom)){denom <- rep(1, length(numer))}
Bj <- sum(numer, na.rm = T) / sum(denom, na.rm = T)
Bjni <- (sum(numer, na.rm = T) - numer) / (sum(denom, na.rm = T) - denom)
StdError <- sd(Bjni, na.rm = T)
Value <- (Bj - Bjni) / StdError
names(Value) <- names(numer)
return(Value)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment