+ Reply to Thread
Results 1 to 2 of 2

Regression with VBA

  1. #1
    Registered User
    Join Date
    11-20-2015
    Location
    elladistan
    MS-Off Ver
    office 2013 (exell, word, ppt)
    Posts
    1

    Regression with VBA

    Hello! Just registered to this forum, it seems very interesting and helpfull.

    I want to do some regressions on excel (about 900 regressions). I know nothing about vba or macros.

    I want to run a regression of Y for every Xi variable
    Y X1 X2 X3 Xn

    I found this
    Please Login or Register  to view this content.
    at ozgrid.com forum, which seems to work, as I get the same results with running the regression with the add-in tool. I read that you can repeat the macro process.

    How I must modify it to run it for all my Xi variables?

    Also, is there a way to choose if I want to receive the results on the same sheet, or every regression on new sheets, or new books?

    Thank you!

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,525

    Re: Regression with VBA

    IMO, the easiest way (especially for someone who "know[s] nothing about vba or macros"), is to use the LINEST() function instead (I am assuming you know more about using worksheet functions). Help file for the LINEST() function: https://support.office.com/en-us/art...a-fa7abf772b6d

    If I understand what you are trying to do, this should be fairly easy. You would create the LINEST() function once. If you pay attention to the relative and absolute references (assuming you are familiar with this spreadsheet concept), you should then just need to copy the function to get the rest of the regressions. If you are unfamiliar with array functions, be sure to review that section of the help file. Since your data are in columns, you may want to nest the LINEST() function within a TRANSPOSE() function to get the LINEST() output as a vertical array.
    Attached Files Attached Files
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. regression
    By jw01 in forum Excel General
    Replies: 3
    Last Post: 03-29-2011, 08:00 PM
  2. how to run regression with vba ?
    By eternity_forget in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-14-2009, 12:55 PM
  3. Regression
    By bosc in forum Excel General
    Replies: 6
    Last Post: 05-22-2009, 11:01 AM
  4. Is it regression I need?
    By jschwab in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-03-2007, 07:17 PM
  5. Regression
    By Prba in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 02-24-2006, 07:15 PM
  6. regression
    By swissforestry in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-10-2005, 07:59 PM
  7. Regression
    By Antoine in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-11-2005, 10:05 AM
  8. [SOLVED] Regression
    By Ubirajara Augusto in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-01-2005, 06:05 PM

Tags for this Thread

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