R Tutorial
Basic things to know
• You have to get data(there are two ways)
– data <- read.csv(file.choose())
– data <- read.table(“cl...
First, you copy them
Second, type those codes
Third, you can check the data
Basic data management
• In R you use commands to manage data
– data$V1
• This command will get you to the data and control...
Recode functions
• When dealing with data, we may need to recode
them from one value to another
– For example, you have a ...
Single tabulation
Cross tabulation(frequency)
Cross tabulation(sample mean)
Three way tabulation
Basic Plot(bar)
Compare means (T-Test)
Compare paired means (T-Test)
Correlation
Regression(simple)
Regression(multiple)
THE END
Upcoming SlideShare
Loading in …5
×

R tutorial

277 views

Published on

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
277
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
4
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

R tutorial

  1. 1. R Tutorial
  2. 2. Basic things to know • You have to get data(there are two ways) – data <- read.csv(file.choose()) – data <- read.table(“clipboard”,header=T) • Notice: this one involves the copy board to restore the data and there should be header for each variables. • You have to save data – write.table(“c:/users/admin/desktop/whatever.csv ”,sep=“,”) • Sep means the way how data are separated.
  3. 3. First, you copy them
  4. 4. Second, type those codes
  5. 5. Third, you can check the data
  6. 6. Basic data management • In R you use commands to manage data – data$V1 • This command will get you to the data and control variable V1 – data[c(1)] • This command will get you to the data and control the first variable. – data[c(1:10)] • This command will get you to the data and control the first to tenth variables.
  7. 7. Recode functions • When dealing with data, we may need to recode them from one value to another – For example, you have a variable named Gender, but the values are like “male” and “female”. If you want to do statistical analysis, you may want to recode them into 0 and 1 so that the computer can actually recognize it. • Use the following command – data$Gender[data$Gender==“male”] <- 0 – data$Gender[data$Gender==“female”] <- 1 • Whatever is inside the [] symbol is the logical conditions.
  8. 8. Single tabulation
  9. 9. Cross tabulation(frequency)
  10. 10. Cross tabulation(sample mean)
  11. 11. Three way tabulation
  12. 12. Basic Plot(bar)
  13. 13. Compare means (T-Test)
  14. 14. Compare paired means (T-Test)
  15. 15. Correlation
  16. 16. Regression(simple)
  17. 17. Regression(multiple)
  18. 18. THE END

×