Читать книгу Probability with R - Jane M. Horgan - Страница 46

2.4.1 Creating Functions

Оглавление

Occasionally, you might require some statistical functions that are not available in R. You will need to create your own function. Let us take, as an example, the skewness coefficient, which measures how much the data differ from symmetry.

The skewness coefficient is defined as

(2.1)

A perfectly symmetrical set of data will have a skewness of 0; when the skewness coefficient is substantially greater than 0, the data are positively asymmetric with a long tail to the right, and a negative skewness coefficient means that data are negatively asymmetric with a long tail to the left. As a rule of thumb, if the skewness is outside the interval , the data are considered to be highly skewed. If it is between 1 and 0.5 or 0.5 and 1, the data are moderately skewed.

Probability with R

Подняться наверх