Читать книгу Statistics and Probability with Applications for Engineers and Scientists Using MINITAB, R and JMP - Bhisham C. Gupta, Irwin Guttman - Страница 96

MINITAB

Оглавление

1 Enter the data in column C1.

2 From the Menu bar, select Stat Basic Statistics Display Descriptive Statistics:

3 In the dialog box that appears, enter C1 under variables and select the option Statistics.

4 A new dialog box Descriptive Statistics: Statistics appears. In this dialog box, select the desired statistics and click OK in the two dialog boxes. The values of all the desired statistics as shown below will appear in the Session window.

USING R

We can use a few built in functions in R to get basic summary statistics. Functions ‘mean()’, ‘sd()’, and ‘var()’ are used to calculate the sample mean, standard deviation, and variance, respectively. The coefficient of variation can be calculated manually using the mean and variance results. The ‘quantile()’ function is used to obtain three quantiles and the minimum and maximum. The function ‘range()’ as shown below can be used to calculate the range of the data. The task can be completed by running the following R code in the R Console window.

x = c(17,12,12,14,15,16,16,16,16,17,17,18,18,18,19,19,20,20,20,20,20, 20,20,20,21,21,21,22,22,23,23,23, 24,24,25,26,26,28,28,28) #To concatenate resulting mean, standard deviation, variance, and coefficient of variation c(mean(x), sd(x), var(x), 100*sd(x)/mean(x)) 20.125000 4.089934 16.727564 20.322656 #To obtain quartiles including min and max quantile(x)

0% 25% 50% 75% 100%
12 17 20 23 28

#To obtain the range we find Max‐Min range(x)[2]‐range(x)[1] 16

Statistics and Probability with Applications for Engineers and Scientists Using MINITAB, R and JMP

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