EconometricsLesson 2 of 2 in the course Regression Analysis in Finance

Correlation and Simple Linear Regression in R

5 flashcards · 5 quiz questions · 5 match pairs · 5 fill-in sentences · English

Lesson progress
0 / 5

Your progress is kept in this browser only.Sign up to save it

Summary

This lesson introduces R and shows how to organize paired financial data in vectors and calculate a correlation coefficient. These skills help you assess how closely the returns of two investments move together before fitting a regression model.

R is a free, open-source tool used for statistical analysis, graphing, and programming. Many statistical operations in R are performed with functions. For common analyses, the data are first stored in an appropriate structure, such as a vector.

All flashcards

What is R?
R is a free, open-source programming language and software environment for statistical analysis and graphing.
What does `c()` do in R?
It combines values into a vector, which can be stored under a name with `<-`.
What does `cor(x, y)` return?
The correlation coefficient summarizing the direction and strength of the linear association between paired values in two numeric vectors.
What does `lm(y ~ x)` fit?
A linear model with `y` as the dependent variable and `x` as the independent variable.
What does `predict(model, newdata)` do?
It estimates response values from a fitted model using predictor values supplied in `newdata`.

Quiz questions

  1. In the simple linear model y^=a+bx\hat{y} = a + bx, what does the slope bb represent?Answer: The estimated change in yy for a one-unit increase in xx.
  2. In the simple linear model y^=a+bx\hat{y} = a + bx, what does the intercept aa represent?Answer: The model's predicted value of yy when xx equals zero.
  3. In a fitted linear model, what does multiple RR-squared describe?Answer: The proportion of response variation accounted for by the fitted model in the sample.
  4. In R, which `predict()` argument requests an interval for an individual response?Answer: `interval = "predict"`
  5. For an observation used to fit a regression model, how is its residual calculated?Answer: Observed response minus the model-predicted response.

Based on Principles of Finance by Julie Dahlquist, Rainford Knight (OpenStax), licensed CC BY 4.0. Adapted into a summary, flashcards and quizzes.

All Econometrics lessons