-1

I am trying to get a table of groupwise descriptive stats (number of observations, Mean, SD, Kurtosis, skewness), specifically for one variable(daily_return), from a time series data-frame that includes multiple groups. I am interested in getting the descriptive stats for ranknow < 21, data as follows:


Symbol Name Ranknow N Mean Sd Kurtosis


My data frame has the below structure:

Slug symbol name date ranknow close spread daily_returns

melpomene
  • 84,125
  • 8
  • 85
  • 148
  • 1
    Welcome to SO! This community has a few [rules](https://stackoverflow.com/help/on-topic) and [norms](https://stackoverflow.com/help/how-to-ask), and following them will help you get a good answer to your question. In particular, it's best to provide an [MCVE](https://stackoverflow.com/help/mcve) (a minimum, complete, and verifiable example). Check out [this page](https://stackoverflow.com/a/5963610/4573108) for tips regarding R-specific MCVEs. Thanks and good luck! – mischva11 Aug 22 '18 at 21:58

1 Answers1

0

It sounds like you just need to use the subset function where ranknow <21 df <- df[ which(ranknow < 21, ] then run summary(df) also run kurtosis(df) and skewness(df) *both of these are part of the moments package.

  • Hi Sarah, Thanks a lot for your reply. I have multiple columns in the dataframe and I need to get the groupwise ( rankwise) summary of a specific column. The dataframe contains : Slug symbol name date ranknow close spread daily_returns ... I want the output to be : Symbol Name Ranknow N Mean Sd Kurtosis .... Hope this helps. – Jayant rao Aug 23 '18 at 01:41