LINEAR REGRESSION MODELS W4315
HOMEWORK 2 ANSWERS February 15, 2010

Instructor: Frank Wood 1. (20 points) In the ﬁle ”problem1.txt”(accessible on professor’s website), there are 500 pairs of data, where the ﬁrst column is X and the second column is Y. The regression model is Y = β0 + β1 X + a. Draw 20 pairs of data randomly from this population of size 500. Use MATLAB to run a regression model speciﬁed as above and keep record of the estimations of both β0 and β1 . Do this 200 times. Thus you will have 200 estimates of β0 and β1 . For each parameter, plot a histogram of the estimations. b. The above 500 data are actually generated by the model Y = 3 + 1.5X + , where ∼ N (0, 22 ). What is the exact distribution of the estimates of β0 and β1 ? c. Superimpose the curve of the estimates’ density functions from part b. onto the two histograms respectively. Is the histogram a close approximation of the curve? Answer: First, read the data into Matlab. pr1=textread(’problem1.txt’); V1=pr1(1:250,1); V2=pr1(1:250,2); T1=pr1(251:500,1); T2=pr1(251:500,2); X=[V1;V2]; Y=[T1;T2]; Randomly draw 20 pairs of (X,Y) from the original data set, calculate the coeﬃcients b0 and b1 and repeat the process for 200 times b0=zeros(200,1); b1=zeros(200,1); i=0 for i=1:200 indx=randsample(500,20); x=X(indx); 1

y=Y(indx); avg x = mean(x); avg y = mean(y); sxx = sum((x − avg x).2 ); sxy = sum((x − avg x). ∗ (y − avg y)); b1(i) = sxy/sxx; b0(i) = avg y − b1(i) ∗ avg x; end; Draw histograms of the coeﬃcients b0 and b1 hist(b0) hist(b1)

Figure 1: Histogram of b0

Figure 2: Histogram of b1

2

i b. As we have known, b1 = i i(Xi −X)2 = i (Xii −X)2i = i Ki Yi whereKi = Xi −X¯ 2 ¯ ¯ i i i (Xi −X) So, b1 is a linear combination of Yi . Since Yi has a normal distribution, b1 also follows a normal distribution. E(b1 ) = i Ki E(Yi ) = i Ki (β0 + β1 Xi ) = i Ki β0 + ( i Ki Xi )β1 ¯ i (Xi −X) =0 ¯ i Ki = (Xi −X)2 i i i i i i i =1 ¯ 2 = ¯ 2 i Ki X i = i (Xi −X) i (Xi −X) E(b1 ) = 0 + 1 ∗...

...Linear -------------------------------------------------
Important
EXERCISE 27 SIMPLE LINEARREGRESSION
STATISTICAL TECHNIQUE IN REVIEW
Linearregression provides a means to estimate or predict the value of a dependent variable based on the value of one or more independent variables. The regression equation is a mathematical expression of a causal proposition emerging from a theoretical framework. The...

...considers the relationship between two variables in two ways: (1) by using regression analysis and (2) by computing the correlation coefficient. By using the regressionmodel, we can evaluate the magnitude of change in one variable due to a certain change in another variable. For example, an economist can estimate the amount of change in food expenditure due to a certain change in the income of a household by using the regression...

...Linear-Regression Analysis
Introduction
Whitner Autoplex located in Raytown, Missouri, is one of the AutoUSA dealerships. Whitner Autoplex includes Pontiac, GMC, and Buick franchises as well as a BMW store. Using data found on the AutoUSA website, Team D will use LinearRegression Analysis to determine whether the purchase price of a vehicle purchased from Whitner Autoplex increases as the age of the consumer purchasing the vehicle...

.... The following sample observations were randomly selected.
X: 5 3 6 3 4 4 6 8
Y: 13 15 7 12 13 11 9 5
a. Determine the coefficient of correlation.
b. Determine the coefficient of determination.
c. Interpret the result.
. The following sample observations were randomly selected.
X: 5 3 6 3 4 4 6 8
Y: 13 15 7 12 13 11 9 5
a. Determine the coefficient of correlation.
b. Determine the coefficient of determination.
c. Interpret the result.
. The following sample observations...

...Project 1: Linear Correlation and Regression Analysis
Gross Revenue and TV advertising:
Pfizer Inc, along with other pharmaceutical companies, has begun investing more promotion dollars into television advertising. Data collected over a two year period, shows the amount of money Pfizer spent on television advertising and the revenue generated, all on a monthly bases.
|Month |TV advertising |Gross Revenue |
|1 |17...

...middle/high income percentages took a much smaller percentage rate at 12% and 35%. While the low income percentages represented only 10% of their incomes spent toward a new car purchase. The trend makes the graph ascend on both sides of the linearregression line. When the incomes of the consumer increase the sales for cars also rises presenting a positive result. Therefore, as long as the incomes continue to grow the relationship to car sales will also trend to...

...1.
Qeach brand t=β0+β1*PMinute Maid t+β2*PTropicana t+β3*PPrivate label t+ueach brand t
Q: quantity P: price
By running the above regressionmodel for each brand, we got the following elasticity matrix and the figures for “V” and “C.” Note that we used the average price and quantity for P and Q to calculate each brand’s elasticity.
Price Elasticity | Tropicana | Minute Maid | Private Label |
Tropicana | -3.4620441 | 0.40596537 | 0.392997566 |
Minute Maid...

...EXECUTIVE SUMMARY
The study is undertaken to study retailers behavior towards Aircel in selected region. The data is collected directly by visiting outlets through structured interview scheduled. The statistical tools used to analyze the data are: Co-relation analysis, Simple LinearRegression and Multiple LinearRegression. The software used to analyze the data is Windostat version 8.6, developed by...

## Share this Document

Let your classmates know about this document and more at StudyMode.com