|
1 | 1 | # Function related to terms
|
2 |
| -""" |
3 |
| - has_intercept(<terms>) |
4 |
| -
|
5 |
| -Return `true` if `InterceptTerm{true}` is in the terms. |
6 |
| -""" |
7 |
| -has_intercept(f::FormulaTerm) = has_intercept(f.rhs) |
8 |
| -has_intercept(f::MatrixTerm) = has_intercept(f.terms) |
9 |
| -has_intercept(f::TupleTerm) = has_intercept(first(f)) |
10 |
| -has_intercept(::InterceptTerm{H}) where H = H |
11 |
| -has_intercept(::AbstractTerm) = false |
| 2 | +@deprecate has_intercept hasintercept |
12 | 3 |
|
13 | 4 | """
|
14 | 5 | any_not_aliased_with_1(<terms>)
|
@@ -201,31 +192,31 @@ Set{Int64} with 3 elements:
|
201 | 192 | select_super_interaction(f::MatrixTerm, id::Int) = select_super_interaction(f.terms, id)
|
202 | 193 | function select_super_interaction(f::TupleTerm, id::Int)
|
203 | 194 | s = id ≡ 1 ? Set(eachindex(f)) : Set([idn for idn in eachindex(f) if isinteract(f, id, idn)])
|
204 |
| - has_intercept(f) || filter!(!=(1), s) |
| 195 | + hasintercept(f) || filter!(!=(1), s) |
205 | 196 | s
|
206 | 197 | end
|
207 | 198 |
|
208 | 199 | @doc doc_select_interaction
|
209 | 200 | select_sub_interaction(f::MatrixTerm, id::Int) = select_sub_interaction(f.terms, id)
|
210 | 201 | function select_sub_interaction(f::TupleTerm, id::Int)
|
211 | 202 | s = id ≡ 1 ? Set(Int[]) : Set([idn for idn in eachindex(f) if isinteract(f, idn, id)])
|
212 |
| - has_intercept(f) || filter!(!=(1), s) |
| 203 | + hasintercept(f) || filter!(!=(1), s) |
213 | 204 | s
|
214 | 205 | end
|
215 | 206 |
|
216 | 207 | @doc doc_select_interaction
|
217 | 208 | select_not_super_interaction(f::MatrixTerm, id::Int) = select_not_super_interaction(f.terms, id)
|
218 | 209 | function select_not_super_interaction(f::TupleTerm, id::Int)
|
219 | 210 | s = id ≡ 1 ? Set(Int[]) : Set([idn for idn in eachindex(f) if !isinteract(f, id, idn)])
|
220 |
| - has_intercept(f) || filter!(!=(1), s) |
| 211 | + hasintercept(f) || filter!(!=(1), s) |
221 | 212 | s
|
222 | 213 | end
|
223 | 214 |
|
224 | 215 | @doc doc_select_interaction
|
225 | 216 | select_not_sub_interaction(f::MatrixTerm, id::Int) = select_not_sub_interaction(f.terms, id)
|
226 | 217 | function select_not_sub_interaction(f::TupleTerm, id::Int)
|
227 | 218 | s = id ≡ 1 ? Set(eachindex(f)) : Set([idn for idn in eachindex(f) if !isinteract(f, idn, id)])
|
228 |
| - has_intercept(f) || filter!(!=(1), s) |
| 219 | + hasintercept(f) || filter!(!=(1), s) |
229 | 220 | s
|
230 | 221 | end
|
231 | 222 |
|
|
0 commit comments