Skip to content

Instantly share code, notes, and snippets.

@druedin
Last active December 18, 2015 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save druedin/5842378 to your computer and use it in GitHub Desktop.
Save druedin/5842378 to your computer and use it in GitHub Desktop.
library(psych)
n <- 5000
x <- rnorm(n) # random values
r <- sapply(1:n, function(i) alpha(data.frame(x, c(x[1:i],rep.int(0,n-i))))$total$std.alpha)
plot(r, type="l", ylim=c(0,1), xlim=c(0,n), axes=FALSE, ylab="Alpha", xlab="Zero-Inflation (%)")
axis(2)
axis(1, at=seq(from=0,to=n,by=n/5), labels=seq(from=0,to=100,by=20))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment