Sunteți pe pagina 1din 30

Using R Studio to calculate Mean,

Median, and Standard Deviation


Hi! Im Minh. In this step-by-step guide, I will walk you
through how to use R Studio to calculate mean, median, and
standard deviation in which mean and standard deviation are
two of the most common measures used in statistics. These
statistics are part of two sets of measures called measures of
central tendency and measures of dispersion .
Using R Studio to calculate Mean,
Median, and Standard Deviation
After completing this walk-through, you will be able to :
- create a new project in R Studio
- change the levels of measurement of variable in R Studio
- use R Studio to calculate mean, median, and standard
deviation
- select a subset of data in R Studio and calculate its mean,
median, and standard deviation
- save your work
Lets get started!
MAIN MENU

How do I start a new R Studio project?

How do I calculate mean, median, and standard deviation of a


dataset?

How do I select a subset of data?

How do I save my work?

Resources
MAIN MENU

Why do I need a folder?

What data will I work on for this project?

How do I create a new R Studio project in an


existing folder?

How do I import a .csv file into R Studio?

How can I create a new R Script and what is a R


script for?
MAIN MENU

You need to create a folder to


store all the related files.
Lets name our folder
Practice for this practice.

BACK
MAIN MENU

In this project, we will work


on data saved in a .csv file.
Type the data in page 181 in
Excel, save it in .csv and then
save it in the folder you
created.

BACK
MAIN MENU
MAIN MENU

BACK
MAIN MENU

BACK NEX
MAIN MENU

BACK
MAIN MENU

BACK NEX
T
MAIN MENU

BACK
MAIN MENU

How can I assess the variables?

Why do I need psych package?

How do I request the descriptive statistics for all variables?

What does the descriptive table look like and what is * for?

How can I view the descriptive table with only mean, MDN,
and SD?

What is the table for APA write up like?


MAIN MENU

Before you calculate central


tendency and variability,
make sure all levels of
measurement are correctly
identified.

BACK NEXT
MAIN MENU

BACK NEXT
MAIN MENU

BACK
MAIN MENU

The psych package


contains a useful command
for requesting descriptive
statistics like the mean,
median, and standard
deviation.

BACK NEXT
MAIN MENU

BACK
MAIN MENU

BACK
MAIN MENU

BACK
MAIN MENU

BACK
MAIN MENU

BACK
MAIN MENU

How can I select a subset of data with a certain criteria and generate a des
criptive table?

How can I generate a descriptive table with only mean, standard deviation,
and median ?

What is the table for APA write up like?


MAIN MENU

BACK
MAIN MENU

BACK NEX
MAIN MENU

BACK
MAIN MENU

BACK
MAIN MENU

BACK
MAIN MENU

Datasets for practice

Alternative ways to calculate central tendency and variability


in R Studio
MAIN MENU

Datasets for practice

You can find more datasets for practice through the use of
various sources, to name a few as follows:
- Datasets in Statistical Reasoning in Quantitative Research
by Wang et al. (2014)
- TIMSS database at http://timssandpirls.bc.edu
- PISA database at http://www.oecd.org/pisa/data/
- US federal database at https://www.data.gov

BACK
MAIN MENU
Alternative ways to
calculate M, SD, MDN in R
Studio
There are many ways to calculate mean, standard deviation,
and median in R Studio. To know more, you can reference
these video clips:
- https://www.youtube.com/watch?v=WtGs8DS5QLQ
- https://www.youtube.com/watch?v=MyGBZf9LWbs

BACK

S-ar putea să vă placă și