问题
Is there a one-liner in R that will give me the following stats for each numerical column of a dataframe?
count, mean, median, q3, q1, iqr, mode, min, max, antimode, pstdev, sstdev, pvar, svar, mad, madraw, pskew, sskew, pkurt, skurt, dpo, jarque
Something like an extended method of summary(dt)? Any ideas?
回答1:
The describe() method in the psych package does include kurtosis and skew:
dt = data.frame(a=rnorm(1000),b=rnorm(1000))
library(psych)
describe(dt)
vars n mean sd median trimmed mad min max range skew kurtosis se
a 1 1000 0 1.01 0 0.01 1.00 -3.59 3.36 6.95 -0.06 0.17 0.03
b 2 1000 0 0.97 0 0.00 0.93 -3.15 3.10 6.25 -0.08 -0.07 0.03
来源:https://stackoverflow.com/questions/28814322/r-extended-summary-numerical-values-including-kurtosis-skew-etc