+ Reply to Thread
Results 1 to 10 of 10

Estimated regression equation?????

  1. #1
    Registered User
    Join Date
    03-15-2012
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    25

    Estimated regression equation?????

    Hi,

    I just need to know how to begin this excel process;


    Develop an estimated regression equation that can be used to predict the fuel efficiency for highway driving given the engine’s displacement, fuel type, and car size. {Hint: Use the COMPACT class as a reference category. Use the REGULAR fuel type as a reference category. Use the =IF function in Excel to create dummy variables: =IF(logical_test, [value_if_true], [value_if_false]). The IF function returns one value if a condition you specify evaluates to TRUE, and another value if that condition evaluates to FALSE. For example, the formula =IF(B2=“midsize”,1,0) returns 1 if B2 is “midsize”, and 0 if B2 is not “midsize”.}
    Attached Files Attached Files

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

    Re: Estimated regression equation?????

    I might start with the hint that they give you. I don't know if I would use the =IF() function like they suggest, but the first step is to convert the "text" categories into something numerical. The basic idea behind the hint is to assign numbers to the categories so they make sense in an equation.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    03-15-2012
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Estimated regression equation?????

    Quote Originally Posted by MrShorty View Post
    I might start with the hint that they give you. I don't know if I would use the =IF() function like they suggest, but the first step is to convert the "text" categories into something numerical. The basic idea behind the hint is to assign numbers to the categories so they make sense in an equation.

    Hi,
    Thanks for your reply....
    I was also thrown off by the "IF" function, but is there a way to incorporate it?

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

    Re: Estimated regression equation?????

    I was also thrown off by the "IF" function, but is there a way to incorporate it?
    In what way were you "thrown off" by the IF function? I'm sure there are many different ways to use the IF function in a problem like this. The hint gives a decent explanation of basically how the IF function works. What specifically about using the IF function in this context are you having trouble with?

  5. #5
    Registered User
    Join Date
    03-15-2012
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Estimated regression equation?????

    Hi,
    How about this, begin with the IF function:
    =IF(B2="Midsize",1,0)
    =IF(B2="Compact",2,1))
    =IF(B2="Large",3,2)

    But how do I get it to go in the alloted sections? drag from B2:B112 for Compact in cell F2
    and then apply IF function?

    Quote Originally Posted by MrShorty View Post
    In what way were you "thrown off" by the IF function? I'm sure there are many different ways to use the IF function in a problem like this. The hint gives a decent explanation of basically how the IF function works. What specifically about using the IF function in this context are you having trouble with?

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

    Re: Estimated regression equation?????

    But how do I get it to go in the alloted sections? drag from B2:B112 for Compact in cell F2
    If I understand correctly, then, yes. The idea is to create the formula in F2, then copy/paste or drag/fill down column F.

    The proposed IF() functions you have are good when you have only two choices ("midsize" or "not midsize"). In this case, you have three possible choices (compact, midsize, large) [which is one reason I would use a lookup function rather than an IF() function]. In order to use the IF() function on this part of the problem, you are going to have to nest IFs within IFs =IF(B2="text1",value_if_true,IF(B2="text2",value_if_true,IF(B2="text3" and so on)

    One other observation, It looks like you may be trying to assign "compact" a value between "midsize" and "large," when, in reality, "midsize" cars are between compact and large in size. As you are deciding what values to assign to each class, be sure the values you choose will have some basis in reality so that, if there is a relationship between class and gas mileage, you can see it.

  7. #7
    Registered User
    Join Date
    03-15-2012
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Estimated regression equation?????

    Hi,
    Thanks!

    @MrShorty,


    Develop an estimated regression equation that can be used to predict the fuel efficiency for highway driving given the engine’s displacement, fuel type, and car size. {Hint: Use the COMPACT class as a reference category. Use the REGULAR fuel type as a reference category.

    Done. Now for the second part I'm a little confused am I using , " {Hint: Use the COMPACT class as a reference category. Use the REGULAR fuel type as a reference category", I say this because if I have assigned a value to the "class" of vehicle, am I only using compact and regular fuel type, how does this connect with the Input Y range and Input X range?

    I did switch around the values entered for class and there may be a connection because part of "midsized" ended up being value 2, and part were value 1.

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

    Re: Estimated regression equation?????

    Help file for the LINEST() function http://office.microsoft.com/en-us/ma...823.aspx?CTT=1 in case it might help understand what they are asking us to do.

    I say this because if I have assigned a value to the "class" of vehicle, am I only using compact and regular fuel type, how does this connect with the Input Y range and Input X range?
    I'm not certain I understand this question. The problem is asking us to use 3 different independent variables to come up with a regression/estimating equation for fuel economy. So, our known_x argument is going to need to be a 3 column matrix, with one column for each of our independent variables. Known_y's will be a single column vector with the known fuel economy numbers in it.

  9. #9
    Registered User
    Join Date
    03-15-2012
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Estimated regression equation?????

    @MrShorty,

    So, Input Y = D2:D312, Input X= C2:C312, E2:E312,F2:F312?

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

    Re: Estimated regression equation?????

    That's essentially correct. I don't think LINEST() will accept a non-contiguous, "two part" range for the known_x argument, so you may need to either rearrange the data so that known_x can be C2:C312,D2:D312,E2:E312 (entered as C2:E312 for known_x in the LINEST function) or you will need to add a column with =C2 (copied down) in G2:G312 so you can use E2:G312 as the known_x argument.

+ 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