VBA Code for Logistic Regression


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 11 of 11

Thread: VBA Code for Logistic Regression

  1. #1
    Join Date
    Sep 2008
    Posts
    2

    VBA Code for Logistic Regression

    I'm searching for VBA code that can read data from Excel worksheet, calculate the logistic regression equation using an IRLS algorithm, and output the equation (intercept and coefficient(s)) to the worksheet.

    The 'FreeVBcode' page on DevX has a posting called 'Logistic Regression Demo in Excel' that accomplishes what I need, but by its own admission uses inefficient coding that takes too long to execute for larger problems. I'd very much appreciate the efficient version of this code.

  2. #2
    Join Date
    Dec 2003
    Location
    San Diego
    Posts
    202
    I found quite a few resources for "Excel logistic regression" on Google. Here's one to start,

    http://homepage.mac.com/samchops/B73...330/index.html

    Good luck,
    Michael Sanchez
    Managing Technical Editor
    Forum Moderator
    FreeVBCode.com

  3. #3
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Welcome to DevX


    I've always liked The Solver

  4. #4
    Join Date
    Sep 2008
    Posts
    2

    Thank you.

    Thank you very much. This should get me going in the right direction.

  5. #5
    Join Date
    Jun 2009
    Posts
    2
    I just came across the thread. Do you still need the code? I believe I have it but it might take some time to locate.

  6. #6
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    When in doubt, post what you have.

    It might not necessarily pique the interest of the OP (Original Poster), but someone could be searching for this and it could help them.

  7. #7
    Join Date
    Jun 2009
    Posts
    2
    Here is the more efficient version of the logistic regression code implemented in a class module. I cut the code from a routine that provides a good deal more output, so testing is in order. Nonetheless, the implementation contains the math you need.

    Keep in mind that mean centering the data will improve performance but at the cost of a good deal more complexity.

    Let me know if there are any questions.
    Attached Files Attached Files

  8. #8
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Thank you.

  9. #9
    Join Date
    Sep 2014
    Posts
    1
    Dear Mr. Mnemuth, your solution is great and thank you for sharing it.
    Do you maybe have vba to performa logistic or cox regression in such simple way?

  10. #10
    Join Date
    Jun 2016
    Posts
    1
    Hello Mnemuth,

    I study Business Informatics at the apllied since university in munich. I work for my masterdegree. Can I use your classmodul for my masterthesis? Itīs about an statistic Excel-Addin for the students.

    kind regards,
    Yaric

  11. #11
    Join Date
    Jun 2016
    Posts
    1
    Awesome!

Similar Threads

  1. Jupitermedia Legal Notice -- NO PERMISSION TO USE CODE SAMPLES?!
    By Noryk Rekrap in forum Talk to the Editors
    Replies: 3
    Last Post: 08-23-2007, 03:56 PM
  2. Replies: 1
    Last Post: 02-08-2007, 07:15 PM
  3. Control Arrays in VB.NET
    By Gary Nelson in forum .NET
    Replies: 277
    Last Post: 10-01-2003, 12:00 AM
  4. Replies: 0
    Last Post: 04-11-2002, 06:48 PM
  5. Good Editorial by Russell Jones
    By Robert G in forum .NET
    Replies: 84
    Last Post: 02-08-2001, 02:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center