Y
Ying-Foon Chow
I wish I could attach the Excel file illustraing my question below:
For each date, I have 10 observations of the dependent variable (Y1 to
Y10) to be regressed on two explanatory variables (X1 to X10 and Z1 to
Z10). The data are entered as follows:
Column A is the date (say, 250 days).
Columns B to K contain the Y1 to Y10 for each date.
Columns M to V contain the Z1 to Z10 for each date.
Columns X to AG contain one row of X1 to X10.
I know how to get the intercept and slope (using INTERCEPT and SLOPE,
or LINEST) if I just regress Y on X or Y on Z only. But I need the
intercept and slope coefficients of regressing Y on X and Z for each
date.
The problem is that the observations X1 to X10 are the same for each
date, while Z1 to Z10 are changing over the dates (just like Y1 to
Y10). So I am not sure if I need to write a macro for this, or there
is a way of "combining" X1 to X10 with Z1 to Z10 for each date, and
then I can just use LINEST to regress Y1 to Y10 on X1 to X10 with Z1
to Z10 for each date.
Hope I have described the question clearly. Thanks in advance for any
help.
Best regards,
Y. F.
For each date, I have 10 observations of the dependent variable (Y1 to
Y10) to be regressed on two explanatory variables (X1 to X10 and Z1 to
Z10). The data are entered as follows:
Column A is the date (say, 250 days).
Columns B to K contain the Y1 to Y10 for each date.
Columns M to V contain the Z1 to Z10 for each date.
Columns X to AG contain one row of X1 to X10.
I know how to get the intercept and slope (using INTERCEPT and SLOPE,
or LINEST) if I just regress Y on X or Y on Z only. But I need the
intercept and slope coefficients of regressing Y on X and Z for each
date.
The problem is that the observations X1 to X10 are the same for each
date, while Z1 to Z10 are changing over the dates (just like Y1 to
Y10). So I am not sure if I need to write a macro for this, or there
is a way of "combining" X1 to X10 with Z1 to Z10 for each date, and
then I can just use LINEST to regress Y1 to Y10 on X1 to X10 with Z1
to Z10 for each date.
Hope I have described the question clearly. Thanks in advance for any
help.
Best regards,
Y. F.