Skip to content

Instantly share code, notes, and snippets.

@mick001
Created August 28, 2015 19:40
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 mick001/38d1fd9b7ead448f04fb to your computer and use it in GitHub Desktop.
Save mick001/38d1fd9b7ead448f04fb to your computer and use it in GitHub Desktop.
How to make a rough check to see if your data is normally distributed part 2 (R). Full article at: http://www.firsttimeprogrammer.blogspot.com/2015/07/how-to-make-rough-check-to-see-if-your.html
# Skewness
library(moments)
print("Skewness:")
print("Normal")
skewness(data_norm)
print("Beta")
skewness(data_beta)
# < 0 skewed left (left tail)
# > 0 skewed right (right tail)
# = 0 normal
###############################################################
# Results
# > print("Skewness:")
# [1] "Skewness:"
# > print("Normal")
# [1] "Normal"
# > skewness(data_norm)
# [1] 0.08684767
# > print("Beta")
# [1] "Beta"
# > skewness(data_beta)
# [1] 1.091723
# > # < 0 skewed left (left tail)
# > # > 0 skewed right (right tail)
# > # = 0 normal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment