1 Question 1

Scenario: I recently created this file to help with your class notes. Unfortunately, I accidentally deleted it from my computer. All I could find was an image of a screenshot that I had taken. I have uploaded this to Canvas under the Homework 1 instructions.

I heard that you were recently introduced to the concept of a R Markdown file and have solicited your help.

Please replicate the results using the code provided in the picture (on Canvas). For Exercise 3, you will need to provide a brief paragraph with your explanations.

1.1 Exercise 1

Create a random normal variable of length 1000.

  • Use the set.seed command to fix the random draw. Use a seed of 12468.
  • Set the mean = 15, sd = 3.
set.seed(12468)
x<-rnorm(n=1000, mean = 15, s = 3)

In the section that follows, we will plot and briefly describe the data. We will do so using a simple line plot and histogram. I will use the par() function with the mfrow = c(2,1) argument to present these two graphs side by side. The mfrow = c(2,1) argument will tell R that I need this produced as a single row and two(2) columns.

To make your plots larger, I have included a fig.height and fig.width argument to the code chunk. These will come in handy throughout this course.

1.2 Exercise 2

  • Produce a line plot of the data using the plot() function. Add a horizontal line indicating the “true” mean of the generated data.
  • Next, produce a histogram using the hist() function. Add a vertical line indicating the “true” mean of the generated data.
  • Add your favorite color (any color is acceptable) to the histogram and plot using the col argument and include an appropriate title.
# Create 1x2 grid of plots
par(mfrow = c(2,1))
plot(x, type = "l", main = "Random Number Plot", sub = "Mean = 15, s.d = 3, seed = 12468")
abline(h = 15, lwd = 2, col = "red")
hist(x, main = "Histogram of Test Data", col = "red", sub = "Mean = 15, s.d = 3, seed = 12468")
abline(v=15, lwd = 2, col = "blue")

1.3 Exercise 3

Briefly describe what you observe from your plots above. In particular, how does the generated data compare to a true normal distribution? Think about discussing the skewness and spread of the data above versus what you have come to know about a normal distribution.

Do not worry about correctness, my aim here is to get you writing around output. Go crazy and make some of your words bold and some italics. If you need a recap, revisit the interactive lesson earlier.

##1.3 Note: I am not sure if this is my response, but I know Ttahe data appears to be normal in the center. The left tail appears not to be symmetrical, but the three standard deviations from the mean look normal. Three standard deviations is 99.7% of the data, so one would probably call this normal. When discussing skewness, the histogram is normal, but the line plot is all over the place. There are no clear trends, patterns, or biases here. As a result I am imagining this is an example of something that can have a normal curve but cannot be forecasted or is difficult to forecast.

1.4 Exercise 4

Using the Cheatsheet, reproduce the following table. Pay close attention to the column headings. They also tell you how I expect each column should be formatted. You might need to do a quick Google search on how to type the \(\beta\) (beta) and \(\pi\) (pi) in math mode.

library(knitr)
table_data <- data.frame(Right = c("y = p[1]", "123", "y[t] = β + e[t]"), Left = c("e^{supsc('iT')} + 1 = 0", "123", "1"), Default = c("Boy", "123", "1"), Center = c("Girl", "123", "1"))
kable(table_data, col.names = c("Right", "Left", "Default", "Center"))
Right Left Default Center
y = p[1] e^{supsc(‘iT’)} + 1 = 0 Boy Girl
123 123 123 123
y[t] = β + e[t] 1 1 1

1.5 Getting to Know You!

Question 1: What would you like to get most out of this class?

I want to be able to run the forecasting for a working paper I have. It is a time-series.

Question 2: Tell me a bit about yourself. Again, it is OK to be fancy and include italics and bold fonts so that I can see that you have mastered the concepts presented in this lesson.

I am Kush Jenkins.We have discussed who I am. I am a professor of Accounting at NOVA. I am taking this class to 1. learn forecasting for a working paper I am developing and 2. I am 1 credit shy of having 18 graduate credits of economics. After passing this course I will be able to teach Economics for undergraduates.

Question 3: Insert a picture that you like. This could be of your pet, favorite food spot, last vacation, your specialty dish, anything.

My Graduation Day
My Graduation Day

Figure 1: My Graduation Day

  • Be sure to include a caption that tells me what the picture is about.

  • Also, tell me why this picture makes you happy.

I am happy because it was my graduation day. It was a long journey to this acheivement. And I was able to share it with my family.

My aim here is to see if you can challenge yourself to do something that I never taught you. The Cheatsheet or a simple Google search will come in handy here.


When you are done, go ahead and hit the Knit icon and render it as a html file.

If you have any problems rendering the file, please contact Leo or me prior to the submission deadline.