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]

Re: st: Calculating days between starts in MLB.

From   Nick Cox <>
To   "" <>
Subject   Re: st: Calculating days between starts in MLB.
Date   Wed, 3 Apr 2013 08:23:23 +0100

This sounds like a question from last week:

As that question showed, difference between successive dates is one
line in Stata, with no programming needed.

In Stata, a variable is an entire column of data and an observation an
entire row.


On 3 April 2013 01:43, N. S. Miceli, Ph.D. <> wrote:

> 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.
*   For searches and help try:

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