doex/rcbd.py
changed.
doex/latin_square.py
changed.
Other files ignored by Codecov
doex/tests/test_latin_square.py
has changed.
doex/tests/test_rcbd.py
has changed.
1ad6b4d
... +2 ...
41a7921
9 | 9 | ||
10 | 10 | n_treatments, n_blocks = self.data.shape |
|
11 | 11 | ||
12 | + | if hasattr(self, "num_missing"): |
|
13 | + | num_missing = self.num_missing |
|
14 | + | else: |
|
15 | + | num_missing = 0 |
|
16 | + | ||
12 | 17 | N = 0 |
|
13 | 18 | for entry in self.data: |
|
14 | 19 | N += len(entry) |
32 | 37 | self.dof_treatments = n_treatments - 1 |
|
33 | 38 | self.dof_blocks = n_blocks - 1 |
|
34 | 39 | self.dof_total = N - 1 |
|
35 | - | self.dof_error = self.dof_total - (self.dof_treatments + self.dof_blocks) |
|
40 | + | self.dof_error = self.dof_total - (self.dof_treatments + self.dof_blocks + num_missing) |
|
36 | 41 | ||
37 | 42 | # Calculate Mean Sum of Squares |
|
38 | 43 | self.mss_treatments = self.ss_treatments / self.dof_treatments |
101 | 106 | ||
102 | 107 | n_treatments, n_blocks = self.data.shape |
|
103 | 108 | ||
104 | - | num_missing = np.count_nonzero(np.isnan(self.data)) |
|
109 | + | self.num_missing = np.count_nonzero(np.isnan(self.data)) |
|
105 | 110 | missing_locations = np.argwhere(np.isnan(self.data)) |
|
106 | 111 | self.handle_missing(self.data, missing_locations) |
|
107 | 112 | ||
108 | - | print("Data after adjusting for {} missing value(s)".format(num_missing)) |
|
113 | + | print("Data after adjusting for {} missing value(s)".format(self.num_missing)) |
|
109 | 114 | print(self.data) |
|
110 | 115 | ||
111 | 116 | # Continue with RCBD analysis |
65 | 65 | self.dof_columns = n_cols - 1 |
|
66 | 66 | self.dof_treatments = len(self.treatments) - 1 |
|
67 | 67 | self.dof_total = N - 1 |
|
68 | - | self.dof_error = self.dof_total - (self.dof_rows + self.dof_columns + self.dof_treatments) |
|
68 | + | self.dof_error = self.dof_total - ( |
|
69 | + | self.dof_rows + self.dof_columns + self.dof_treatments + num_missing |
|
70 | + | ) |
|
69 | 71 | ||
70 | 72 | # Calculate Mean Sum of Squares |
|
71 | 73 | self.mss_rows = self.ss_rows / self.dof_rows |
Files | Coverage |
---|---|
doex | 100.00% |
Project Totals (6 files) | 100.00% |
41a7921
1bc8fb2
15b6652
1ad6b4d