You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# PR #109, to be removed when fixed in StatsModels
195
+
ifsize(_Xendo_, 2) >0
196
+
for c ineachcol(_Xendo_)
197
+
esample2 .&= .!ismissing.(c)
198
+
end
199
+
end
200
+
201
+
# PR #109, to be removed when fixed in StatsModels
202
+
for c ineachcol(_Z_)
203
+
esample2 .&= .!ismissing.(c)
204
+
end
205
+
206
+
# PR #109, to be removed when fixed in StatsModels
207
+
if!all(esample2)
208
+
_Xendo_ = _Xendo_[esample2,:]
209
+
_Z_ = _Z_[esample2,:]
210
+
end
211
+
186
212
# for a Vector{Float64}, convert(Vector{Float64}, y) aliases y
187
213
Xendo =convert(Matrix{Float64}, _Xendo_)
188
214
all(isfinite, Xendo) ||throw("Some observations for the endogenous variables are infinite")
@@ -194,6 +220,22 @@ function reg(
194
220
formula_schema =FormulaTerm(formula_schema.lhs, (tuple(eachterm(formula_schema.rhs)..., (term for term ineachterm(formula_endo_schema.rhs) if term !=ConstantTerm(0))...)))
195
221
end
196
222
223
+
# PR #109, to be removed when fixed in StatsModels
224
+
if!all(esample2)
225
+
if esample !=Colon() &&!all(esample)
226
+
throw(ArgumentError("You passed a dataset missing with observations and used formula terms that introduce missings. This is not yet supported."))
227
+
end
228
+
_y_ = _y_[esample2]
229
+
_Xexo_ = _Xexo_[esample2,:]
230
+
231
+
if esample ==Colon()
232
+
esample = esample2
233
+
else
234
+
esample .&= esample2
235
+
end
236
+
nobs =sum(esample)
237
+
end
238
+
197
239
# for a Vector{Float64}, convert(Vector{Float64}, y) aliases y
198
240
y =convert(Vector{Float64}, _y_)
199
241
all(isfinite, y) ||throw("Some observations for the dependent variable are infinite")
0 commit comments