Skip to content

R Frequently Asked Questions

Statistical Computing and Graphics in R

Menu
  • Learn R
    • R Basics
      • R FAQS about Package
      • R GUI
      • Using R packages
      • Missing Values
    • R Graphics
    • Data Structure
      • Data Frame
      • Matrices
      • List
    • R Programming
    • Statistical Models
  • R Quiz
    • MCQs R Programming
    • R Basic Quiz 7
    • MCQs R Debugging 6
    • MCQs R Vectors 5
    • R History & Basics 4
    • R Language Test 3
    • R Language MCQs 2
    • R Language MCQs 1
  • MCQs
    • MCQs Statistics
      • MCQs Basic Statistics
      • MCQs Probability
      • MCQs Graph & Charts
      • MCQs Sampling
      • MCQs Inference
      • MCQs Correlation & Regression
      • MCQs Time Series
      • MCQs Index Numbers
      • MCQs Quality Control 1
    • MCQS Computer
    • MCQs Mathematics Part-I
  • About ME
  • Contact Us
  • Glossary

Category: Exploring Data in R

Exploring Data in R

No Comments
| Exploring Data in R, R Graphics

Examination of data (Exploring Data), particularly graphical examination and representation of data is an important prelude to statistical data analysis and modeling. Note that there are some limitations on the kinds of graphs that we can create.

One should be familiar with standard procedures for exploratory data analysis, statistical graphics, and data transformation too. We can categorize the graphical representation of data on the basis of nature (or type) of variable, number of variables, and objectivity of analysis. For example, if we are comparing groups then comparison graphs such as bar graphs can be used and if we are interested in the kind of relationship between variables then a scatter plot can be useful.

  • Distributional Displays:
    The distributional displays include stem and leaf display, histograms, density estimates, quantile comparison plots, and box plots.
  • Plots of the Relationship between two variables:
    The graphical representations for the relationship between two variables include various versions of scatter plots, scatter plot smoothers, bivariate density estimates, and parallel box plots.
  • Multivariate Displays:
    Multivariate graphical representations include scatter plot matrices, coplots, and dynamic three dimensional scatter plots.

For exploring the data in R, following are some examples:

Stem and Leaf display and Histogram in R

attach(mtcars)
hist(mpg)
hist(mpg, nclass=3, col=3)
stem(mpg)

Density Estimates

Consider the following R code for a representation of distribution by smoothing the histogram.

hist(mpg, probability=T, ylab='Density')
lines(density(mpg, lwd=2))
points(mpg, rep(0, length(mpg)), pch="|")
lines(density(mpg, adjust=0.9), lwd=1)

The hist() function constructs the histogram with probability = TRUE specifying density scaling. The lines() function draws the density estimate on the graph having a thickness of the line as double due to parameter lwd=2. The points() function draws a one-dimensional scatter plot at the bottom of the graph by using a vertical bar as the plotting symbol. The second call to density in lines() function with adjust=0.9, specifies a bandwidth 0.9 the default value.

Quantile Comparison Plots

Quantile plots help in comparing the distribution of a variable with a theoretical distribution such as the normal distribution.

library(car)
qqPlot(mpg)

Note that the qqPlot() function is available in car library. The qq.plot() function is defunct.

Relationship Graphs

To explore the relationship between two quantitative variables use plot() function and for a more enhanced version of a scatter plot between two variables use scatterplot() function. This function plot the variables with least squares and non-parametric regression lines. For example,

plot(mpg, wt)
scatterplot(mpg, wt)
scatterplot(mpg, wt, labels=rownames(cyl))

CLICK to learn about plot() function in R

Share this:

  • Twitter
  • Facebook
  • LinkedIn
  • Skype
  • Tumblr
  • Pinterest
  • Print
  • WhatsApp
  • Telegram
  • Reddit
  • Pocket

Like this:

Like Loading...

Read More »

Subscribe via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 257 other subscribers

Search Form

Facebook

Facebook

Categories

  • Advance R Programming (3)
  • Data Analysis (10)
    • Comparisons Tests (2)
    • Statistical Models (8)
  • Data Structure (9)
    • Data Frame (2)
    • Factors in R (1)
    • List (2)
    • Matrices (2)
    • Vectors in R (1)
  • Importing/ Exporting Data (4)
    • R Data Library (4)
  • R Control Structure (3)
    • For loop in R (1)
    • Switch Statement (1)
  • R FAQS (18)
    • Missing Values (2)
    • R Basics (12)
    • R FAQS about Package (3)
    • R Programming (2)
  • R Graphics (4)
    • Exploring Data in R (1)
    • plot Function (2)
  • R Language Basics (4)
  • R Language Quiz (8)
  • Using R packages (2)
https://www.youtube.com/watch?v=MZpiMyAfnYQ&list=PLB01qg3XnNiMbKkvP2wYzzHkv6ZekaKZx

Posts: itfeature.com: Basic Statistics and Data Analysis

MCQs Time Series Analysis 5

An Introduction to the Pakistan Bureau of Statistics

Prepared by: Dr. Abdul Majid, Statistical Officer, Pakistan Bureau of Statistics, Regional Office Multan. Introduction (Pakistan Bureau of Statistics) Pakistan Bureau of Statistics (PBS) is the prime official agency of Pakistan. It is responsible…

Multiple Linear Regression Models

A wide scatter of points around the regression line shows that there is still room for further improvement. Including extra variables in the model will map up some of the residual variability remaining after…

MCQs Estimation Quiz 7

MCQs from Statistical Inference cover the topics of Estimation and Hypothesis Testing for the preparation of exams and different statistical job tests in Government/ Semi-Government or Private Organization sectors. These tests are also helpful…

Job Interview: Recently Asked Questions

Following are different Job Interview questions asked in interviews related to Jobs of Statistical Officer, Data Analysts, Lecturer in Statistics, Enumerator, etc. These questions are also useful for job interviews related to different disciplines….

Posts: gmstat.com: GM Statistics

MCQs Econometrics Quiz 5

This quiz is about Econometrics, which covers the topics of Regression analysis, correlation, dummy variable, multicollinearity, heteroscedasticity, autocorrelation, and many other topics. Let’s start with MCQs Econometrics test An application of different statistical methods applied to the economic data used…

MCQs Computer Programming – 1

The Quiz is about MCQs of Computer Programing and Programming languages. Take another Quiz bout Application Software If you Found that the Above POSTED MCQ is/ are WRONGPLEASE COMMENT below The MCQ with the CORRECT ANSWER and its DETAILED EXPLANATION.

Islamic Quiz – 2

Islamic Quiz for PPSC Lecturer Test Perform another Quiz about Islamic Quiz 1 If you Found that the Above POSTED MCQ is/ are WRONGPLEASE COMMENT below The MCQ with the CORRECT ANSWER and its DETAILED EXPLANATION.

Islamic Quiz – 1

Islamic Quiz for PPSC Lecturer Test Perform another Quiz about Computer If you Found that the Above POSTED MCQ is/ are WRONGPLEASE COMMENT below The MCQ with the CORRECT ANSWER and its DETAILED EXPLANATION.

MCQs Computer Basics 4

This quiz is about MCQS computer Basics. The greatest scientists of their era, Abu Jaffar Muhammad Ibn Musa Al-Khawarizmi (780-850), Alan Mathison Turing (1912-1954), and John Von Neuman (1903-1957) took part in the invention of computers. A mathematician and a…

R Frequently Asked Questions 2022 . Powered by WordPress

%d bloggers like this:
    pixel