-
Notifications
You must be signed in to change notification settings - Fork 34
Milestone
Description
Pretty straight forward. I would expect the results of these to be the same:
function mwe(N=10)
df = DataFrame(x = rand(N),
zm = Vector{Union{Missing, Int}}(rand(1:4,N)),
z = Vector{Int}(rand(1:4,N)))
println("W/out missings")
f = @eval(@formula(x ~ z))
f = apply_schema(f, schema(f,df), StatisticalModel)
m = modelcols(f.rhs, df)
display(m)
println("With missings")
f = @eval(@formula(x ~ zm))
f = apply_schema(f, schema(f,df), StatisticalModel)
m = modelcols(f.rhs, df)
display(m)
end
mwe()
OUTPUT:
W/out missings
10×2 Array{Float64,2}:
1.0 3.0
1.0 3.0
1.0 2.0
1.0 2.0
1.0 1.0
1.0 2.0
1.0 4.0
1.0 1.0
1.0 4.0
With missings
10×4 Array{Float64,2}:
1.0 0.0 1.0 0.0
1.0 0.0 1.0 0.0
1.0 0.0 0.0 0.0
1.0 0.0 0.0 0.0
1.0 0.0 1.0 0.0
1.0 0.0 0.0 0.0
1.0 0.0 1.0 0.0
1.0 1.0 0.0 0.0
1.0 0.0 0.0 1.0
1.0 0.0 1.0 0.0
Metadata
Metadata
Assignees
Labels
No labels