Click on the R icon
To quit R:
> q()
What does it ask you? What does this mean?
For R HELP, for example to get help about the function rnorm ,
> help(rnorm)
You can also go to Help on the R toolbar and select R Help.
Generate a sample of n=100, N(0,1) random variables.
> help(rnorm)
> rnorm(100)
What happened?
Now, let's try:
> temp <- rnorm(100)
What is in the object temp?
What is the length of the oject temp?
Make a informative plot of temp?
Q: How can you make a time series plot of the data? (The model is: Yt = et)
Let's now use the R function set.seed() to allow us to reproduce our results! Repeat the above command: ( temp <- rnorm(100) after
> set.seed(1)
Compare what is in the object temp with a neighbor. It should be exactly the same!
Let's look at the sample code in random_walk_ex.r
Q: What happens when you change (larger and smaller) the standard deviation of the noise?
Let's see if we can install the TSA R package on our computers!
Let's see if we can use the TSA R package and produce the plots in Chapter 1 from: Text Book webpage
Here are some knitr resources
(Send me more and I will gladly add to this!)
Let's look at Example 2 Dr. Dribble:
From the STAT 672 Lab1
Here is a HW template that I have made for you (Thanks Nick!): STAT672HW0knitr.Rnw
The model: Yt = φ1Yt-1 + et
Let's look at sample code in ar1.ex1.r
Q: What are the differences that you observe in the 4 plots and how do they compare to the Random Walk?