R Programming for numerical measures

© All Rights Reserved

36 views

R Programming for numerical measures

© All Rights Reserved

- mb0040
- Ch3 Practice
- introduction to mathmatical statistics
- Statistics
- Chapter 04
- Initial Bounds on the Relative Magnitude of Ratio Averages
- ARTIKEL ILMIAH REALIZED VOLATILITY, ARFIMA
- Quality Guru
- A study on day-of-the-week-effect of selected scrips with reference to banking sector
- Chapter 3, Summary Measures.ppt
- Statistics.
- Discrim Output
- 408 Variance Sol
- Statistics Study Guide - Variance
- 8
- Davis - CH5 Kriging
- Essential Stats for Decision Making-1 Descriptive Stats-2011
- ejc_t0_engS
- hayashi_ch3_4-_gmm
- eBooks 2005 2006 Msc Trim3 2. Some Aspects of Succesive Sampling Kaustav Aditya

You are on page 1of 8

CSSSPEC4

(Modeling and Simulation Using MATLAB)

EXERCISE

5

ELEMENTARY STATISTICS WITH R/MATLAB:

NUMERICAL MEASURES

<Name of Student>

<Data Performed>

<Name of Professor>

<Date Submitted>

I.

Objectives:

Cognitive

a) Review on the basic statistical concepts on numerical measures.

Psychomotor:

a Create fast solutions for elementary statistics on numerical measures.

Affective

a Appreciate how R programming can simplify and hasten the solution of numerical

measures problems.

II.

BACKGROUND INFORMATION

Mean

The mean of an observation variable is a numerical measure of the central location of the

data values. It is the sum of its data values divided by data count.

Hence, for a data sample of size n, its sample mean is defined as follows:

To find the mean eruption duration in the data set faithful, we apply the mean function to

compute the mean value of eruptions.

Median

The median of an observation variable is the value at the middle when the data is sorted

in ascending order. It is an ordinal measure of the central location of the data values.

To find the median of the eruption duration in the data set faithful, we apply the median

function to compute the median value of eruptions.

Quartile

There are several quartiles of an observation variable. The first quartile, or lower quartile,

is the value that cuts off the first 25% of the data when it is sorted in ascending order. The

second quartile, or median, is the value that cuts off the first 50%. The third quartile, or

upper quartile, is the value that cuts off the first 75%.

To find the quartiles of the eruption durations in the data set faithful, we apply the

quantile function to compute the quartiles of eruptions.

The first, second and third quartiles of the eruption duration are 2.1627, 4.0000 and

4.4543 minutes respectively.

Percentile

The nth percentile of an observation variable is the value that cuts off the first n percent of

the data values when it is sorted in ascending order.

To find the 32nd, 57th and 98th percentiles of the eruption durations in the data set

faithful, we apply the quantile function to compute the percentiles of eruptions with the

desired percentage ratios.

The 32nd, 57th and 98th percentiles of the eruption duration are 2.3952, 4.1330 and 4.9330

minutes respectively.

Range

The range of an observation variable is the difference of its largest and smallest data

values. It is a measure of how far apart the entire data spreads in value.

To find the range of the eruption duration in the data set faithful, we apply the max and

min function to compute the largest and smallest values of eruptions, then take the

difference.

Interquartile Range

The interquartile range of an observation variable is the difference of its upper and lower

quartiles. It is a measure of how far apart the middle portion of data spreads in value.

To find the interquartile range of eruption duration in the data set faithful, we apply the

IQR function to compute the interquartile range of eruptions.

Box Plot

The box plot of an observation variable is a graphical representation based on its

quartiles, as well as its smallest and largest values. It attempts to provide a visual shape of

the data distribution.

To find the box plot of the eruption duration in the data set faithful, we apply the boxplot

function to produce the box plot of eruptions.

Variance

The variance is a numerical measure of how the data values is dispersed around the mean.

In particular, the sample variance is defined as:

Similarly, the population variance is defined in terms of the population mean and

population size N:

To find the variance of the eruption duration in the data set faithful, we apply the var

function to compute the variance of eruptions.

Standard Deviation

The standard deviation of an observation variable is the square root of its variance.

To find the standard deviation of the eruption duration in the data set faithful, we apply

the sd function to compute the standard deviation of eruptions.

Covariance

The covariance of two variables x and y in a data sample measures how the two are

linearly related. A positive covariance would indicates a positive linear relationship

between the variables, and a negative covariance would indicate the opposite.

The sample covariance is defined in terms of the sample means as:

as:

To find the covariance of the eruption duration and waiting time in the data set faithful,

we observe if there is any linear relationship between the two variables and we apply the

cov function to compute the covariance of eruptions and waiting.

The covariance of the eruption duration and waiting time is 13.978. It indicates a positive

linear relationship between the two variables.

Central Moment

The kth central moment (or moment about the mean) of a data population is:

Similarly, the kth central moment of a data sample is:

To find the third central moment of eruption duration in the data set faithful, we apply the

function moment from the e1071 package. As it is not in the core R library, the package

has to be installed and loaded into the R workspace.

Skewness

The skewness of a data population is defined by the following formula, where 2 and 3

are the second and third central moments.

Intuitively, the skewness is a measure of symmetry. As a rule, negative skewness

indicates that the mean of the data values is less than the median, and the data distribution

is left-skewed. Positive skewness would indicates that the mean of the data values is

larger than the median, and the data distribution is right-skewed.

To find the skewness of eruption duration in the data set faithful, we apply the function

skewness from the e1071 package to compute the skewness coefficient of eruptions. As

the package is not in the core R library, it has to be installed and loaded into the R

workspace.

The skewness of eruption duration is -0.41355. It indicates that the eruption duration

distribution is skewed towards the left.

Kurtosis

The kurtosis of a univariate population is defined by the following formula, where 2 and

4 are the second and fourth central moments.

Intuitively, the kurtosis is a measure of the peakedness of the data distribution. Negative

kurtosis would indicates a flat data distribution, which is said to be platykurtic. Positive

kurtosis would indicates a peaked distribution, which is said to be leptokurtic.

Incidentally, the normal distribution has zero kurtosis, and is said to be mesokurtic.

To find the kurtosis of eruption duration in the data set faithful, we apply the function

kurtosis from the e1071 package to compute the kurtosis of eruptions. As the package is

not in the core R library, it has to be installed and loaded into the R workspace.

The kurtosis of eruption duration is -1.5116, which indicates that eruption duration

distribution is platykurtic. This is consistent with the fact that its histogram is not bellshaped.

III.

EXPERIMENTAL PROCEDURE:

Use the faithful dataset to answer for the following:

1.

Find the mean eruption waiting periods in faithful.

2.

Findthemedianoftheeruptionwaitingperiodsinfaithful.

3.

Find the quartiles of the eruption waiting periods in faithful.

4.

Find the 17th, 43rd, 67th and 85th percentiles of the eruption waiting periods in faithful.

5.

Find the range of the eruption waiting periods in faithful.

6.

Find the interquartile range of eruption waiting periods in faithful.

7.

Find the box plot of the eruption waiting periods in faithful.

8.

Findthevarianceoftheeruptionwaitingperiodsinfaithful.

9.

Find the standard deviation of the eruption waiting periods in faithful.

10.

Find the third central moment of eruption waiting period in faithful.

11.

Find the skewness of eruption waiting period in faithful.

12.

Find the kurtosis of eruption waiting period in faithful.

1. Cite samples of situations when a left skew is preferred than a right skew. Cite samples of

situations when a right skew is preferred than a left skew.

2. Why is kurtosis a measured value in statistics? What does it imply and how does its value

contribute to the analysis of a given data set?

- mb0040Uploaded byjobin
- Ch3 PracticeUploaded byVictor Paige
- introduction to mathmatical statisticsUploaded by규사무엘
- StatisticsUploaded byapi-3731661
- Initial Bounds on the Relative Magnitude of Ratio AveragesUploaded byTI Journals Publishing
- Chapter 04Uploaded bythom
- ARTIKEL ILMIAH REALIZED VOLATILITY, ARFIMAUploaded byAkira Maria
- Quality GuruUploaded bytehky63
- A study on day-of-the-week-effect of selected scrips with reference to banking sectorUploaded byIOSRjournal
- Chapter 3, Summary Measures.pptUploaded byZoel Dirga Dinhi
- Statistics.Uploaded bySrinivas Polikepati
- Discrim OutputUploaded bydkanand86
- 408 Variance SolUploaded byLi Nguyen
- Statistics Study Guide - VarianceUploaded byldlewis
- 8Uploaded byMAnohar Kumar
- Davis - CH5 KrigingUploaded byctasich
- Essential Stats for Decision Making-1 Descriptive Stats-2011Uploaded byMazhar Ali
- ejc_t0_engSUploaded byJose
- hayashi_ch3_4-_gmmUploaded byShweta Jain
- eBooks 2005 2006 Msc Trim3 2. Some Aspects of Succesive Sampling Kaustav AdityaUploaded byRosa Gonzalez
- NESTED_chap44.pdfUploaded byVladimiro Ibañez Quispe
- IMP 1 probability.pdfUploaded bySanjay Tiwari
- RandomUploaded bypatrick fajardo
- Introduction to Actuarial Science - ElementaryUploaded byPolelar
- Statistics Notes on Random VariablesUploaded byDillon Chew
- kerapuhan cntikUploaded byVeera Shanty
- Iron Ore Body ModelingUploaded byNurul Magfirah
- Risk ManagementUploaded byFrosterSmile WP
- 4.2 Variance AnalysisUploaded byPrabhakar Reddy
- Gage Rr Using Anova (1)Uploaded byRavindra Erabatti

- Exporting an RDBMS Table to a Flat FileUploaded byravi_405
- Academic Life in Emergency Medicine 52 Articles in 52 Weeks_ Landmark EM Articles 2013 - Academic Life in Emergency MedicineUploaded byPkern
- 56313659-Euro-Currency-Market.pdfUploaded bynancyagarwal
- Abu-Mahdi USGS Petroleum System AnalysisUploaded byHanaga Shen
- Master Thesis Steven Van HarenUploaded byCarlos E. Manglano Villamarín
- The Sims 3 (PC) Cheat Codes, Hints, And HelpUploaded byFlavio Takeuchi
- TXP OverviewUploaded byscribdkhatn
- Semen AnalysisUploaded byStephanie Bragat
- LSD1204 - Defenses Againt Large Scale Online Password Gussing Attacks by Using Persuasive Click PointsUploaded byRamesh Dhanapathi
- European Environment Agency Annual Report 2010 and Environmental Statement 2011Uploaded byUğur Özkan
- Statistics with RUploaded bydarwin_hua
- Richard l. CalingasanUploaded byIndustrial Welders
- Present Perfect and Used to ExercisesUploaded byRita Andrade
- Hull_OFOD9e_MultipleChoice_Questions_and_Answers_Ch05.docUploaded byguystuff1234
- Booking Test Case v 0.1 DraftUploaded bygfrbggf
- Language: Origin and Meaning by John ZerzanUploaded byMike McD
- Tissue PreparationUploaded byDajana Shallari
- RAF List Apr 1939Uploaded byRobert MacDonald
- ENGUploaded byShahil Alam
- Asthma-chronic obstructive pulmonary disease overlap syndrome (ACOS) current literature review..pdfUploaded byLesley Rose
- APF Engineering Manual b en-USUploaded byHugo Diaz
- ISO 8217 - 2012 Fuel StandardUploaded bysh_gasimov
- 4970484Uploaded byHaripradeep
- Lesson 1 Introduction to File ManagementUploaded byRussel Ponferrada
- 7. Java Petroleum GeologyUploaded bydelacour
- environmental_swabbing.pdfUploaded bynilebhal
- RBACUploaded bythanhson1085
- Military TacticsUploaded bymanoj kumar
- Fundamentals of Fluid Mechanics, 6th Edition By Munson answers.pdfUploaded byඋලපනේ ඉෆාස්
- Research Praposal PPTUploaded byswatisingla786

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.