intro to r presentation
TRANSCRIPT
-
7/25/2019 Intro to R Presentation
1/50
Introduction to R: The Basics
Rosales de Veliz L., David S.L., McElhiney D.,
Price E., Broo!s ".#ontri$utions %ro& Ra'an. M., Terzi. (.,
S&ith. E.
Mid)estern Educational Research *ssociation in Illinois, +ove&$er -.
-
7/25/2019 Intro to R Presentation
2/50
/vervie)
. "ettin' Started. The Basics
0. Data In1ut
2. R #o&&ander
3. Descri1tive Statistics
4. Means #o&1arisons
5. Relationshi1s
6. (actor *nalysis
-
7/25/2019 Intro to R Presentation
3/50
"ettin' Started
7 To install R on your M*# or P# you %irst need to 'o tohtt1:88))).r91roect.or'8.
7
http://www.r-project.org/http://www.r-project.org/ -
7/25/2019 Intro to R Presentation
4/50
-
7/25/2019 Intro to R Presentation
5/50
-
7/25/2019 Intro to R Presentation
6/50
-
7/25/2019 Intro to R Presentation
7/50
-
7/25/2019 Intro to R Presentation
8/50
-
7/25/2019 Intro to R Presentation
9/50
-
7/25/2019 Intro to R Presentation
10/50
Installin' Pac!a'es
-
7/25/2019 Intro to R Presentation
11/50
-
7/25/2019 Intro to R Presentation
12/50
;sin' allo)s searchin' %or hel1 in various )ays
-
7/25/2019 Intro to R Presentation
13/50
R Basics
7 R is o$ect $ase
> Ty1es o% o$ects ?scalar, vector, &atrices
and arrays>*ssi'n&ent o% o$ects
7 Buildin' a data %ra&e
-
7/25/2019 Intro to R Presentation
14/50
R as a #alculator
@ 33-A---
C 033-
or various calculations in the sa&e ro)
@ A0 3F 494
C 3C 23
C -
-
7/25/2019 Intro to R Presentation
15/50
/1eration Sy&$ols
Symbol Meaning
+ Addition
- Subtraction
* Multiplication
/ Division
%%Modulo (estimates
remainder in a division)
^ Exponential
-
7/25/2019 Intro to R Presentation
16/50
+u&$ers in R: +*+ and +*
7 +*+ ?not a nu&$erG
7 +* ?&issin' valueG
>Basic handlin' o% &issin' values@ H
C 0 2 3 4 5 6 +*
@ &ean?HG
C +*
@ &ean?H,na.r&TR;EG
C 2.3
-
7/25/2019 Intro to R Presentation
17/50
/$ects in R
7 /$ects in R o$tain values $y
assi'n&ent.
7 This is achieved $y the gets arrow,J9,and not the equal sign, .
7 /$ects can $e o% di%%erent !inds.
-
7/25/2019 Intro to R Presentation
18/50
Built in (unctions
7 R has &any $uilt in %unctions that
co&1ute di%%erent statistical 1rocedures.
7 (unctions in R are %ollo)ed $y ? G.
7 Inside the 1arenthesis )e )rite the
o$ect ?vector, &atriH, array, data%ra&eG
to )hich )e )ant to a11ly the %unction.
-
7/25/2019 Intro to R Presentation
19/50
Vectors
7 Vectors are varia$les )ith one or &ore
values o% the sa&e ty1e.
7 * varia$le )ith a sin'le value is !no)n as
scalar. In R a scalar is a vector o% len'th .
7 There are at least three )ays to create
vectors in R: ?aG seKuence, ?$G
concatenation %unction, and ?cG scan%unction.
-
7/25/2019 Intro to R Presentation
20/50
*rrays
7 *rrays are nu&eric o$ects )ith
di&ension attri$utes.
7 The di%%erence $et)een a &atriH andan array is that arrays have &ore than
t)o di&ensions.
-
7/25/2019 Intro to R Presentation
21/50
Matrices
7 * &atriH is a t)o di&ensional array.
7 The co&&and colna&es
-
7/25/2019 Intro to R Presentation
22/50
Strin' #haracters
7 In R, strin' varia$les are de%ined $y
dou$le Kuotation &ar!s.
@ letters
C a $ c
-
7/25/2019 Intro to R Presentation
23/50
Su$scri1ts and Indices
7 Select only one or so&e o% the ele&ents
in a vector, a &atriH or an array.
7 e can do this $y usin' su$scri1ts insKuare $rac!ets C.
7 In &atrices or data%ra&es the %irst
su$scri1t re%ers to the ro) and thesecond to the colu&n.
-
7/25/2019 Intro to R Presentation
24/50
Data%ra&e
7 Researchers )or! &ostly )ith
data%ra&es .
7 ith 1revious !no)led'e you can $uiltdata%ra&es in R
7 *lso, i&1ort data%ra&es into R.
-
7/25/2019 Intro to R Presentation
25/50
R #o&&ander
7 Loadin' R #o&&ander> Pac!a'es 9@ Install Pac!a'es 9@ #ran Mirror Selection 9@ Rc&dr
-
7/25/2019 Intro to R Presentation
26/50
/1enin' R #o&&ander
/1en R 9@ Pac!a'es9@ Load Pac!a'es 9@
Rc&dr
-
7/25/2019 Intro to R Presentation
27/50
Loadin' Data )ith R #o&&ander
7Data 9@ Load data
-
7/25/2019 Intro to R Presentation
28/50
*ctive Data )ith R #o&&ander
Data 9@*ctive dataset 9@ Select active
data set
-
7/25/2019 Intro to R Presentation
29/50
(ile8Edit /1tions
-
7/25/2019 Intro to R Presentation
30/50
Su&&aries
Statistics 9@ Su&&aries
-
7/25/2019 Intro to R Presentation
31/50
Descri1tive Statistics
-
7/25/2019 Intro to R Presentation
32/50
Mean, Standard Deviation,
S!e)ness, Nurtosis
-
7/25/2019 Intro to R Presentation
33/50
-
7/25/2019 Intro to R Presentation
34/50
#ontin'ency Ta$les
-
7/25/2019 Intro to R Presentation
35/50
-
7/25/2019 Intro to R Presentation
36/50
-
7/25/2019 Intro to R Presentation
37/50
#orrelations in R #o&&ander
-
7/25/2019 Intro to R Presentation
38/50
#orrelations in R #o&&ander
-
7/25/2019 Intro to R Presentation
39/50
Inde1endent T9Test
Statistics 9@ Inde1endent T Test
-
7/25/2019 Intro to R Presentation
40/50
-
7/25/2019 Intro to R Presentation
41/50
-
7/25/2019 Intro to R Presentation
42/50
/ne ay *+/V*
Statistics 9@ /ne ay *+/V*
-
7/25/2019 Intro to R Presentation
43/50
-
7/25/2019 Intro to R Presentation
44/50
(actor *nalysis
-
7/25/2019 Intro to R Presentation
45/50
-
7/25/2019 Intro to R Presentation
46/50
-
7/25/2019 Intro to R Presentation
47/50
"ra1hs in R #o&&ander
BoH Plot"ra1hs 9@ BoH Plots
-
7/25/2019 Intro to R Presentation
48/50
"ra1hs in R #o&&ander
Scatter Plot"ra1hs 9@ Scatter Plot
-
7/25/2019 Intro to R Presentation
49/50
-
7/25/2019 Intro to R Presentation
50/50
Questions
Than! you %or your ti&e
Leslie Rosales de Veliz lr04--5ohio.edu
Shannon David sd342-Fohio.edu
Danielle Mc Elhiney d&0340-ohio.eduE&ily Price e103-6ohio.edu
"ordon Broo!s $roo!s'ohio.edu
mailto:[email protected]:[email protected]:[email protected]:[email protected]:[email protected]:[email protected]:[email protected]:[email protected]:[email protected]:[email protected]