Statistics and Probability with Applications for Engineers and Scientists Using MINITAB, R and JMP. Bhisham C. Gupta. Читать онлайн. Newlib. NEWLIB.NET

Автор: Bhisham C. Gupta
Издательство: John Wiley & Sons Limited
Серия:
Жанр произведения: Математика
Год издания: 0
isbn: 9781119516620
Скачать книгу
Cumulative frequency histogram of survival time for the data in Example 2.4.5, displaying 7 adjacent vertical bars in ascending heights.

      We can use the built in ‘hist()’ function in R to generate histograms. Extra arguments such as ‘breaks’, ‘main’, ‘xlab’, ‘ylab’, ‘col’ can be used to define the break points, graph heading, images‐axis label, images‐axis label, and filling color, respectively. The specific argument ‘right = FALSE’ should be used to specify that the upper limit does not belong to the class. To obtain the cumulative histogram, we apply the ‘cumsum()’ function to frequencies obtained from the histogram function. The task can be completed by running the following R code in the R Console window.

      SurvTime = c(60,100,130,100,115,30,60,145,75,80,89,57,64,92,87,110, 180,195,175,179,159,155, 146,157,167,174,87,67,73,109,123,135,129, 141,154,166,179,37,49,68,74,89,87,109,119,125,56,39,49,190) #To plot the histogram hist(SurvTime, breaks=seq(30,198, by=24), main=‘Histogram of Survival Time’, xlab=‘Survival Time’, ylab=‘Frequency’, col=‘grey’, right = FALSE) #To obtain the cumulative histogram, we replace cell frequencies by their cumulative frequencies h = hist(SurvTime, breaks=seq(30,198, by=24), right = FALSE) h$counts = cumsum(h$counts) #To plot the cumulative histogram plot(h, main=‘Cumulative Histogram’, xlab=‘Survival Time’, ylab=‘Cumulative Frequency’, col=‘grey’) Below, we show the histograms obtained by using the above R code.Left: Histogram of survival time displaying adjacent vertical bars of various lengths. Right: Cumulative histogram displaying adjacent vertical bars of increasing heights.

Graph of cumulative frequency versus initial point displaying an ascending curve with eight dot markers lying on it.

      2.4.5 Line Graph

Months January February March April May June July August September October November December
LM sold 2 1 4 10 57 62 64 68 40 15 10 5

      From the line graph in Figure 2.4.12, we can see that the sale of lawn mowers is seasonal, since more mowers were sold in the summer months. Another point worth noting is that a good number of lawn mowers were sold in September when summer is winding down. This may be explained by the fact that many stores want to clear out such items as the mowing season is about to end, and many customers take advantage of clearance sales. Any mower sales during winter months may result because of a discounted price, or perhaps the store may be located where winters are very mild, and there is still a need for mowers, but at a much lower rate.

Image described by caption and surrounding text.

      2.4.6 Stem‐and‐Leaf Plot

      Suppose