How to find the statistical mode?

前端 未结 30 1647
时光取名叫无心
时光取名叫无心 2020-11-21 07:00

In R, mean() and median() are standard functions which do what you\'d expect. mode() tells you the internal storage mode of the objec

30条回答
  •  醉话见心
    2020-11-21 07:41

    Calculating Mode is mostly in case of factor variable then we can use

    labels(table(HouseVotes84$V1)[as.numeric(labels(max(table(HouseVotes84$V1))))])
    

    HouseVotes84 is dataset available in 'mlbench' package.

    it will give max label value. it is easier to use by inbuilt functions itself without writing function.

提交回复
热议问题