Post date: Aug 16, 2013 4:10:1 PM
Our first meeting is Monday August 24 9:10 am in 176 Shineman.
One of your very first steps for this course should be acquiring R for your computer: click on the Resources tab at left for guidance. It will often be convenient to have R running in class. It's a top-notch statistics application and also can serve as a super calculator.
Once you have R installed, open it. Below are some things you should try. Pay attention and try to figure out what is happening. The best way to learn is to DO. (Each of these lines is entered at R's > prompt. You can copy and paste an entire line too - you don't have to type. )
2 + 3
(6 + 2 + 8 + 11)/4
# This is a comment!
mean(c(6,2,8,11))
d <- c(6,2,8,11) # Assigns the vector (6,2,8,11) to d
d
D
# R is case sensitive
length(d)
d + 3
mean(d)
mean(d + 3)
# Here is how to compute standard deviation.
sd(d)
sd(d + 3) # Hmmm. You knew that was coming, right?
nd <- -d # nd is the opposite of d
nd
mean(nd)
sd(nd) # You knew that too?
2 + 3 == 5
2 + 3 == 4
mean(d) == mean(d+3)
mean(d) == mean(-d)
sd(d) == sd(d+3)
sd(d) == sd(-d)
x <- 7 # Assigns the value 7 to the single element vector x
y <- 2*x^2 - 3
x
y
w <- 2 + 7*x
w
(v <- 14 - x*y)
# This "trick" - putting () around an assignment - I only learned today.
v
8*7*6*5*4*3*2*1
factorial(8)
seq(0,10)
factorial(seq(0,10))
data.frame(seq(0,10),factorial(seq(0,10))) # A data frame is a table / a collection of equal length vectors
# Try 20 in place of 10? To retype the previous line simply hit the up arrow; then you can edit
seq(14,105,by=3)
seq(14,105,length.out=5)
z <- seq(-3.5,3.5,by=0.1)
plot(z,dnorm(z),type="l",col="red") # type="l" connects the dots
# After a plot is constructed, you often have to click back into the R console to get back to work
abline(0,0,col="grey") # See what this adds to the plot?
plot(z,dnorm(z),col="green") # The default is points - this shows what type="l" did above.
plot(z,dnorm(z),col="deepskyblue2",pch=12) # Lots of symbols (pch); lots of colors.
demo(colors) # Type <Return> / <Enter> in the R Console to sequence through plots
demo(graphics)
demo(smooth)
Make sure you've located and read through the syllabus.
Click through all of the tabs at left to see what's posted.