+ Reply to Thread
Results 1 to 12 of 12

Regression - Having trouble offsetting input/output references

  1. #1
    Registered User
    Join Date
    06-05-2009
    Location
    U.S.
    MS-Off Ver
    Excel 2003
    Posts
    21

    Regression - Having trouble offsetting input/output references

    Surprisingly, that is the actual output of the error message when I run my macro.
    To repeat it, it says, "Regression - Having trouble offsetting input/output references"

    The two button choices that appear on the bottom are "OK" or "Help." The OK button allows the macro to keep running (until it finds that it cannot find the regression output that was supposed to be created) while the Help button brings up a help window but obviously cannot find any way to be helpful.

    The error takes place during the regression code:

    Please Login or Register  to view this content.
    This ONLY takes place when this code is part of a nested loop. It works perfectly fine on its own. I know this is a very complicated and in-depth question but I would appreciate any help.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Regression - Having trouble offsetting input/output references

    Maybe it's just because of the lousy documentation, but I almost never use ATPVBAEN. Could you not insert a LINEST array formula instead to achieve the same end?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    06-05-2009
    Location
    U.S.
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Regression - Having trouble offsetting input/output references

    I have heard that elsewhere, but I wasn't sure how to use LINEST. What does the output look like? Because I need the regression coefficients for each of the input variables.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Regression - Having trouble offsetting input/output references

    Help for LINEST shows the values it returns.

    Post a workbook and tell me what you want to regress if you need an example.

  5. #5
    Registered User
    Join Date
    06-05-2009
    Location
    U.S.
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Regression - Having trouble offsetting input/output references

    I only have access to a computer running Ubuntu right now, so I cannot fulfill that request until later tonight or tomorrow.

    What I really need to know is:
    1. How to regress one stream of data points against 4 streams of data points
    2. How do I access the output (i.e. does it create a new worksheet and I write code to copy/paste it or is it stored in memory while the code is running and I can access it via a reference to it)?
    3. Is this any more or less exact than running a regression? Or is the regression function actually using this formula to output?

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Regression - Having trouble offsetting input/output references

    LINEST performs a regression, and it returns the coefficients and other parameters of the fit to the cells in which it appears; Help is pretty clear.

    As I said, you post some data, I'll show you an example.

  7. #7
    Registered User
    Join Date
    06-05-2009
    Location
    U.S.
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Regression - Having trouble offsetting input/output references

    Attached is a sample worksheet similar to the one I'm using with the rest of my code. Previously, when using Regression, I had output into a sheet named "fund" and then i would delete it at the end of each loop. Not sure if this is similar but just thought I'd let you know.

    Also, the Transpose sheet is where I use code to transpose each fund listed in FundReturn one by one. Essentially, the transpose data is the Y-set, and all 4 Indices listed in Index are the X-set.
    Attached Files Attached Files

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Regression - Having trouble offsetting input/output references

    What are we regressing against what?

  9. #9
    Registered User
    Join Date
    06-05-2009
    Location
    U.S.
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Regression - Having trouble offsetting input/output references

    Data in Sheet("Transpose") against data in Sheet("Index")


    Fund 1 against (Index 1, Index 2, Index 3, Index 4)

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Regression - Having trouble offsetting input/output references

    See attached.

    Looks to me like there's essentially no correlation (r2 = 0.12).
    Attached Files Attached Files

  11. #11
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Regression - Having trouble offsetting input/output references

    For information this is the argument list for Regress.

    'Sub Regress(inpyrng, [inpxrng], [constant], [labels], [confid], [soutrng], [residuals], [sresiduals], [rplots], [lplots], [routrng], [nplots], [poutrng])


    Whilst not exactly a huge amount of documentation it does explain the arguments.

    Note I could not raise the error as you described using your data and code example.
    Cheers
    Andy
    www.andypope.info

  12. #12
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Regression - Having trouble offsetting input/output references

    If you include a reference to ATPVBAEN.XLA in the VBE then you can use Object Browser (F2) to see methods and their arguments.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1