Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1"""U.S. Strike Duration Data""" 

2from statsmodels.datasets import utils as du 

3 

4__docformat__ = 'restructuredtext' 

5 

6COPYRIGHT = """This is public domain.""" 

7TITLE = __doc__ 

8SOURCE = """ 

9This is a subset of the data used in Kennan (1985). It was originally 

10published by the Bureau of Labor Statistics. 

11 

12:: 

13 

14 Kennan, J. 1985. "The duration of contract strikes in US manufacturing. 

15 `Journal of Econometrics` 28.1, 5-28. 

16""" 

17 

18DESCRSHORT = """Contains data on the length of strikes in US manufacturing and 

19unanticipated industrial production.""" 

20 

21DESCRLONG = """Contains data on the length of strikes in US manufacturing and 

22unanticipated industrial production. The data is a subset of the data originally 

23used by Kennan. The data here is data for the months of June only to avoid 

24seasonal issues.""" 

25 

26#suggested notes 

27NOTE = """:: 

28 

29 Number of observations - 62 

30 

31 Number of variables - 2 

32 

33 Variable name definitions:: 

34 

35 duration - duration of the strike in days 

36 iprod - unanticipated industrial production 

37""" 

38 

39 

40 

41def load_pandas(): 

42 """ 

43 Load the strikes data and return a Dataset class instance. 

44 

45 Returns 

46 ------- 

47 Dataset instance: 

48 See DATASET_PROPOSAL.txt for more information. 

49 """ 

50 data = _get_data() 

51 return du.process_pandas(data, endog_idx=0) 

52 

53 

54def load(as_pandas=None): 

55 """ 

56 Load the strikes data and return a Dataset class instance. 

57 

58 Parameters 

59 ---------- 

60 as_pandas : bool 

61 Flag indicating whether to return pandas DataFrames and Series 

62 or numpy recarrays and arrays. If True, returns pandas. 

63 

64 Returns 

65 ------- 

66 Dataset instance: 

67 See DATASET_PROPOSAL.txt for more information. 

68 """ 

69 return du.as_numpy_dataset(load_pandas(), as_pandas=as_pandas) 

70 

71 

72def _get_data(): 

73 return du.load_csv(__file__,'strikes.csv').astype(float)