View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bernard Liengme Bernard Liengme is offline
external usenet poster
 
Posts: 4,393
Default Regressions with data in (changing) rows

If your Zi and Xi columns were side-by-side there would be no problem - see
the example in Help dealing with Floor space etc.

Why not reconstruct the data on a second sheet with formulas like =Sheet1!A1
to make the z and x pairs side by side?

Or have I misread the question?
best wishes
--
Bernard Liengme
www.stfx.ca/people/bliengme
Microsoft Excel MVP
remove CAPS in email address


"Ying-Foon Chow" wrote in message
...
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.