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"""Stack loss data""" 

2from statsmodels.datasets import utils as du 

3 

4__docformat__ = 'restructuredtext' 

5 

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

7TITLE = __doc__ 

8SOURCE = """ 

9Brownlee, K. A. (1965), "Statistical Theory and Methodology in 

10Science and Engineering", 2nd edition, New York:Wiley. 

11""" 

12 

13DESCRSHORT = """Stack loss plant data of Brownlee (1965)""" 

14 

15DESCRLONG = """The stack loss plant data of Brownlee (1965) contains 

1621 days of measurements from a plant's oxidation of ammonia to nitric acid. 

17The nitric oxide pollutants are captured in an absorption tower.""" 

18 

19NOTE = """:: 

20 

21 Number of Observations - 21 

22 

23 Number of Variables - 4 

24 

25 Variable name definitions:: 

26 

27 STACKLOSS - 10 times the percentage of ammonia going into the plant 

28 that escapes from the absoroption column 

29 AIRFLOW - Rate of operation of the plant 

30 WATERTEMP - Cooling water temperature in the absorption tower 

31 ACIDCONC - Acid concentration of circulating acid minus 50 times 10. 

32""" 

33 

34 

35def load(as_pandas=None): 

36 """ 

37 Load the stack loss data and returns a Dataset class instance. 

38 

39 Parameters 

40 ---------- 

41 as_pandas : bool 

42 Flag indicating whether to return pandas DataFrames and Series 

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

44 

45 Returns 

46 ------- 

47 Dataset instance: 

48 See DATASET_PROPOSAL.txt for more information. 

49 """ 

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

51 

52def load_pandas(): 

53 """ 

54 Load the stack loss data and returns a Dataset class instance. 

55 

56 Returns 

57 ------- 

58 Dataset instance: 

59 See DATASET_PROPOSAL.txt for more information. 

60 """ 

61 data = _get_data() 

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

63 

64 

65def _get_data(): 

66 return du.load_csv(__file__, 'stackloss.csv').astype(float)