############################################### ## Author: Joshua M. Tebbs ## Date: 11 December 2011 ## Update: 29 December 2017 ## STAT 509 course notes: R Code ## Chapter 1 ############################################### # Example 1.1 # Page 3 # MATH 141 example # Simulate data x1 = runif(50,400,800) # SAT MATH x2 = rnorm(50,3,0.3) # HS GPA y = rnorm(50,75,10) # MATH 141 score # The data in Example 1.1 are not real (I simulated them). # You will get a different picture (than in the notes) if you run the code below. # Produce 3d scatterplot (point cloud) # Need to install (then load) scatterplot3d package in R # Packages --> install; Packages --> load scatterplot3d(x1,x2,y, highlight.3d=FALSE,axis=TRUE,col.grid="lightblue",xlab="SAT MATH",ylab="HS GPA", zlab="MATH 141 SCORE",main="",box=FALSE,pch=20)