Producing a distribution for categorical data

6 次查看(过去 30 天)
Hi,
I am relatively new to MATLAB, and to this point have been following tutorials slowly and effectively although came unstuck today.
In the following video, at around 37:00
the presenter uses the data he is extracted to produce a distribution. However as I understand it, my matlab package does not allow for the use of the function 'mpgdistribution()'. I don't fully understand how this function has been formed. I am looking for an alternative way of producing the same plot. I am capable of producing a histogram for MPG, but am unable to separate the data into two different distributions based on their category, (City/Highway).
Using R, I would use GGPlot. However, after around an hour of googling, Ive found no alternative.

采纳的回答

Abdolkarim Mohammadi
编辑:Abdolkarim Mohammadi 2020-8-25
You can find all of the files in the video at the end of the discription, including mpgdistribution(). It basically contains codes to fit the Normal distribution to the data and draw some figures. It contains functions like fitdist() for distribution fitting and pdf() for probability density function, which requires Statistics and Machine Learning toolbox. You couldn't find documentation for mpgdistribution() because it is not a standard MATLAB library.
https://www.mathworks.com/matlabcentral/fileexchange/64219-beyond-excel-enhancing-your-data-analysis-with-matlab-august-2017
  3 个评论
Abdolkarim Mohammadi
Exactly. You should also notice that mpg in mpgdistribution() refers to Mile Per Gallon (MPG), which is one of the variables in that example, so it wouldn't be a general MATLAB function.
cwj2000
cwj2000 2020-8-25
Thanks.
Yes, I had understood what MPG was referring to, and was therefore confused how the function came about. Thanks for all your help

请先登录,再进行评论。

更多回答(0 个)

产品


版本

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by