\[ y = \beta_0 + \beta_1 x_1 + \beta_2 x_2 \]
http://www.wolframalpha.com/input/?i=z+%3D+10+%2B+3x+%2B+-5y
September 6, 2016
\[ y = \beta_0 + \beta_1 x_1 + \beta_2 x_2 \]
http://www.wolframalpha.com/input/?i=z+%3D+10+%2B+3x+%2B+-5y
\[ y = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \beta_3 x_3 + ... \]
We can't visualize these, but they have similar mathematical properties to 2D and 3D lines/planes.
How do we model processes with diminishing (or increasing) marginal returns? One simple way is with a quadratic term.
\[ income = \beta_0 + \beta_1 age + \beta_2 age^2 \]
This function will allow income to increase with age and then fall as people move into retirement.
\[ income = \beta_0 + \beta_1 age + \beta_2 age^2 \]
Determining the marginal effect (i.e. what happens to your expected wage next year) isn't as straight forward as with a linear equation. Using calculus we find:
\[ income' = \beta_1 + 2\beta_2 age \]
When data is kept in csv format ("comma separated values"), import the data using read.csv()
. Normally the files are something like file.csv
. This particular file (from the textbook publisher) was named census2000.r
which is weird. The .R
file extension should be reserved for R scripts.