Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DataTable <- read.table("315 DATA.txt", header = TRUE)
- #This is importing our data from the text file into a table in R
- x <- DataTable[complete.cases(DataTable), ]
- #This is using list-wise reduction to remove all rows with NA values
- str(x)
- #This is turning our reduced table into its own structure
- summary(result<-lm(x~y,data=DataTable))
- #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
- #This gives us some information
- with(DataTable, plot(x, y))
- abline(result)
- plot(DataTable)
- plot(result)
- #This gives us plots of the information
Add Comment
Please, Sign In to add comment