1. Using the data you gathered for the last assignment, pick an intervalmeasured variable to serve as your outcome variable (hopefully one that is also theoretically interesting to you) as well as 3-5 predictors and conduct, interpret, and present as thorough of linear regression analysis as you are capable given the contents of the reading and lecture. 2. Using matrix operations, write an R function that estimates the Least Squares co

1. Using the data you gathered for the last assignment, pick an intervalmeasured variable to serve as your outcome variable (hopefully one that is also theoretically interesting to you) as well as 3-5 predictors and conduct, interpret, and present as thorough of linear regression analysis as you are capable given the contents of the reading and lecture.

2. Using matrix operations, write an R function that estimates the Least Squares coefficients and the ^o 2 parameter given two inputs: a vector of dependent variables and a matrix of explanatory variables. Do not use any pre-programmed functions, such as “Im,” except to check your results (but do check your results against part 1 above). Comment your code so that we can easily understand what you are doing. Assume that the systematic component of the model is ? = X? where ? is a vector of pi for each observation i, ? is a vector of coefficients, and X is a matrix with a column of 1s and then columns including the explanatory variables.

3. Explain – intuitively, using no math at all – the logic behind the linear model, why it is called linear, and why least squares are a pretty reasonable way to estimate it.

4. Investigate several commonly used probability density/mass functions: the Gaussian, Bernoulli, Binomial, Poisson, and Exponential.

For each distribution, do the following: (a) Write the mathematical formulas for the PDF/PMF and CDF/CMF and comment on the support of the function (e.g. what numerical ranges are produced as an output and what numerical ranges the distribution’s parameters can have).

(b) Using the functions in R, plot the PDF and CDF (two plots) with different lines on each plot reflecting different specifications of the parameters (pick specifications you think are interesting).

(c) Describe in prose what the distribution does as the/each paramenter moves.