+ Reply to Thread
Results 1 to 7 of 7

creating explanatory variables

Hybrid View

bighush creating explanatory variables 09-30-2014, 05:43 PM
mcmahobt Re: creating explanatory... 09-30-2014, 09:46 PM
bighush Re: creating explanatory... 10-01-2014, 03:02 AM
samba_ravi Re: creating explanatory... 10-01-2014, 03:14 AM
bighush Re: creating explanatory... 10-01-2014, 03:17 PM
bighush Re: creating explanatory... 11-03-2014, 06:34 AM
mcmahobt Re: creating explanatory... 10-01-2014, 08:36 AM
  1. #1
    Registered User
    Join Date
    09-30-2014
    Location
    ulm,Germany
    MS-Off Ver
    office 365 proplus
    Posts
    8

    creating explanatory variables

    i have to create a dummy variable named LOSS

    it is defined as "LOSS is equal to 1 if net income before extraordinary items is negative for the current and previous years"

    so i have the values of the net income with years for different companies i have to just get a simple coding in a cell to help me get the dummy variables.

    will be really glad for an assistance

  2. #2
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: creating explanatory variables

    Quote Originally Posted by bighush View Post
    i have to create a dummy variable named LOSS

    it is defined as "LOSS is equal to 1 if net income before extraordinary items is negative for the current and previous years"

    so i have the values of the net income with years for different companies i have to just get a simple coding in a cell to help me get the dummy variables.

    will be really glad for an assistance
    bighush,

    I'm wondering if you could possibly rephrase your question. I'm not quite sure exactly what you're asking for in terms of a "dummy variable", but I attached an example workbook of what I interpreted. Hopefully it helps.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    09-30-2014
    Location
    ulm,Germany
    MS-Off Ver
    office 365 proplus
    Posts
    8

    Re: creating explanatory variables

    so i have attached a sample of what i was referring in my earlier description to help me create a dummy variable that takes 1 or 0 for certain
    observations
    Attached Files Attached Files

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,941

    Re: creating explanatory variables

    =IF(ROW(1:1)=1,0,IF(AND(A2=OFFSET(A2,-1,0),C2<0,OFFSET(C2,-1,0)<0),1,0))
    Try this formula in Cell E2 and copy towards down
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  5. #5
    Registered User
    Join Date
    09-30-2014
    Location
    ulm,Germany
    MS-Off Ver
    office 365 proplus
    Posts
    8

    Re: creating explanatory variables

    thank you all for the suggestions.
    they all work well.

  6. #6
    Registered User
    Join Date
    09-30-2014
    Location
    ulm,Germany
    MS-Off Ver
    office 365 proplus
    Posts
    8

    Re: creating explanatory variables

    hello nflsales, i know this is an excel forum but can you help me get a code in stata for the code you gave me.

  7. #7
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: creating explanatory variables

    bighush,

    I believe nflsales' formula would work. A more compact version would also be:

    =IF(AND(C3<0,C2<0),1,0)
    applied to cell E3, since there is no previous year to Year 1, so the formula would not apply.

+ 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] Creating a look up table for X and Y variables
    By ericfoster75 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-21-2014, 02:00 AM
  2. Explanatory Formulas
    By Steffen Thomsen in forum Excel Tips
    Replies: 4
    Last Post: 07-19-2012, 10:03 AM
  3. Creating For Loop with 3 variables
    By BeefNoodleSoup in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2012, 05:25 PM
  4. Macro Buttons explanatory text?
    By kyrgyzstanart in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-03-2010, 05:47 PM
  5. [SOLVED] Creating a formula that will SUM with 2 Variables
    By B Akers in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-28-2006, 02:10 AM

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