+ Reply to Thread
Results 1 to 5 of 5

Generate lagged dummy variables

  1. #1
    Registered User
    Join Date
    03-05-2009
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    11

    Generate lagged dummy variables

    Please open the attached sample dataset and I will explain what I need help on.

    I need to generate a series of variables that model for events that occurred in previous days. If you look at the spreadsheet, you will see that on row 10, U01 = 1. This occurred on 1/13/2009. I need help to generate the values for 1 Day Lag U01 - 15 Day Lag U01.

    This means "1 Day Lag U01" = 1 for each row if in the row below it, U01 = 1. "2 Day Lag U01" = 1 for each row if 2 rows below it, U01 = 1. I manually entered in what this should look like in column AJ to AQ (it is only for 8 days though).

    If anyone can somehow create a formula to do this I would really appreciate it. I need to do this lag model for all the binary var between C to AI on a 15 day period for 445 companies, so an explanation of how the formula works would be great.

    If possible, can the formula end and restart for each company so row 1996 doesn't take on the value of row 1997, which is a different company. If this is too difficult, don't worry about it as I can just manually modify the last few rows of each company.

    Thanks
    Kevin
    Attached Files Attached Files
    Last edited by tianyi86; 03-30-2009 at 01:28 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Generate lagged dummy variables

    Probably easy enough using INDEX once you manage to post.

    If the workbook is too large to post, zip it.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    03-05-2009
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Generate lagged dummy variables

    Can someone please help me generate a formula for this?

    Thanks

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Generate lagged dummy variables

    Can you explain the logic again? Are columns C:AI of any relevance?

  5. #5
    Registered User
    Join Date
    03-05-2009
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Generate lagged dummy variables

    Actually, I figured it out. I could simply offset each value to be equal to the previous one and just run it down the sheet.

+ 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