Вы находитесь на странице: 1из 25

Using R & R Commander

tips & tricks

1
How to start Using R & R Commander

1 2 3 4 5
• Go to PC LAB Search data Import data Run standard menus Experiments
• Turn On PC • CD from Statistics • Local file or URL • Graphs
• Login with user id textbooks  Excel , Text file, etc • Statistics
and password student • Googling from Internet • Clipboard Type command lines
• Run the shortcut Know before import Prepare Data • Subset data.frame
• Or copy D:\R-3.5.2 • Study the description
folder to your • Show summary • Sum, mean, sd etc
flashdisk (600MB) • Variable names • Compute new
• Missing data indicator variable
• Field separator • Edit from char to
factor
• Decimal point char

2
https://youtu.be/Oc_KiHE3U8w
Import Data from Excel
View Data set
Summary Data set
Numerical Summary
Pie Chart
VARIABLE DESCRIPTIONS (AAUP2.DAT)
Import Data from internet
Fixed column format with two data lines per school

Line #1
• First you need to find
1 - the url(Federal
5 FICE of the ID data. Open browser, find
number)
dataset using google7 - 37 College name
38 - 39 State (postal code)
• For example type keyword: journal
40 - 43 Type (I, IIA, of statistics education
or IIB)
http://ww2.amstat.org/publications/jse/jse_data_archive.htm
44 - 48 Average salary - full professors
49 - 52 Average salary - associate professors
• Scroll down until you read:
53 - 56 Average salary - assistant professors
57 - 60 Average salary - all ranks
61 - 65 Average compensation - full professors
66 - 69 Average compensation - associate professors
70 - 73 Average compensation - assistant professors
74 - 78 Average compensation - all ranks

Line #2
1 - 4 Number of full professors
5 - 8 Number of associate professors
9 - 12 Number of assistant professors
13 - 16 Number of instructors
17 - 21 Number of faculty - all ranks

ALL SALARY AND COMPENSATION FIGURES ARE YEARLY IN $100'S.


Import Data from internet

Copy the URL


(address)
Import Data from internet
http://ww2.amstat.org/publications/jse/datasets/aaup.dat.txt

Paste the URL


(address)
Edit Data set
Click Edit Data Set
Looking summary active data set we found V4 has type=“VIIB”. We need to
delete the records.
> summary(Dataset)
V1 V2 V3 V4
Min. : 1002 Bethel College : 4 PA : 54 I :139
1st Qu.: 1963 Columbia College : 3 OH : 53 IIA :287
Median : 2644 Concordia College: 3 IL : 50 IIB :528
Mean : 3074 Union College : 3 NY : 46 VIIB: 0
3rd Qu.: 3434 Augustana College: 2 TX : 43
Max. :29269 Bethany College : 2 MA : 42
(Other) :937 (Other):666
type = I

120
frequency

80
40
0
400 600 800 1000

salary.full.professor

type = IIA

120
frequency

80
40
0

400 600 800 1000

salary.full.professor

type = IIB
120
frequency

80
40
0

400 600 800 1000

salary.full.professor
Import Data from Text file 2 (csv)

15
ifelse(math.score>40,"Pass","Fail")
gender
female male

400
300
Frequency

200
100
0 Fail Pass

math.pass.status
gender
female male

400
300
Frequency

200
100
0
Fail Pass

math.pass.status math.pass.status
math.pass.status
Fail Pass
Fail Pass
80

400
60

300
Percent

Frequency
40

200
20

100
0

female male
female male
gender
gender
100
80
60
math.score

40

556
328 529
843 146
20

18 788

981

60
0

some high school high school some college associate's degree bachelor's degree master's degree

parental.level.of.education
It’s your turn!
THANK YOU

Вам также может понравиться