Hello, all!
I have an unbalanced panel dataset from Internet Movie Database. I am trying to compute the mean gross of a filmmaker's movies over the three years prior to the release of a particular film. Here is a sample of the dataset:
title talent fdate loggedadjgross
A Fine Mess (1986) Adams, Tony (I) 08aug1986 15.32454586029
That's Life! (1986) Adams, Tony (I) 10sep1986 14.93389987946
Blind Date (1987) Adams, Tony (I) 24mar1987 17.1725769043
Sunset (1988) Adams, Tony (I) 29apr1988 14.98368549347
Skin Deep (1989) Adams, Tony (I) 03mar1989 16.37933731079
Switch (1991) Adams, Tony (I) 10may1991 16.04848480225
Son of the Pink Panther (1993) Adams, Tony (I) 27aug1993 14.15256595612
Shrek (2001) Adamson, Andrew 22apr2001 18.6501750946
Shrek 2 (2004) Adamson, Andrew 15may2004 19.07325172424
The Chronicles of Narnia: The Lion the Witch and the Wardrobe (2005) Adamson, Andrew 07dec2005 18.62376976013
Shrek the Third (2007) Adamson, Andrew 06may2007 18.66974639893
Ballast (2008) Adamson, Andrew 19jan2008 10.32473182678
The Chronicles of Narnia: Prince Caspian (2008) Adamson, Andrew 09may2008 17.80108451843
Shrek Forever After (2010) Adamson, Andrew 21apr2010 18.32175827026
The Chronicles of Narnia: The Voyage of the Dawn Treader (2010) Adamson, Andrew 02dec2010 17.49599838257
Puss in Boots (2011) Adamson, Andrew 23oct2011 17.82677841187
Cirque du Soleil: Worlds Away (2012) Adamson, Andrew 20oct2012 15.31925678253
So, for example, for the observation for Adamson's Balast, I want to calculate the mean of his returns for Shrek the Third and Chronicles of Narnia, but not the projects before those or after Balast. I would like to define the three-year window based upon the actual three-years prior to the release of the film (in the example, January 18, 2005 to January 18, 2008).
As a newcomer to working with Stata, the steps surrounding might be quite elementary. So, I apologize for the potential low degree of difficulty. Thanks in advance!
Addendum: For people with shorter than three year careers, the resulting figure would cover all of their prior output. The prior three years is the limit for this window.
I have an unbalanced panel dataset from Internet Movie Database. I am trying to compute the mean gross of a filmmaker's movies over the three years prior to the release of a particular film. Here is a sample of the dataset:
title talent fdate loggedadjgross
A Fine Mess (1986) Adams, Tony (I) 08aug1986 15.32454586029
That's Life! (1986) Adams, Tony (I) 10sep1986 14.93389987946
Blind Date (1987) Adams, Tony (I) 24mar1987 17.1725769043
Sunset (1988) Adams, Tony (I) 29apr1988 14.98368549347
Skin Deep (1989) Adams, Tony (I) 03mar1989 16.37933731079
Switch (1991) Adams, Tony (I) 10may1991 16.04848480225
Son of the Pink Panther (1993) Adams, Tony (I) 27aug1993 14.15256595612
Shrek (2001) Adamson, Andrew 22apr2001 18.6501750946
Shrek 2 (2004) Adamson, Andrew 15may2004 19.07325172424
The Chronicles of Narnia: The Lion the Witch and the Wardrobe (2005) Adamson, Andrew 07dec2005 18.62376976013
Shrek the Third (2007) Adamson, Andrew 06may2007 18.66974639893
Ballast (2008) Adamson, Andrew 19jan2008 10.32473182678
The Chronicles of Narnia: Prince Caspian (2008) Adamson, Andrew 09may2008 17.80108451843
Shrek Forever After (2010) Adamson, Andrew 21apr2010 18.32175827026
The Chronicles of Narnia: The Voyage of the Dawn Treader (2010) Adamson, Andrew 02dec2010 17.49599838257
Puss in Boots (2011) Adamson, Andrew 23oct2011 17.82677841187
Cirque du Soleil: Worlds Away (2012) Adamson, Andrew 20oct2012 15.31925678253
So, for example, for the observation for Adamson's Balast, I want to calculate the mean of his returns for Shrek the Third and Chronicles of Narnia, but not the projects before those or after Balast. I would like to define the three-year window based upon the actual three-years prior to the release of the film (in the example, January 18, 2005 to January 18, 2008).
As a newcomer to working with Stata, the steps surrounding might be quite elementary. So, I apologize for the potential low degree of difficulty. Thanks in advance!
Addendum: For people with shorter than three year careers, the resulting figure would cover all of their prior output. The prior three years is the limit for this window.
Comment