* Mendota Ice Exercises
*----------------------
* Setup: read the data into Stata with these commands
infile str7 winter str6 close str6 open days using "http://www.ssc.wisc.edu/~hemken/Stataworkshops/Mendota2011.raw"
generate year=real(substr(winter, 1, 4))
* Problem 1
*----------
* What what was the longest ice fishing season on record?
* How many days long was it, and what was the year?
* What was the shortest season?
* Problem 2
*----------
* How common has it been to have 120 or more days of ice cover?
*
* (Hint: create an indicator.)
* Problem 3
*----------
* Would a person who grew up in the period 1900-1920 (like my
* grandparents) be justified in thinking that "today's kids
* have it easy"? Compare the mean duration of ice cover for
* 1900-1920 versus 1990-2010.
*
* (Hint: You could drop unneeded observations with a "drop if"
* command, or filter them with an indicator variable and
* an "if" clause.)
* Problem 4
*----------
* When should we expect the Lake to open this spring?
*
* (Hint: convert the variable "open" to a day-of-the-year
* by using the mdy() function or the date() function
* and the %td format. Just getting the components for
* mdy() or date() will be the hardest part of this
* exercise. Use a constant year. Take the mean for a
* simple prediction, and construct an optional confidence
* interval.
* If you know regression, predict a result for "2010".