+ Reply to Thread
Results 1 to 2 of 2

Run regression on filtered cells only?

  1. #1
    Registered User
    Join Date
    02-08-2018
    Location
    Scotland
    MS-Off Ver
    15.28
    Posts
    3

    Run regression on filtered cells only?

    I have a large dataset with info on mutual funds (20,761 rows) and wish to run a regression on a sub-sample of it. In the screenshot below, in column P, I have input an "IF" function which displays a "1" when the fund in question is a Large Growth fund - I have 8 other columns with different fund types, each with their own "IF" function to display a "1" when the fund is that specific type. These 1's are used in my regression as dummy variables.

    My question is, how do I run a regression on the rows that display a "1" for Large Growth funds, excluding the rows that contain a "0"? I have tried filtering the data and then running the regression - however my input range is still the whole dataset rather than just the data that is visible after filtering. The large growth funds are not close to each other (e.g. one could be in row 21, one could be in row 450, one in row 1211, etc) so I cannot go through the whole data manually to click on each row for the input range.

    Is there a way I can run a regression using only the filtered results?

    Screen Shot 2018-02-16 at 23.19.05.png

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Run regression on filtered cells only?

    You don't say how you are trying to do the regression. Many of the regression tools, especially those based on the LINEST() function (including the data analysis-> regression utility) will need you to completely extract the desired data/remove the undesired data from the source range.

    1) Something like autofilter only hides data, it does not remove the data. You might try using advanced filter (http://www.excel-easy.com/examples/advanced-filter.html or http://www.contextures.com/xladvfilter01.html ) where you have the option to copy the filtered list to another range.

    2) Something formula that uses a complicated mix of INDEX() and MODE.MULT() and IF(): https://www.excelforum.com/excel-for...-function.html

    3) Another formula based that uses the OFFSET() and MATCH() and COUNTIFS() functions https://www.excelforum.com/excel-gen...data-base.html

    Or any other strategy that you like for extracting the data/removing unwanted data from the input range to the regression utility that you want to use.
    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. [SOLVED] Filtered Cells To Automatically Move Visible Cells To Top Of Table..?
    By Ourkid123uk in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-24-2017, 05:55 AM
  2. Replies: 3
    Last Post: 02-02-2017, 03:04 AM
  3. [SOLVED] Count cells containing Dates (greater than 2014) based on Filtered Cells
    By sam99 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-26-2014, 10:30 AM
  4. Replies: 4
    Last Post: 07-28-2013, 10:13 PM
  5. Count unique cells after filtered cells
    By Jaddel in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-03-2012, 12:48 PM
  6. Replies: 1
    Last Post: 08-29-2012, 04:01 AM
  7. Replies: 7
    Last Post: 08-16-2010, 05:40 AM

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