Producing a distribution for categorical data

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.

 Respuesta aceptada

Abdolkarim Mohammadi
Abdolkarim Mohammadi el 25 de Ag. de 2020
Editada: Abdolkarim Mohammadi el 25 de Ag. de 2020

1 voto

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 comentarios

cwj2000
cwj2000 el 25 de Ag. de 2020
Great, thanks!
So am i right in saying that there is not a built in function in matlab that would quickly produce a plot like this? Instead you'd need to either create or copy a function into you working folder?
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 el 25 de Ag. de 2020
Thanks.
Yes, I had understood what MPG was referring to, and was therefore confused how the function came about. Thanks for all your help

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2017a

Preguntada:

el 25 de Ag. de 2020

Comentada:

el 25 de Ag. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by