Guest User

Untitled

a guest
Nov 21st, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. DataTable <- read.table("315 DATA.txt", header = TRUE)
  2. #This is importing our data from the text file into a table in R
  3.  
  4. x <- DataTable[complete.cases(DataTable), ]
  5. #This is using list-wise reduction to remove all rows with NA values
  6.  
  7. str(x)
  8. #This is turning our reduced table into its own structure
  9.  
  10.  
  11. summary(result<-lm(x~y,data=DataTable))
  12. #We apply the lm function to a formula that describes the variable y by the variable x, and save the linear regression model in a new variable LR.lm
  13. #This gives us some information
  14.  
  15. with(DataTable, plot(x, y))
  16. abline(result)
  17.  
  18.  
  19. plot(DataTable)
  20.  
  21. plot(result)
  22. #This gives us plots of the information
Add Comment
Please, Sign In to add comment