Suppose we want to perform a simple linear regression


Assignment -

Suppose we want to perform a simple linear regression analysis. Go to the D2L and get 'weight.txt' file. It contains two variables: age and weight. We can use the following code to do regression analysis.

Proc Reg data = d;

model weight = age;

run;

Let Y be a column vector of "weight". Let X be a matrix with the first column being a vector of one and the second column being a vector of "age". Let I be the identity matrix and J be a square matrix with its elements being 1.

Recall that

estimate of β = (X'X)-1X'Y

SST (sum of squares of total) = Y'[I-(1/n)J]Y

SSE (sum of squares due to error) = Y'[I-X(X'X)-1X']Y

SSR = SST - SSE.

Print the estimated coefficients and SST, SSE, and SSR in the output window using Proc IML. Check if your values are the same with the output of the Proc Reg.

Request for Solution File

Ask an Expert for Answer!!
Applied Statistics: Suppose we want to perform a simple linear regression
Reference No:- TGS02771502

Expected delivery within 24 Hours