¡Descarga Statistics Practice with R: Analyzing Old Faithful Geyser Data - Prof. Acho y más Diapositivas en PDF de Estadística Aplicada solo en Docsity!
F. Palacios 2016 – draft 2.
Statistics practice with R
P2.4 Activities: Descriptive Statistics
Francesc Palacios Departament de Matemàtiques Universitat Politècnica de Catalunya February 2016 draft 2.
F. Palacios 2016 – draft 2.
Problem presentation
The dataset faithful contains information on the eruption time and the waiting time between consecutive eruptions in the geyser Old Faithful
F. Palacios 2016 – draft 2.
Activity 1. Getting dataset information
F. Palacios 2016 – draft 2.
Activity 2. Accessing the data
- Write the name faithful in the R Console to get access to the data
- Alternatively, you can type edit(faithful) to get an spreadsheet presentation of the dataframe. To resume your work with R, close the spreadsheet
- Observe that the dataframe contains two variables: eruptions and waiting
- What kind of variable are these variables?
- What do they measure?
- In what units?
F. Palacios 2016 – draft 2.
Activity 3. Summary of statistics
- Compute a summary of statistics with the code summary(faithful)
- What are the variation ranges for the eruption time and the waiting time?
- What is the value of the average eruption time?
- What is the average time between consecutive eruptions?
F. Palacios 2016 – draft 2.
Activity 3. Summary of statistics
- Average eruption time 3.488 min
- Average waiting time 70.9 min
- Variation range for the eruption time 5.1-1.6 = 3.5min
- Variation range for the waiting time 96.0-43.0=53.0min
F. Palacios 2016 – draft 2.
Activity 4. Eruption time histogram
Bimodal histogram There are two subpopulations
this also works
F. Palacios 2016 – draft 2.
Activity 5. Waiting time histogram
- Create a vector wt containing the waiting times
- Draw a histogram for the data contained in wt
- Is the histogram bell-shaped?
- What does the histogram suggest?
F. Palacios 2016 – draft 2.
Activity 6. Boxplot and outliers
- Draw a boxplot for the data in et and in wt
- Are there any outlier?
- Check the output of the code boxplot(faithful)
F. Palacios 2016 – draft 2.
Activity 6. Boxplot and outliers
There are no outliers
F. Palacios 2016 – draft 2.
Activity 7. Estimate waiting time
With an estimate waiting time between eruptions of 60.9 min, a 30.5% of the tourists would have missed the next eruption (and this means a lot of complains)
F. Palacios 2016 – draft 2.
Activity 8. Relation between the variables
- Draw a scatterplot with the code plot(et,wt)
- Can you appreciate any relation between the variables?
- What is your objective variable?
- Do you think that the eruption time can be a good predictor of the waiting time?
- Can we accept a linear relation between these variables?
- Do you think that a linear model can be suitable to describe the relation between these two variables?
F. Palacios 2016 – draft 2.
Activity 9. Splitting subpopulations
- Observe the eruption time histogram. Could we say that there are two different kinds of eruptions: short and long?
- Make a (visual) estimate of the average duration corresponding to the short eruptions
- Make a (visual) estimate of the average duration corresponding to the long eruptions
- Do you believe that ts=3 min is a suitable value to separate short and long eruptions
F. Palacios 2016 – draft 2.
Activity 9. Splitting subpopulations
groups separation point
lower group average (^) upper group average