Dr. Turkuaz
Dr. Turkuaz

Reputation: 39

Finding the distribution from the data

I try to find the distribution for this dataset. I tried with the fitdistrplus package

data <- data.matrix(Book1)
descdist(data,  discrete = FALSE)

but get this error:

Error in descdist(data, discrete = FALSE) : data must be a numeric vector

Upvotes: 1

Views: 2895

Answers (1)

HubertL
HubertL

Reputation: 19544

You can use instead

data <- as.numeric(Book1)
descdist(data,  discrete = FALSE)

This gets you this graph:

enter image description here

And these values:

summary statistics
------
min:  3   max:  35 
median:  5 
mean:  6.244898 
estimated sd:  3.517 
estimated skewness:  1.977063 
estimated kurtosis:  9.456783 

If you then decide that the closest is an exponentional distribution, you can get its parameters like this

ft <- fitdist(data, distr = "exp" )
ft

Fitting of the distribution ' exp ' by maximum likelihood 
Parameters:
      estimate  Std. Error
rate 0.1601307 0.002299016

And you can compare their density using this function:

denscomp(ft)

enter image description here

Upvotes: 5

Related Questions