Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Calculating days between starts in MLB.

From   "N. S. Miceli, Ph.D." <>
Subject   st: Calculating days between starts in MLB.
Date   Tue, 02 Apr 2013 19:43:29 -0500

Hi all,

I'm working through Major League Baseball events data from Retrosheet. The data is formatted so that each observation contains the events that occurred on each play.

From that data, I've extracted the ID for each starting pitcher and the date the game was played. The data is formatted so that each of those variables is an observation.

I'd like to be able to calculate the days between each start for each pitcher. Do I need to reshape the data to do that, so that each start is a variable matched to the pitcher ID?

I'm pretty sure that I'm going to have to take each season's data and match merge the dates to the pitcher ID, then calculate the difference between the dates to determine days elapsed.

If anyone knows of a way to do this, keeping the dates in the original observations, that would be great. I would guess that can be done by programming in Stata, which I've never had to do, and haven't learned.

Any suggestions would be appreciated.


Nick Miceli

Nicholas S. Miceli, Ph.D.
Associate Professor of Human Resource Management
Park University
School of Business
8700 N. W. River Park Drive
Parkville, MO 64152

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index